/* ===== Archive Page Styles ===== */

/* Nav Links */
nav {
    justify-content: space-between;
}

.nav-links {
    display: flex;
    gap: 16px;
    align-items: center;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.logo {
    text-decoration: none;
}

/* Archive Hero */
.archive-hero {
    padding: 40px 0 24px;
    text-align: center;
}

.archive-title {
    margin-bottom: 12px;
}

.archive-subtitle {
    font-size: 17px;
    color: var(--color-text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* Tab Buttons */
.archive-tabs-section {
    padding: 0 0 32px;
}

.tab-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border: 2px solid #e5e5e5;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.tab-btn:hover {
    border-color: var(--color-primary-light);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(13, 92, 63, 0.3);
}

.tab-icon {
    font-size: 20px;
}

.tab-content {
    display: none;
    padding-bottom: 60px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Calendar ===== */
.calendar-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.calendar-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-gold));
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.cal-nav-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: var(--color-background);
    border-radius: 50%;
    font-size: 22px;
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.cal-nav-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: scale(1.1);
}

.cal-month-title {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--color-primary-dark);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.cal-header {
    padding: 8px 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    border-radius: 10px;
    transition: all 0.2s ease;
    position: relative;
}

.cal-day.empty {
    visibility: hidden;
}

.cal-day.friday {
    color: var(--color-primary);
    font-weight: 700;
}

.cal-day.has-sermon {
    background: rgba(13, 92, 63, 0.1);
    color: var(--color-primary);
    cursor: pointer;
    font-weight: 700;
}

.cal-day.has-sermon::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    background: var(--color-gold);
    border-radius: 50%;
}

.cal-day.has-sermon:hover {
    background: var(--color-primary);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(13, 92, 63, 0.3);
}

.cal-day.has-sermon:hover::after {
    background: white;
}

.cal-day.selected {
    background: var(--color-primary) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(13, 92, 63, 0.3);
}

.cal-day.selected::after {
    background: white !important;
}

.cal-day.today {
    box-shadow: inset 0 0 0 2px var(--color-gold);
}

.cal-day.future {
    opacity: 0.3;
}

/* ===== Sermon Detail Card ===== */
.sermon-detail-card {
    max-width: 600px;
    margin: 24px auto 0;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-date {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(13, 92, 63, 0.1);
}

.detail-day {
    display: block;
    font-family: var(--font-heading);
    font-size: 26px;
    color: var(--color-primary-dark);
    font-weight: 700;
}

.detail-label {
    display: block;
    font-size: 13px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.sermon-card-detail {
    padding: 24px;
    background: var(--color-background);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    border-left: 4px solid var(--color-primary);
}

.sermon-card-detail:last-child {
    margin-bottom: 0;
}

.sermon-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.mosque-icon {
    font-size: 32px;
}

.mosque-name {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--color-primary-dark);
    margin: 0;
}

.imam-name {
    font-size: 14px;
    color: var(--color-text-muted);
    margin: 2px 0 0;
}

.sermon-topic {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-gold);
    margin-bottom: 10px;
    font-style: italic;
}

.sermon-summary {
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: 14px;
}

.audio-link,
.page-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    padding: 6px 14px;
    background: rgba(13, 92, 63, 0.08);
    border-radius: var(--radius-sm);
    margin-right: 8px;
    transition: all 0.2s ease;
}

.audio-link:hover,
.page-link:hover {
    background: var(--color-primary);
    color: white;
}

.no-data {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 24px;
}

/* ===== Imam View ===== */
.imam-selector-card {
    max-width: 500px;
    margin: 0 auto 32px;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.imam-selector-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--color-gold), var(--color-primary));
}

.imam-select-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 22px;
    color: var(--color-primary-dark);
    margin-bottom: 16px;
}

.imam-dropdown {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e5e5;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-surface);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d5c3f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px;
}

.imam-dropdown:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(13, 92, 63, 0.1);
}

/* Imam Bio Card */
.imam-bio-card {
    max-width: 700px;
    margin: 0 auto 32px;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.3s ease;
}

.imam-bio-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.imam-avatar {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.imam-bio-info h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--color-primary-dark);
    margin: 0 0 6px;
}

.imam-mosque-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: var(--radius-lg);
}

.mosque-makkah {
    background: rgba(212, 175, 55, 0.15);
    color: #a08520;
}

.mosque-madinah {
    background: rgba(13, 92, 63, 0.1);
    color: var(--color-primary);
}

.imam-bio-text {
    font-size: 15px;
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: 20px;
}

.imam-stats {
    display: flex;
    gap: 32px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.stat-label {
    font-size: 12px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Imam Sermon List */
.imam-sermons-list {
    max-width: 700px;
    margin: 0 auto;
}

.imam-sermon-item {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--color-primary);
    transition: all 0.2s ease;
    animation: fadeIn 0.3s ease;
}

.imam-sermon-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.sermon-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.sermon-item-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
}

.sermon-item-topic {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-gold);
    font-style: italic;
}

.sermon-item-summary {
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 12px;
}

.sermon-item-links {
    display: flex;
    gap: 8px;
}

.audio-link-sm,
.page-link-sm {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    padding: 4px 12px;
    background: rgba(13, 92, 63, 0.06);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.audio-link-sm:hover,
.page-link-sm:hover {
    background: var(--color-primary);
    color: white;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .tab-buttons {
        flex-direction: column;
        max-width: 300px;
        margin: 0 auto;
    }

    .tab-btn {
        justify-content: center;
    }

    .calendar-card {
        padding: 20px 16px;
    }

    .cal-day {
        font-size: 12px;
    }

    .imam-bio-header {
        flex-direction: column;
        text-align: center;
    }

    .imam-stats {
        justify-content: center;
    }

    .sermon-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sermon-detail-card {
        padding: 20px;
    }

    .sermon-card-detail {
        padding: 16px;
    }
}