/* ============================================
   ROYAL ARCHIVE — Imperial Digital Repository
   Government Portal Stylesheet
   Classification: RESTRICTED
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;800;900&family=Cinzel:wght@400;600;700;800;900&family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Noto+Nastaliq+Urdu:wght@400;700&display=swap');

/* === CSS VARIABLES === */
:root {
    --navy-darkest: #0a0e1a;
    --navy-dark: #0f1628;
    --navy-mid: #1a2342;
    --navy-light: #243056;
    --navy-lighter: #2d3a6a;
    --gold-dark: #8b6914;
    --gold-mid: #b8860b;
    --gold-primary: #d4a017;
    --gold-light: #e8c547;
    --gold-lighter: #f0d86e;
    --gold-pale: #f5e6a3;
    --cream: #faf3e0;
    --cream-dark: #e8dcc8;
    --parchment: #f4edd3;
    --red-error: #c0392b;
    --red-dark: #922b21;
    --red-glow: #e74c3c;
    --green-subtle: #1a4a2e;
    --white: #ffffff;
    --text-light: #d1c8b0;
    --text-dim: #8a7e6b;
    --border-gold: rgba(212, 160, 23, 0.3);
    --shadow-gold: rgba(212, 160, 23, 0.15);
    --shadow-dark: rgba(0, 0, 0, 0.5);
}

/* === RESET & BASE === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'EB Garamond', 'Georgia', 'Times New Roman', serif;
    background-color: var(--navy-darkest);
    color: var(--cream);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* === BACKGROUND TEXTURE === */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(212, 160, 23, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 160, 23, 0.02) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(26, 35, 66, 0.5) 0%, transparent 50%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(212, 160, 23, 0.008) 2px,
            rgba(212, 160, 23, 0.008) 4px
        );
    pointer-events: none;
    z-index: 0;
}

/* === TOP SECURITY BANNER === */
.security-banner {
    background: linear-gradient(90deg, var(--red-dark), #7b241c, var(--red-dark));
    color: var(--white);
    text-align: center;
    padding: 6px 20px;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 100;
}

.security-banner::before,
.security-banner::after {
    content: '◆';
    margin: 0 15px;
    color: var(--gold-light);
}

/* === HEADER === */
.site-header {
    background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy-mid) 100%);
    border-bottom: 3px solid var(--gold-mid);
    padding: 0;
    position: relative;
    z-index: 50;
    box-shadow:
        0 2px 20px var(--shadow-dark),
        0 1px 0 var(--gold-dark);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 40px;
    gap: 25px;
    position: relative;
}

.header-top::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-gold), var(--gold-mid), var(--border-gold), transparent);
}

/* === SEAL / CREST === */
.seal-container {
    flex-shrink: 0;
}

.royal-seal {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid var(--gold-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, var(--navy-mid) 0%, var(--navy-dark) 100%);
    box-shadow:
        0 0 15px var(--shadow-gold),
        inset 0 0 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.royal-seal img {
    width: 70px;
    height: 70px;
    opacity: 0.9;
}

.royal-seal .seal-fallback {
    font-size: 2.2rem;
    color: var(--gold-primary);
    text-shadow: 0 0 10px var(--shadow-gold);
}

.royal-seal::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 1px solid rgba(212, 160, 23, 0.2);
}

/* === HEADER TEXT === */
.header-text {
    text-align: center;
}

.header-urdu {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1rem;
    color: var(--gold-light);
    margin-bottom: 2px;
    opacity: 0.8;
}

.header-title {
    font-family: 'Cinzel', serif;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--gold-primary);
    letter-spacing: 5px;
    text-transform: uppercase;
    text-shadow:
        0 1px 3px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(212, 160, 23, 0.1);
    line-height: 1.2;
}

.header-subtitle {
    font-family: 'EB Garamond', serif;
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-top: 4px;
}

.header-dept {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    color: var(--gold-dark);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-gold);
    display: inline-block;
}

/* === NAVIGATION === */
.main-nav {
    background: linear-gradient(180deg, rgba(15, 22, 40, 0.9), rgba(10, 14, 26, 0.95));
    border-top: 1px solid var(--border-gold);
}

.nav-list {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: stretch;
    max-width: 900px;
    margin: 0 auto;
}

.nav-list li {
    position: relative;
}

.nav-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    color: var(--cream-dark);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    position: relative;
}

.nav-list a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gold-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-list a:hover {
    color: var(--gold-light);
    background: rgba(212, 160, 23, 0.05);
}

.nav-list a:hover::before {
    width: 100%;
}

.nav-list a.active {
    color: var(--gold-primary);
    background: rgba(212, 160, 23, 0.08);
}

.nav-list a.active::before {
    width: 100%;
    background: var(--gold-primary);
}

.nav-icon {
    font-size: 1rem;
    opacity: 0.7;
}

.nav-list li:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: var(--border-gold);
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    position: relative;
    z-index: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 30px;
}

/* === HOME PAGE SECTIONS === */
.welcome-section {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(26, 35, 66, 0.4), rgba(15, 22, 40, 0.6));
    border: 1px solid var(--border-gold);
    border-radius: 2px;
    position: relative;
}

.welcome-section::before,
.welcome-section::after {
    content: '✦';
    position: absolute;
    color: var(--gold-dark);
    font-size: 1.2rem;
    opacity: 0.5;
}

.welcome-section::before {
    top: 15px;
    left: 20px;
}

.welcome-section::after {
    bottom: 15px;
    right: 20px;
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold-primary);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.section-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-mid), transparent);
    margin: 15px auto;
}

.welcome-text {
    font-size: 1.05rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

/* === INFO CARDS === */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.info-card {
    background: linear-gradient(160deg, rgba(26, 35, 66, 0.5), rgba(15, 22, 40, 0.7));
    border: 1px solid var(--border-gold);
    border-radius: 2px;
    padding: 30px;
    position: relative;
    transition: border-color 0.3s ease;
}

.info-card:hover {
    border-color: var(--gold-mid);
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
}

.card-icon {
    font-size: 1.8rem;
    margin-bottom: 12px;
    display: block;
}

.card-title {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.card-text {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.7;
}

/* === NOTICE SECTION === */
.notice-section {
    background: linear-gradient(135deg, rgba(26, 35, 66, 0.3), rgba(15, 22, 40, 0.5));
    border: 1px solid var(--border-gold);
    border-left: 3px solid var(--gold-mid);
    border-radius: 2px;
    padding: 30px;
    margin-bottom: 40px;
}

.notice-title {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold-primary);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.notice-list {
    list-style: none;
    padding: 0;
}

.notice-list li {
    padding: 8px 0;
    color: var(--text-light);
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(212, 160, 23, 0.08);
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.notice-list li:last-child {
    border-bottom: none;
}

.notice-list li::before {
    content: '›';
    color: var(--gold-mid);
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notice-date {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-style: italic;
}

/* === ACCESS DENIED PAGE === */
.access-denied-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.access-denied-box {
    background: linear-gradient(160deg, rgba(26, 35, 66, 0.5), rgba(15, 22, 40, 0.8));
    border: 2px solid var(--red-dark);
    border-radius: 3px;
    padding: 60px 80px;
    position: relative;
    max-width: 600px;
    box-shadow:
        0 0 30px rgba(192, 57, 43, 0.1),
        inset 0 0 30px rgba(0, 0, 0, 0.2);
}

.access-denied-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--red-error), transparent);
}

.access-denied-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: block;
    opacity: 0.8;
}

.access-denied-title {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--red-error);
    letter-spacing: 6px;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(231, 76, 60, 0.3);
    margin-bottom: 15px;
}

.access-denied-code {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--red-dark);
    letter-spacing: 2px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.access-denied-message {
    font-size: 1rem;
    color: var(--text-dim);
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

.access-denied-ref {
    margin-top: 25px;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: rgba(138, 126, 107, 0.5);
    letter-spacing: 1px;
}

/* === BACKUP / FILE DIRECTORY === */
.directory-container {
    max-width: 800px;
    margin: 0 auto;
}

.directory-header {
    background: linear-gradient(135deg, rgba(26, 35, 66, 0.6), rgba(15, 22, 40, 0.8));
    border: 1px solid var(--border-gold);
    border-bottom: none;
    padding: 20px 25px;
    border-radius: 2px 2px 0 0;
}

.directory-path {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--gold-light);
    letter-spacing: 1px;
}

.directory-path span {
    color: var(--text-dim);
}

.directory-list {
    background: linear-gradient(180deg, rgba(15, 22, 40, 0.9), rgba(10, 14, 26, 0.95));
    border: 1px solid var(--border-gold);
    border-radius: 0 0 2px 2px;
    list-style: none;
    padding: 0;
}

.directory-list li {
    display: flex;
    align-items: center;
    padding: 18px 25px;
    border-bottom: 1px solid rgba(212, 160, 23, 0.08);
    transition: background 0.2s ease;
}

.directory-list li:last-child {
    border-bottom: none;
}

.directory-list li:hover {
    background: rgba(212, 160, 23, 0.03);
}

.file-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    flex-shrink: 0;
    opacity: 0.7;
}

.file-info {
    flex: 1;
}

.file-link {
    color: var(--gold-light);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: color 0.2s ease;
    display: inline-block;
}

.file-link:hover {
    color: var(--gold-lighter);
    text-decoration: underline;
}

.file-label {
    display: block;
    font-family: 'EB Garamond', serif;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 3px;
}

.file-meta {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: rgba(138, 126, 107, 0.4);
    text-align: right;
    flex-shrink: 0;
    margin-left: 20px;
}

/* === CORRUPTED FILE PAGE === */
.corrupted-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.corrupted-box {
    background: linear-gradient(160deg, rgba(26, 35, 66, 0.4), rgba(15, 22, 40, 0.7));
    border: 2px solid var(--red-dark);
    border-radius: 3px;
    padding: 50px 70px;
    max-width: 550px;
    position: relative;
}

.corrupted-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        var(--red-error),
        var(--red-error) 10px,
        transparent 10px,
        transparent 20px
    );
}

.corrupted-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.corrupted-title {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--red-error);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 15px;
    text-shadow: 0 0 15px rgba(231, 76, 60, 0.3);
}

.corrupted-message {
    font-size: 1.1rem;
    color: var(--red-glow);
    font-weight: 600;
}

.corrupted-detail {
    margin-top: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: rgba(138, 126, 107, 0.4);
}

/* === FOOTER === */
.site-footer {
    background: linear-gradient(180deg, var(--navy-mid), var(--navy-dark));
    border-top: 2px solid var(--gold-dark);
    padding: 30px 40px;
    text-align: center;
    position: relative;
    z-index: 10;
    margin-top: auto;
}

.footer-crest {
    font-size: 1.5rem;
    color: var(--gold-dark);
    margin-bottom: 10px;
    opacity: 0.6;
}

.footer-text {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 3px;
    text-transform: uppercase;
    line-height: 2;
}

.footer-text a {
    color: var(--gold-dark);
    text-decoration: none;
}

.footer-legal {
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    color: rgba(138, 126, 107, 0.3);
    letter-spacing: 1px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        padding: 15px 20px;
        gap: 12px;
    }

    .header-title {
        font-size: 1.3rem;
        letter-spacing: 3px;
    }

    .nav-list {
        flex-wrap: wrap;
    }

    .nav-list a {
        padding: 10px 16px;
        font-size: 0.7rem;
    }

    .main-content {
        padding: 25px 15px;
    }

    .welcome-section {
        padding: 25px 20px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .access-denied-box {
        padding: 40px 30px;
    }

    .access-denied-title {
        font-size: 1.6rem;
        letter-spacing: 4px;
    }
}

/* === ANIMATION KEYFRAMES === */
@keyframes subtlePulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

.access-denied-icon {
    animation: subtlePulse 3s ease-in-out infinite;
}

/* === CLASSIFICATION STAMP === */
.classification-stamp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: 'Cinzel', serif;
    font-size: 0.55rem;
    color: rgba(212, 160, 23, 0.15);
    letter-spacing: 3px;
    text-transform: uppercase;
    transform: rotate(-5deg);
    pointer-events: none;
    z-index: 1000;
    border: 1px solid rgba(212, 160, 23, 0.08);
    padding: 5px 12px;
}