:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
    --blob-1: #818cf8;
    --blob-2: #c084fc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
}

/* Background Blobs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--blob-1);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--blob-2);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 15%) scale(1.1); }
}

/* Glass Header */
.glass-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem 2rem;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-weight: 800;
    font-size: 2rem;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lang-switcher {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.filter-bar {
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
}

#search-input {
    width: 100%;
    max-width: 600px;
    padding: 1rem 1.5rem;
    border-radius: 30px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 1.1rem;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 2.5rem;
}

/* Flip Card */
.bird-card {
    perspective: 1200px;
    height: 460px;
    cursor: pointer;
}

.card-flip-scene {
    width: 100%;
    height: 100%;
    perspective: 1200px;
    cursor: pointer;
}

.card-flip-body {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
}

.card-flip-body.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* FRONT */
.card-front {
    background: #111;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card-flip-scene:not(.flipped):hover .card-img {
    transform: scale(1.06);
}

.front-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.85) 100%);
    pointer-events: none;
}

.front-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.4rem 1.2rem 1rem;
    text-align: center;
}

.front-en {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--accent-color);
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.front-vn {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.flip-hint {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 0.3rem 0.7rem;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.75);
}

.card-zoom-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
    z-index: 5;
    line-height: 1;
}

.card-flip-scene:hover .card-zoom-btn {
    opacity: 1;
    transform: scale(1);
}

.card-zoom-btn:hover {
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    transform: scale(1.15) !important;
    box-shadow: 0 4px 20px rgba(56,189,248,0.5);
}

/* BACK */
.card-back {
    transform: rotateY(180deg);
    background: #1e293b;
    display: flex;
    flex-direction: column;
}

.back-photo-strip {
    height: 120px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.back-photo-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.45) saturate(1.2);
}

.back-photo-strip::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), #1e293b);
}

.strip-names {
    position: absolute;
    bottom: 0.7rem;
    left: 1.1rem;
    right: 1.1rem;
    z-index: 1;
}

.back-main-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.back-sub-name {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent-color);
    margin-top: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.back-info {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-section-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}

.bird-desc {
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.6;
}

.bird-funfact {
    margin-top: auto;
    background: rgba(129, 140, 248, 0.12);
    border-left: 3px solid var(--blob-1);
    border-radius: 0 8px 8px 0;
    padding: 0.6rem 0.8rem;
}

.funfact-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #a78bfa;
    margin-bottom: 0.2rem;
}

.funfact-text {
    font-size: 0.78rem;
    color: #c4b5fd;
    line-height: 1.5;
}

/* Footer */
.glass-footer {
    text-align: center;
    padding: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
    color: var(--text-secondary);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--accent-hover);
}

.about-btn {
    background: linear-gradient(135deg, var(--accent-color), var(--blob-1));
    border: none;
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-left: 1rem;
}

.about-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.3);
}

.more-photos-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.more-photos-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* About Section Typography */
.about-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.about-header .subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.contact-info {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.about-body h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    color: #e2e8f0;
}
.about-body p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
.about-body ul {
    list-style: none;
    color: var(--text-secondary);
    line-height: 1.8;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Gallery Modal */
.gallery-content {
    max-width: 1100px !important;
}

.gallery-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    margin-top: -0.5rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.gallery-thumb-wrap {
    position: relative;
    padding-top: 75%;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.gallery-thumb-wrap:hover {
    border-color: var(--accent-color);
    transform: scale(1.03);
}

.gallery-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-thumb-wrap:hover .gallery-img {
    transform: scale(1.08);
}

.gallery-zoom-icon {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.6);
    color: white;
    border-radius: 50%;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-thumb-wrap:hover .gallery-zoom-icon {
    opacity: 1;
}

#gallery-title {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

/* Full-Screen Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(8, 8, 15, 0.97);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    z-index: 10;
}

.lightbox-close:hover {
    color: var(--accent-color);
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    font-size: 3rem;
    width: 56px; height: 56px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--accent-color);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-img-wrap {
    max-width: calc(100vw - 160px);
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img-wrap img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
    transition: opacity 0.25s ease;
}

.lightbox-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.5);
    color: rgba(255,255,255,0.8);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    .two-col {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .about-btn {
        margin-left: 0;
        margin-top: 1rem;
    }
}
