/* Design Tokens & Theme Variables */
:root {
    --bg-primary: #EEF3F8;
    --bg-secondary: #E3EAF1;
    --text-primary: #1E2D3D;
    --text-secondary: #586B7E;
    --accent-blue: #3E85C7;
    --accent-light: #89B6E2;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.65);
    --glass-shadow: 0 8px 32px 0 rgba(31, 55, 90, 0.06);
    --crystal-shadow: 0 0 15px rgba(62, 133, 199, 0.15);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    position: relative;
}

/* Ice-Crystal Orbs Background */
.bg-gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.6;
    pointer-events: none;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(137, 182, 226, 0.25) 0%, rgba(255,255,255,0) 70%);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(62, 133, 199, 0.15) 0%, rgba(255,255,255,0) 70%);
    bottom: -200px;
    right: -200px;
}

/* App Container */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
    gap: 24px;
    flex-wrap: wrap;
}

.header-logo {
    display: flex;
    flex-direction: column;
}

/* Navbar Tabs styling */
.navbar-tabs {
    display: flex;
    gap: 8px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 6px;
    border-radius: 40px;
    box-shadow: var(--glass-shadow);
}

.nav-tab-btn {
    border: none;
    background: transparent;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
}

.nav-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.4);
}

.nav-tab-btn.active {
    background: var(--accent-blue);
    color: white;
    box-shadow: var(--crystal-shadow);
}

.logo-crystal {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-sub {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Glassmorphism Search Container */
.search-container {
    flex: 1;
    max-width: 480px;
    min-width: 280px;
}

.search-box {
    display: flex;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 6px 6px 6px 20px;
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent-blue);
    box-shadow: var(--crystal-shadow);
    background: rgba(255, 255, 255, 0.85);
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
    color: var(--text-primary);
    font-family: var(--font-body);
}

.search-box input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.search-box button {
    background: var(--accent-blue);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-box button:hover {
    background: #2b70b0;
    transform: scale(1.02);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 16px 28px;
    border-radius: var(--radius-md);
    align-self: flex-start;
    box-shadow: var(--glass-shadow);
}

.stats-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.stats-val {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--accent-blue);
}

.stats-lbl {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Albums Grid */
.grid-section {
    position: relative;
    min-height: 400px;
    flex: 1;
}

.albums-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

/* Responsive columns for cosplay gallery */
@media (max-width: 1400px) {
    .albums-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
@media (max-width: 1150px) {
    .albums-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 900px) {
    .albums-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
    overflow: hidden;
}

/* Album Card design */
.album-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.album-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 36px 0 rgba(31, 55, 90, 0.12);
}

.card-img-wrapper {
    position: relative;
    padding-bottom: 125%; /* 4:5 Aspect Ratio */
    background-color: var(--bg-secondary);
    overflow: hidden;
}

.card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.album-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

/* Badges */
.card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.badge {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.badge-video {
    background: rgba(62, 133, 199, 0.9);
    color: white;
    border-color: rgba(62, 133, 199, 0.4);
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge-video svg {
    width: 12px;
    height: 12px;
}

.card-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 44px; /* Fixed height for consistency */
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.meta-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-count svg {
    opacity: 0.6;
}

/* Crystal Spinner */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    width: 100%;
}

.crystal-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(62, 133, 199, 0.15);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.55, 0.055, 0.675, 0.19) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Pagination */
.pagination-footer {
    margin-top: 48px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.page-btn:hover {
    background: white;
    border-color: var(--accent-light);
}

.page-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    box-shadow: var(--crystal-shadow);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Modals & Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(30, 45, 61, 0.25);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-container {
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.85);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.modal-close-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition);
}

.modal-close-btn:hover {
    background: white;
    transform: translateX(-2px);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.modal-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Custom Scrollbar for Modal content */
.modal-content::-webkit-scrollbar {
    width: 8px;
}
.modal-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(62, 133, 199, 0.2);
    border-radius: 4px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(62, 133, 199, 0.4);
}

/* Video Section styling */
.video-section h3, .gallery-section h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.video-wrapper {
    background: black;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    max-height: 480px;
    margin: 0 auto;
    width: 100%;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    outline: none;
}

/* Gallery Section styling */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.gallery-item {
    position: relative;
    padding-bottom: 125%; /* 4:5 ratio */
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    transition: var(--transition);
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(62, 133, 199, 0.1);
    border-color: rgba(255, 255, 255, 0.9);
}

/* Lightbox overlay styling */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(13, 22, 31, 0.95);
    backdrop-filter: blur(15px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.lightbox-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80vh;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

.lightbox-nav {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--accent-light);
}

.lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    padding: 6px 16px;
    border-radius: 20px;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    /* Disable heavy blur background orbs on mobile/tablet to improve scroll performance */
    .bg-gradient-orb {
        display: none !important;
    }

    /* Disable GPU-heavy backdrop-filter blur effects on mobile/tablet devices */
    .glass-card, 
    .app-header, 
    .navbar-tabs, 
    .search-box, 
    .stats-bar, 
    .page-btn, 
    .badge, 
    .modal-overlay, 
    .modal-container, 
    .modal-close-btn, 
    .lightbox-overlay, 
    .lightbox-counter {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Fallback solid/near-solid background colors for glassmorphism components on mobile/tablet for readability */
    .glass-card, 
    .modal-container {
        background: rgba(255, 255, 255, 0.95) !important;
        border-color: rgba(0, 0, 0, 0.08) !important;
    }

    .navbar-tabs, 
    .search-box {
        background: rgba(255, 255, 255, 0.95) !important;
        border-color: rgba(0, 0, 0, 0.08) !important;
    }

    .stats-bar {
        background: rgba(255, 255, 255, 0.95) !important;
        border-color: rgba(0, 0, 0, 0.08) !important;
    }

    .page-btn {
        background: rgba(255, 255, 255, 0.95) !important;
        border-color: rgba(0, 0, 0, 0.08) !important;
    }

    .badge {
        background: rgba(255, 255, 255, 0.95) !important;
        border-color: rgba(0, 0, 0, 0.08) !important;
    }

    .badge-video {
        background: rgba(62, 133, 199, 0.95) !important;
        color: white !important;
    }

    .modal-overlay {
        background: rgba(30, 45, 61, 0.6) !important;
    }

    .lightbox-overlay {
        background: rgba(13, 22, 31, 0.98) !important;
    }

    .app-header {
        margin-bottom: 32px;
    }
    .search-container {
        max-width: 100%;
    }
    .lightbox-overlay {
        padding: 0 16px;
    }
    .lightbox-nav {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 600px) {
    .app-container {
        padding: 24px 16px;
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }
    .logo-crystal {
        font-size: 26px;
    }
    .search-container {
        min-width: 100%;
    }
    .navbar-tabs {
        width: 100%;
        justify-content: space-around;
        order: 3; /* Push to new line on mobile */
        margin-top: 8px;
        gap: 4px;
        padding: 4px;
    }
    .nav-tab-btn {
        padding: 6px 6px;
        font-size: 10.5px;
        flex: 1;
        text-align: center;
    }
    .albums-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .stats-bar {
        width: 100%;
        justify-content: space-around;
        gap: 16px;
        align-self: stretch; /* Override flex-start alignment */
    }
    .modal-overlay {
        padding: 12px;
    }
    .modal-container {
        max-height: 95vh;
    }
    .modal-header {
        padding: 16px;
    }
    .modal-title {
        font-size: 14px;
    }
    .modal-close-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .modal-content {
        padding: 16px;
        gap: 20px;
    }
    .video-wrapper {
        max-height: 200px;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
}
