/* Page background color */
body {
    background-color: #eef5f7 !important;
}

html {
    background-color: #eef5f7 !important;
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Infinite Scroll Styles */

/* Website Card Styles */
.website-card {
    /* Cards start hidden and fade in when loaded */
    opacity: 0;
    transform: translateY(0);
    will-change: opacity;
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 24px !important;
    background-color: #efefef !important;
}

.website-card.fade-in {
    /* Animate when class is added (for AJAX loaded content) */
    animation: fadeIn 0.8s ease-in-out forwards;
}

.website-card:hover {
    transform: translateY(-4px);
}

.website-card.search-match {
    animation: highlightSearch 0.6s ease-in-out;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

@keyframes highlightSearch {
    0% {
        transform: scale(1);
        box-shadow: 4px 4px 12px rgba(190, 190, 190, 0.3),
            -4px -4px 12px rgba(255, 255, 255, 0.8);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 6px 6px 15px rgba(190, 190, 190, 0.4),
            -6px -6px 15px rgba(255, 255, 255, 0.9);
    }
    100% {
        transform: scale(1);
        box-shadow: 4px 4px 12px rgba(190, 190, 190, 0.3),
            -4px -4px 12px rgba(255, 255, 255, 0.8);
    }
}

/* Glass Background */
.website-card::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    border-radius: 10px;
    overflow: hidden;
    outline: 2px solid white;
}

/* Animated Blob Background */
.website-card::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c);
    opacity: 0.3;
    filter: blur(12px);
    animation: blob-bounce 8s infinite ease;
}

@keyframes blob-bounce {
    0% {
        transform: translate(-100%, -100%) translate3d(0, 0, 0);
    }
    25% {
        transform: translate(-100%, -100%) translate3d(100%, 0, 0);
    }
    50% {
        transform: translate(-100%, -100%) translate3d(100%, 100%, 0);
    }
    75% {
        transform: translate(-100%, -100%) translate3d(0, 100%, 0);
    }
    100% {
        transform: translate(-100%, -100%) translate3d(0, 0, 0);
    }
}

/* No staggered delay to prevent jitter on page load */

/* Loading Spinner */
.infinite-scroll-loading {
    text-align: center;
    padding: 40px 20px;
    margin: 20px 0;
    border-radius: 10px;
}

.loader {
    --fill-color: #0d084d;
    --shine-color: #5c3d9933;
    transform: scale(0.5); /* You can change the size */
    width: 100px;
    height: auto;
    position: relative;
    filter: drop-shadow(0 0 10px var(--shine-color));
    margin: 0 auto 15px;
}

.loader #pegtopone {
    position: absolute;
    animation: flowe-one 1s linear infinite;
}

.loader #pegtoptwo {
    position: absolute;
    opacity: 0;
    transform: scale(0) translateY(-200px) translateX(-100px);
    animation: flowe-two 1s linear infinite;
    animation-delay: 0.3s;
}

.loader #pegtopthree {
    position: absolute;
    opacity: 0;
    transform: scale(0) translateY(-200px) translateX(100px);
    animation: flowe-three 1s linear infinite;
    animation-delay: 0.6s;
}

.loader svg g path:first-child {
    fill: var(--fill-color);
}

@keyframes flowe-one {
    0% {
        transform: scale(0.5) translateY(-200px);
        opacity: 0;
    }
    25% {
        transform: scale(0.75) translateY(-100px);
        opacity: 1;
    }
    50% {
        transform: scale(1) translateY(0px);
        opacity: 1;
    }
    75% {
        transform: scale(0.5) translateY(50px);
        opacity: 1;
    }
    100% {
        transform: scale(0) translateY(100px);
        opacity: 0;
    }
}

@keyframes flowe-two {
    0% {
        transform: scale(0.5) rotateZ(-10deg) translateY(-200px)
            translateX(-100px);
        opacity: 0;
    }
    25% {
        transform: scale(1) rotateZ(-5deg) translateY(-100px) translateX(-50px);
        opacity: 1;
    }
    50% {
        transform: scale(1) rotateZ(0deg) translateY(0px) translateX(-25px);
        opacity: 1;
    }
    75% {
        transform: scale(0.5) rotateZ(5deg) translateY(50px) translateX(0px);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotateZ(10deg) translateY(100px) translateX(25px);
        opacity: 0;
    }
}

@keyframes flowe-three {
    0% {
        transform: scale(0.5) rotateZ(10deg) translateY(-200px)
            translateX(100px);
        opacity: 0;
    }
    25% {
        transform: scale(1) rotateZ(5deg) translateY(-100px) translateX(50px);
        opacity: 1;
    }
    50% {
        transform: scale(1) rotateZ(0deg) translateY(0px) translateX(25px);
        opacity: 1;
    }
    75% {
        transform: scale(0.5) rotateZ(-5deg) translateY(50px) translateX(0px);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotateZ(-10deg) translateY(100px) translateX(-25px);
        opacity: 0;
    }
}

.infinite-scroll-loading p {
    color: #666;
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
}

/* No More Content Message */
.infinite-scroll-no-more {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    margin: 20px 0;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.infinite-scroll-no-more p {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
}

/* Sticky Search & Filter Bar */
.sticky-search-filter {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px 20px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.sticky-search-filter.show {
    transform: translateY(0);
}

/* Sticky Search Filter Styles */
.sticky-search-filter .search-input {
    padding: 12px 20px;
    font-size: 0.95rem;
}

.sticky-search-filter .search-section {
    margin: 0;
    padding: 0;
}

.sticky-search-filter .search-button {
    padding: 12px 20px;
}

.sticky-search-filter .clear-search-icon {
    right: 15px;
    padding: 0;
    width: 18px;
    height: 18px;
}

.sticky-search-filter .type-filter-container {
    margin-top: 0;
    padding: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 3px;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.3) transparent;
    flex: 1;
    max-width: calc(100% - 320px);
}

.sticky-search-filter .type-filter-container::-webkit-scrollbar {
    height: 4px;
}

.sticky-search-filter .type-filter-container::-webkit-scrollbar-track {
    background: transparent;
}

.sticky-search-filter .type-filter-container::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 2px;
}

.sticky-search-filter .type-filter-tag {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: none;
    background: white;
    color: #333;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    border: 1px solid #0d084d;
}

.sticky-search-filter .type-filter-tag.active {
    color: #333 !important;
    border: 1px solid #a3edb3 !important;
}

/* Original search section - add ID for reference */
.search-section {
    position: relative;
}

/* Main title styling */
.main-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #0d084d;
    text-align: center;
    margin: 0 0 2rem 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Hide main title in sticky bar */
.sticky-search-filter .main-title {
    display: none;
}

@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
        margin: 0 0 1.5rem 0;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.75rem;
        margin: 0 0 1rem 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .infinite-scroll-loading,
    .infinite-scroll-controls,
    .infinite-scroll-no-more {
        padding: 30px 15px;
    }

    .loader {
        transform: scale(0.4);
    }

    .sticky-search-filter {
        padding: 10px 15px;
    }

    .sticky-search-filter .search-input {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .sticky-search-filter .search-button {
        padding: 10px 15px;
    }

    .sticky-search-filter .type-filter-container {
        gap: 4px;
        padding-bottom: 2px;
        max-width: calc(100% - 280px);
    }

    .sticky-search-filter .search-input-group {
        max-width: 250px;
    }

    .archive-header {
        padding: 30px 15px;
    }

    .archive-header h1 {
        font-size: 2rem;
    }

    .websites-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .website-thumbnail {
        /* Maintain 3:2 aspect ratio on mobile */
        aspect-ratio: 3/2;
        height: auto;
    }

    .website-content {
        padding: 20px;
    }
}

/* Custom Search Input Style */
.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 50px;
    overflow: visible;
    transition: all 0.3s ease;
}

/* Sticky version overrides */
.sticky-search-filter .search-input-group {
    max-width: 300px;
    margin: 0;
    flex-shrink: 0;
}

.sticky-search-filter .search-form {
    margin: 0;
}

.search-input-group .icon {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 20px;
    color: #999;
    z-index: 1;
    pointer-events: none;
}

.search-input {
    flex: 1;
    padding: 15px 25px;
    border: none;
    font-size: 1rem;
    outline: none;
    background: transparent;
    border: 2px solid transparent !important;
    width: 15em !important;
    height: 3em !important;
    padding-left: 2.5em !important;
    padding-right: 0.8em !important;
    overflow: hidden !important;
    background-color: #deeaee !important;
    border-radius: 10px !important;
    transition: all 0.5s !important;
}

.search-input::placeholder {
    color: #999;
}

.search-input:hover,
.search-input:focus {
    border: 2px solid #0d084d !important;
    background-color: white !important;
    box-shadow: 0 0 0 4px rgb(234 76 137 / 10%);
}

.search-input:hover + .icon,
.search-input:focus + .icon {
    color: #0d084d !important;
}

/* Search Button Styles */
.search-button {
    display: none !important;
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: scale(1.05);
}

/* Archive page styles */
.demo-websites-archive {
    padding: 20px;
    padding-top: 100px;
    max-width: 1270px;
    margin: 0 auto;
}

/* Responsive overrides */
@media (max-width: 768px) {
    .demo-websites-archive {
        padding: 15px;
    }
}

/* Search Section Styles */
.search-section {
    margin: 30px 0 40px;
    padding: 0 20px;
}

.search-form {
    margin-bottom: 20px;
}

.clear-search-icon {
    padding: 0;
    background: transparent !important;
    border: none;
    color: #0d084d !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 15px;
    width: 20px;
    height: 20px;
    padding: 0 !important;
}

.clear-search-icon:hover {
    color: #667eea;
    transform: rotate(90deg);
}

.search-status {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 0.95rem;
}

.search-status {
    color: gray;
}

/* Type Filter Tags */
.type-filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
    padding: 0 20px;
}

.type-filter-tag {
    background: white !important;
    border: none;
    color: #333 !important;
    padding: 6px 12px !important;
    border-radius: 25px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    transition: all 0.3s ease;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
}

.type-filter-tag:hover {
    background: #f8f9fa;
}

.type-filter-tag.active {
    color: #333 !important;
    border: 1px solid #a3edb3 !important;
}

.type-filter-tag .type-count {
    font-size: 0.85rem;
    opacity: 0.8;
}

.type-filter-tag.active .type-count {
    opacity: 0.9;
}

.no-search-results-container {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    margin: 40px 0;
    border: 2px dashed #dee2e6;
}

.no-search-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.no-search-results-container h3 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 10px;
}

.no-search-results-container p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.clear-search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.clear-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* Search highlight */
.search-match .website-title {
    font-weight: 700;
}

.search-match .category-tag {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.websites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    /* Optimize for 12 posts: 3 columns on desktop, 4 on larger screens */
}

.website-thumbnail {
    position: relative;
    overflow: hidden;
    /* 3:2 aspect ratio container */
    aspect-ratio: 3/2;
    border-radius: 10px;
    flex-shrink: 0;
    z-index: 3;
}

.website-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.website-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.website-card:hover .website-overlay {
    opacity: 1;
}

.view-demo-btn {
    background: white;
    color: #0d084d !important;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0px 7px 0px -3px #ffb6b3;
    border-width: 1px 1px 1px 1px;
    border-style: solid;
    border-color: #dbd9ec;
}

.view-demo-btn svg {
    fill: #0d084d;
    transition: fill 0.3s ease;
}

.view-demo-btn:hover {
    background: #0d084d;
    color: white !important;
    transform: scale(0.95);
    box-shadow: none;
}

.view-demo-btn:hover svg {
    fill: white;
}

.website-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 3;
    position: relative;
    margin-top: 10px;
    width: 100%;
}

.website-title {
    margin: 0px !important;
    font-size: 16px !important;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.website-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-top: 4px;
    color: #777;
}

.website-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-tag {
    background: #f8f9fa;
    color: #666;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
    user-select: none;
    border: 1px solid #e9ecef;
}

.category-tag:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    border-color: #dee2e6;
}

/* Post ID Display Styles */
.post-id-display {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.post-id {
    background: #b1ffc2;
    border: 1px solid rgb(0, 224, 49);
    color: #0d084d;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
    transition: all 0.2s ease;
}

.no-websites {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-websites h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.pagination {
    text-align: center;
    margin-top: 40px;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pagination a,
.pagination span {
    padding: 10px 15px;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #007cba;
    color: white;
}

.pagination .current {
    background: #007cba;
    color: white;
}

/* Optimize grid for different screen sizes */
@media (min-width: 1200px) {
    .websites-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .websites-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    .websites-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
