/* =============================================
   G'oyib Yoronlar Jome Masjidi — Premium CSS
   ============================================= */

:root {
    --emerald: #107c5a;
    --emerald-deep: #0a523b;
    --emerald-dark: #073526;
    --gold: #d4a017;
    --gold-light: #f3c242;
    --gold-glow: rgba(212, 160, 23, 0.25);
    --white: #ffffff;
    --white-muted: #d1e3da;
    --glass-bg: rgba(16, 124, 90, 0.45);
    --glass-border: rgba(255, 255, 255, 0.15);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--emerald-dark);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: 'Playfair Display', serif;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Glassmorphism utility */
.glassmorphism {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

/* =========== HEADER =========== */
.main-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

/* Top bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 5%;
    font-size: 0.85rem;
}

.lang-switcher select {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--white);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
}

.lang-switcher select option {
    background: var(--emerald-deep);
    color: var(--white);
}

.social-links {
    display: flex;
    gap: 14px;
}

.social-icon {
    color: var(--gold);
    font-size: 1.1rem;
    transition: color var(--transition), transform var(--transition);
}

.social-icon:hover {
    color: var(--white);
    transform: scale(1.15);
}

/* =========== PRAYER BAR =========== */
.prayer-bar {
    padding: 0 5%;
    margin-top: 4px;
}

.prayer-bar-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 10px 20px;
    gap: 12px;
    flex-wrap: wrap;
    /* zoom uchun */
}

.clock-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding-right: 16px;
    border-right: 1px solid var(--glass-border);
}

.clock-time {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.clock-date {
    font-size: 0.66rem;
    color: var(--white-muted);
    white-space: nowrap;
}

/* Grid Container */
.prayer-times-grid-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Legends */
.prayer-legends {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    font-weight: 600;
    margin-bottom: 2px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.masjid-legend {
    color: var(--gold);
}

.api-legend {
    color: var(--white-muted);
}

.legend-item i {
    font-size: 0.7rem;
}

.update-badge {
    font-size: 0.58rem;
    color: rgba(212, 160, 23, 0.55);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 4px;
}

/* Grid */
.prayer-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    width: 100%;
}

.prayer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), transform 0.2s;
    border: 1px solid transparent;
}

.prayer-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.prayer-item.active {
    background: var(--gold-glow);
    border-color: rgba(201, 162, 39, 0.4);
    transform: translateY(-2px);
}

.p-name {
    font-size: 0.6rem;
    color: var(--white-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 4px;
}

.prayer-item.active .p-name {
    color: var(--gold-light);
}

.masjid-time {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.prayer-item.active .masjid-time {
    color: var(--gold-light);
}

.api-time {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--white-muted);
    font-variant-numeric: tabular-nums;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    width: 80%;
    text-align: center;
}

/* Countdown */
.countdown-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-left: 16px;
    border-left: 1px solid var(--glass-border);
    min-width: 94px;
}

.cd-label {
    font-size: 0.6rem;
    color: var(--white-muted);
    white-space: nowrap;
    text-align: center;
}

.cd-timer {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold-light);
    font-variant-numeric: tabular-nums;
    font-family: 'Inter', monospace;
}


/* =========== NAVBAR =========== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 5%;
    border-bottom: 1px solid rgba(201, 162, 39, 0.15);
    position: relative;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold);
    white-space: nowrap;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-menu a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--white);
    transition: color var(--transition);
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width var(--transition);
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-menu a:hover {
    color: var(--gold);
}

/* Donate button inside nav */
.nav-donate-btn {
    background: var(--gold) !important;
    color: var(--emerald-deep) !important;
    padding: 8px 22px !important;
    border-radius: 24px !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    transition: background var(--transition), transform var(--transition) !important;
}

.nav-donate-btn::after {
    display: none !important;
}

.nav-donate-btn:hover {
    background: var(--gold-light) !important;
    transform: translateY(-2px) !important;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 200;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========== HERO =========== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 5%;
    background: url('https://images.unsplash.com/photo-1584551246679-0daf3d275d0f?auto=format&fit=crop&q=80&w=2000') center/cover no-repeat;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(7, 53, 38, 0.75) 0%, rgba(16, 124, 90, 0.4) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
    padding-top: 240px;
    /* Header yopib qo'ymasligi uchun */
    padding-bottom: 40px;
}

.hero-title {
    font-size: 3.8rem;
    color: var(--gold);
    line-height: 1.15;
    margin-bottom: 16px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.hero-desc {
    font-size: 1rem;
    color: var(--white-muted);
    margin-bottom: 32px;
}

.hero-btn {
    display: inline-block;
    padding: 14px 36px;
    border: 2px solid var(--gold);
    color: var(--gold);
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition);
}

.hero-btn:hover {
    background: var(--gold);
    color: var(--emerald-deep);
    box-shadow: 0 4px 20px var(--gold-glow);
}

/* =========== SECTIONS =========== */
.section {
    padding: 80px 5%;
}

.section-alt {
    background: var(--emerald-deep);
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--white);
    display: inline-block;
    position: relative;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
}

/* About */
.about-card {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    text-align: center;
}

.about-icon {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 20px;
}

.about-card p {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--white-muted);
}

/* Team Section */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.team-card {
    padding: 30px 20px;
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
    position: relative;
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
}

.team-click-hint {
    position: absolute;
    top: 15px;
    right: 15px;
    color: var(--gold);
    opacity: 0.5;
    font-size: 1.2rem;
    transition: opacity var(--transition);
}

.team-card:hover .team-click-hint {
    opacity: 1;
}

.team-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--emerald-deep);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 12px var(--gold-glow);
}

.team-card h3 {
    font-size: 1.2rem;
    color: var(--gold-light);
    margin-bottom: 6px;
}

.team-role {
    font-size: 0.9rem;
    color: var(--white-muted);
    font-weight: 500;
}

/* News */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.news-card {
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
}

.news-img {
    height: 160px;
    background: linear-gradient(135deg, var(--emerald), var(--emerald-deep));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--gold);
}

.news-body {
    padding: 20px;
}

.news-date {
    font-size: 0.75rem;
    color: var(--gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-body h3 {
    font-size: 1.1rem;
    margin: 8px 0;
    color: var(--white);
    line-height: 1.4;
}

.news-body p {
    font-size: 0.9rem;
    color: var(--white-muted);
}

/* Events */
.events-card {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px;
    text-align: center;
}

.events-icon {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 20px;
}

.events-card p {
    font-size: 1.05rem;
    color: var(--white-muted);
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
}

.gallery-item {
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.2);
    transition: transform var(--transition);
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.04);
}

/* Contact & Map */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    align-items: stretch;
}

.contact-card {
    padding: 36px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 1rem;
}

.contact-item i {
    font-size: 1.3rem;
    color: var(--gold);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.contact-item a {
    color: var(--gold-light);
    transition: color var(--transition);
}

.contact-item a:hover {
    color: var(--white);
}

.contact-map-links {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.map-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--gold);
    color: var(--emerald-deep);
    transition: all var(--transition);
}

.map-link-btn:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--gold-glow);
}

.map-link-btn.yandex {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
}

.map-link-btn.yandex:hover {
    background: var(--gold);
    color: var(--emerald-deep);
}

.contact-map {
    min-height: 320px;
    overflow: hidden;
    padding: 0;
}

/* =========== FOOTER =========== */
.footer {
    text-align: center;
    padding: 28px 5%;
    border-top: 1px solid var(--glass-border);
    font-size: 0.85rem;
    color: var(--white-muted);
}

.footer-source {
    margin-top: 8px;
    font-size: 0.75rem;
}

.footer-source a {
    color: var(--gold);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--emerald-deep);
    border: 1px solid var(--emerald-light);
    border-radius: var(--radius);
    padding: 40px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: var(--white-muted);
    cursor: pointer;
    transition: color var(--transition);
}

.modal-close:hover {
    color: var(--gold);
}

.modal-avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--emerald-deep);
    font-size: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    box-shadow: 0 8px 30px var(--gold-glow);
    border: 4px solid var(--gold-glow);
}

.modal-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.modal-content h3 {
    color: var(--gold-light);
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.modal-role {
    color: var(--white-muted);
    font-size: 1rem;
    margin-bottom: 20px;
}

.modal-desc {
    color: var(--white-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ─── Lightbox Modal ─── */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: var(--white-muted);
    font-size: 2.5rem;
    cursor: pointer;
    transition: color var(--transition);
    line-height: 1;
}

.lightbox-close:hover {
    color: var(--gold);
}

/* =========================================
   RESPONSIVE — Telefon (max 768px)
   ========================================= */
@media (max-width: 768px) {

    /* Top bar */
    .top-bar {
        padding: 6px 4%;
    }

    /* Prayer bar: always horizontal, scroll */
    .prayer-bar {
        padding: 0 3%;
    }

    .prayer-bar-inner {
        padding: 10px 14px;
        gap: 10px;
        border-radius: var(--radius-sm);
    }

    .clock-block {
        padding-right: 10px;
        min-width: 60px;
    }

    .clock-time {
        font-size: 1.2rem;
    }

    .clock-date {
        font-size: 0.6rem;
    }

    .prayer-item {
        padding: 4px 8px;
        min-width: 52px;
    }

    .p-name {
        font-size: 0.55rem;
    }

    .p-time {
        font-size: 0.85rem;
    }

    .countdown-block {
        padding-left: 10px;
        min-width: 72px;
    }

    .cd-label {
        font-size: 0.55rem;
    }

    .cd-timer {
        font-size: 1rem;
    }

    /* Hamburger */
    .hamburger {
        display: flex;
    }

    .nav-logo {
        font-size: 0.85rem;
        max-width: 200px;
        white-space: normal;
        line-height: 1.2;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: var(--emerald-deep);
        padding: 20px 0;
        gap: 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        border-radius: 0 0 var(--radius) var(--radius);
        z-index: 150;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        display: block;
        padding: 14px 20px;
        font-size: 1.05rem;
    }

    .nav-menu a::after {
        display: none;
    }

    .nav-menu a:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .nav-donate-li {
        padding: 10px 20px;
    }

    .nav-donate-btn {
        display: block !important;
        text-align: center;
        width: 100%;
    }

    /* Hero */
    .hero {
        min-height: 85vh;
        padding-top: 180px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-desc {
        font-size: 0.9rem;
    }

    .hero-btn {
        padding: 12px 28px;
        font-size: 0.85rem;
    }

    /* Sections */
    .section {
        padding: 50px 4%;
    }

    .section-header h2 {
        font-size: 1.7rem;
    }

    .about-card,
    .events-card,
    .contact-card {
        padding: 24px;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .contact-map {
        min-height: 250px;
    }

    .map-link-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

/* Extra small phones */
@media (max-width: 400px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .prayer-item {
        padding: 3px 6px;
        min-width: 46px;
    }

    .p-name {
        font-size: 0.5rem;
    }

    .p-time {
        font-size: 0.78rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Kattalashganda ustiga chiqmasligi uchun */
@media (max-width: 1150px) {
    .prayer-bar-inner {
        flex-wrap: wrap;
        justify-content: center;
    }

    .prayer-times-grid-container {
        width: 100%;
        order: 3;
    }

    .hero-content {
        padding-top: 240px;
    }
}

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

    .hero-content {
        padding-top: 280px;
    }
}

@media (max-width: 500px) {
    .prayer-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .prayer-item {
        padding: 8px 2px;
    }

    .masjid-time {
        font-size: 1rem;
    }

    .prayer-legends {
        font-size: 0.55rem;
    }

    .hero-content {
        padding-top: 200px;
    }
}