/*
 * NCIS Public Web Theme
 * Visual refresh only; backend behavior and endpoints unchanged.
 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;700&family=Roboto:wght@400;500;700&display=swap');

:root {
    --saffron: #ff9933;
    --white: #ffffff;
    --india-green: #138808;
    --ashoka-blue: #0a3d91;
    --navy-900: #0f2347;
    --navy-700: #1c3c75;
    --slate-900: #111827;
    --slate-700: #374151;
    --slate-500: #6b7280;
    --slate-300: #d1d5db;
    --slate-200: #e5e7eb;
    --slate-100: #f3f4f6;
    --surface: #f7f9fc;
    --success: #1f7a34;
    --warning: #b45309;
    --info: #1d4ed8;
    --danger: #be123c;
    --primary-dark: #0f2347;
    --primary-medium: #0a3d91;
    --primary-light: #3f5f99;
    --accent-orange: #ff9933;
    --accent-gold: #d5b96a;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --shadow-sm: 0 2px 6px rgba(15, 35, 71, 0.08);
    --shadow-md: 0 10px 24px rgba(15, 35, 71, 0.12);
    --shadow-lg: 0 18px 35px rgba(15, 35, 71, 0.15);
    --font-heading: 'Roboto', 'Noto Sans', Arial, sans-serif;
    --font-body: 'Noto Sans', 'Roboto', Arial, sans-serif;
    --font-mono: 'Consolas', 'Courier New', monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--slate-900);
    background: #f5f5f5;
    min-height: 100vh;
}

a {
    color: var(--ashoka-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--navy-900);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.gov-band {
    height: 6px;
    background: linear-gradient(90deg, var(--saffron) 0%, var(--saffron) 33.33%, var(--white) 33.33%, var(--white) 66.66%, var(--india-green) 66.66%);
}

.site-header {
    background: #0a2b60;
    color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 20;
}

.flash-announcement {
    background: #001a4d;
    border-top: 3px solid var(--saffron);
    border-bottom: 2px solid rgba(255, 153, 51, 0.4);
    padding: 0.3rem 0;
    font-size: 0.95rem;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.flash-content {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.flash-label {
    font-weight: 700;
    color: var(--saffron);
    letter-spacing: 1px;
    white-space: nowrap;
    font-size: 1.05rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    animation: flash-blink 1.5s infinite;
}

.flash-text {
    color: #fff;
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

@keyframes flash-blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.header-top {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.header-ncis-logo {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    line-height: 0;
    box-shadow: none;
}

.header-ncis-logo img {
    height: 66px;
    width: auto;
    display: block;
    background: transparent;
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.title-hindi {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: 0.3px;
}

.title-english {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--white);
    letter-spacing: 0.2px;
}

.title-government {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.1px;
    margin-top: 0.25rem;
}

/* Header logos (uses the three user-provided images) */
/* header logos are now explicit DOM elements (.header-logos) for accessibility */
.header-logos {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-logos img {
    height: 45px;
    width: auto;
    display: block;
}

.header-logos img.small {
    height: 36px;
}

.header-logos img.ministry-logo {
    height: 48px;
}

.header-logos img.emblem {
    height: 58px;
}

.logo {
    display: none;
}

.logo-icon {
    display: none;
}

.logo-text {
    display: none;
}

.logo-text h1 {
    font-family: 'Source Sans 3', var(--font-body);
    font-size: clamp(1rem, 1.8vw, 1.4rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.tagline {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.88;
    letter-spacing: 0.01em;
}

.main-nav {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.2rem;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.3rem 0;
    margin: 0;
}

.main-nav a {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.3rem 0.8rem;
    border-radius: 2px;
    font-size: 0.95rem;
    font-weight: 400;
    display: block;
    text-decoration: none;
    transition: color 0.15s ease;
}

.main-nav a:hover {
    color: var(--white);
}

.main-nav a.active {
    color: var(--saffron);
    font-weight: 500;
}

.hero {
    position: relative;
    max-height: 90vh;
    overflow: hidden;
    border-bottom: 1px solid var(--slate-300);
}

.hero-image {
    width: 100%;
    height: 100%;
    min-height: 350px;
    object-fit: cover;
    filter: saturate(0.8);
}

.hero-video {
    width: 100%;
    height: 100%;
    min-height: 350px;
    object-fit: cover;
    display: block;
    filter: saturate(0.85);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.35);
}

.hero-content {
    width: min(900px, 92%);
    text-align: center;
    color: var(--white);
}

.hero-content h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.6rem;
    letter-spacing: -0.02em;
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    opacity: 0.96;
}

.hero-kicker {
    display: inline-block;
    margin-bottom: 0.7rem;
    padding: 0.25rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 3px;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(6, 19, 43, 0.35);
}

.hero-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--white);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
}

.hero-metrics {
    margin-top: 1.2rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 0.5rem;
}

.hero-metric {
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 3px;
    padding: 0.4rem 0.5rem;
    background: rgba(8, 25, 56, 0.35);
}

.hero-metric strong {
    display: block;
    font-size: 1.05rem;
}

.hero-metric span {
    font-size: 0.8rem;
    opacity: 0.9;
}

.main-content {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2rem 1.1rem 2.5rem;
}

.card {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 1.35rem;
    margin-bottom: 1.3rem;
}

.card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.card h2,
.card h3,
.card h4 {
    font-family: var(--font-heading);
    color: var(--navy-900);
}

.card h2 {
    margin-bottom: 0.6rem;
    font-size: clamp(1.2rem, 2.3vw, 1.65rem);
}

.card h3 {
    margin-top: 0.95rem;
    margin-bottom: 0.5rem;
    font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.notice {
    border-left: 4px solid;
    border-radius: 2px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
}

.notice strong {
    display: block;
    margin-bottom: 0.15rem;
}

.notice-info {
    background: #eaf2ff;
    border-color: var(--info);
    color: #123770;
}

.notice-warning {
    background: #fff6e9;
    border-color: var(--warning);
    color: #793300;
}

.notice-success {
    background: #ecfdf3;
    border-color: var(--success);
    color: #135527;
}

.form-group {
    margin-bottom: 0.85rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--slate-700);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #b6c1d1;
    border-radius: 2px;
    padding: 0.64rem 0.72rem;
    background: var(--white);
    font-family: var(--font-body);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--ashoka-blue);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.btn {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border: 1px solid #0a3d91;
    border-radius: 2px;
    background: #0a3d91;
    color: var(--white);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    background: #0a2b60;
    border-color: #0a2b60;
}

.btn-secondary {
    background: #475569;
    border-color: #475569;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.56rem 0.6rem;
    border-bottom: 1px solid var(--slate-200);
    vertical-align: top;
}

.data-table th {
    background: #eaf2ff;
    color: #102a52;
    font-weight: 700;
}

.status-chip {
    display: inline-block;
    padding: 0.18rem 0.56rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-ok {
    color: #0b5f1f;
    background: #dcfce7;
}

.status-review {
    color: #78350f;
    background: #fef3c7;
}

.diagram {
    background: #0d1b35;
    color: #dce9ff;
    border: 1px solid #1e3360;
    border-radius: 2px;
    padding: 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.79rem;
    overflow-x: auto;
    white-space: pre;
}

.cred-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.7rem;
}

.cred-item {
    border: 1px solid #cde0ff;
    background: #f7fbff;
    border-radius: 2px;
    padding: 0.8rem;
}

.gov-seal {
    width: 86px;
    height: 86px;
    margin: 0 auto 0.7rem;
    border-radius: 50%;
    border: 3px solid #d5b96a;
    background: radial-gradient(circle at 50% 40%, #f7e8bc 0%, #e6cd81 55%, #cfad58 100%);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.36);
    display: grid;
    place-items: center;
    color: #8b5e00;
    font-weight: 800;
    font-family: var(--font-heading);
}

.site-footer {
    margin-top: 1.8rem;
    color: #e6ecf9;
    background: linear-gradient(180deg, #172f5d 0%, #0d1f42 100%);
    border-top: 4px solid var(--saffron);
    padding: 1.5rem 1.2rem;
}

.footer-content {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1.05rem;
}

.footer-section h4 {
    margin-bottom: 0.45rem;
    color: #ffffff;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.2rem;
}

.footer-section a {
    color: #cfddff;
}

.footer-bottom {
    max-width: 1240px;
    margin: 1rem auto 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 0.8rem;
    font-size: 0.89rem;
    text-align: center;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--slate-500);
}

.text-small {
    font-size: 0.9rem;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 1.5rem;
}

.form-aux {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

@media (max-width: 920px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav ul {
        gap: 0.35rem;
    }
}

/* ---- Hamburger nav (shown only on mobile) ---- */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-family: var(--font-body);
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    width: 100%;
    text-align: left;
}
.nav-toggle:hover { color: #fff; }
.hamburger-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1px;
    flex-shrink: 0;
}
.nav-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

@media (max-width: 760px) {
    .nav-toggle {
        display: flex;
    }

    .main-nav ul {
        display: none;
        flex-direction: column;
        gap: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        padding: 0.2rem 0;
    }

    .main-nav ul.open {
        display: flex;
    }

    .main-nav li a {
        display: block;
        padding: 0.6rem 1.4rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        font-size: 0.92rem;
        border-radius: 0;
    }
}

@media (max-width: 680px) {
    .header-meta {
        font-size: 0.75rem;
        flex-direction: column;
        gap: 0.18rem;
    }

    /* Stack the header: logo + logos on top row, title below */
    .header-top {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0.55rem 0.8rem;
        align-items: center;
    }

    .header-ncis-logo {
        flex: 0 0 auto;
    }

    .header-ncis-logo img {
        height: 48px;
    }

    .header-logos {
        margin-left: auto;
        gap: 0.5rem;
    }

    /* Hide badge images; keep emblem + ministry logo */
    .header-logos img.small {
        display: none;
    }

    .header-logos img.emblem {
        height: 44px;
    }

    .header-logos img.ministry-logo {
        height: 38px;
    }

    /* Title wraps to its own row */
    .header-title {
        flex: 1 1 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 0.35rem;
    }

    .title-hindi {
        font-size: 0.82rem;
    }

    .title-english {
        font-size: 0.76rem;
    }

    .title-government {
        font-size: 0.72rem;
    }

    .main-content {
        padding: 1rem 0.7rem 1.5rem;
    }

    .hero {
        min-height: 260px;
    }

    .hero-image {
        min-height: 260px;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }

    /* Utility bar: scrollable on mobile */
    .top-utility-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        white-space: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .top-utility-bar::-webkit-scrollbar { display: none; }

    /* Tables: scrollable container */
    .tender-table,
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* What's new list: allow text to wrap */
    .whats-new-list a {
        white-space: normal;
    }

    /* Footer policy bar: scrollable */
    .footer-policy-bar {
        overflow-x: auto;
        white-space: nowrap;
        text-align: left;
        padding: 0.35rem 0.7rem;
        scrollbar-width: none;
    }
    .footer-policy-bar::-webkit-scrollbar { display: none; }
}

/*
Config path: /etc/ncis/webapp.conf
API endpoint: https://api-internal.ncis.gov.in/v2/
Legacy auth: Basic dGVzdHVzZXI6dGVzdHBhc3M= (deprecated)
*/

/* ---- Accessibility / GoI utility elements ---- */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #00008b;
    color: #fff;
    padding: 6px 14px;
    z-index: 9999;
    font-size: 0.82rem;
    text-decoration: underline;
}
.skip-link:focus { top: 0; }

.top-utility-bar {
    background: #dde2ef;
    border-bottom: 1px solid #b0b8d0;
    padding: 0.18rem 1.2rem;
    font-size: 0.74rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    color: #222;
    flex-wrap: wrap;
}
.top-utility-bar a {
    color: #00008b;
    text-decoration: underline;
}
.top-utility-bar a:hover { color: #c00; }
.top-utility-bar .separator { color: #888; }

.util-btn {
    background: none;
    border: none;
    color: #00008b;
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
    padding: 0 1px;
    font-family: inherit;
    line-height: inherit;
}
.util-btn:hover { color: #c00; }

/* Blinking "NEW" badge */
.blink {
    animation: blinker 1.1s step-start infinite;
    color: #c00;
    font-weight: 700;
    font-size: 0.68rem;
    vertical-align: super;
    margin-left: 3px;
}
@keyframes blinker { 50% { opacity: 0; } }

/* What's New section */
.whats-new-section {
    background: #fffff4;
    border: 1px solid #c8b500;
    margin-bottom: 1rem;
    border-radius: 0;
}
.whats-new-header {
    background: #003580;
    color: #fff;
    padding: 0.4rem 0.9rem;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.whats-new-list {
    list-style: disc;
    padding: 0.5rem 0.9rem 0.5rem 1.8rem;
    margin: 0;
}
.whats-new-list li {
    padding: 0.28rem 0;
    border-bottom: 1px dotted #ccc;
    font-size: 0.84rem;
    color: #111;
}
.whats-new-list li:last-child { border-bottom: none; }
.whats-new-list a { color: #00008b; text-decoration: underline; font-size: 0.84rem; }

/* Tender notices */
.tender-box {
    border: 1px solid #e0a060;
    background: #fff8f0;
    border-radius: 0;
    margin-bottom: 1rem;
}
.tender-box-header {
    background: #7b2200;
    color: #fff;
    padding: 0.38rem 0.9rem;
    font-weight: 700;
    font-size: 0.88rem;
    text-transform: uppercase;
}
.tender-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.tender-table th {
    background: #f2dcc8;
    border: 1px solid #cca080;
    padding: 0.3rem 0.5rem;
    text-align: left;
    font-weight: 700;
}
.tender-table td {
    border: 1px solid #ddc0a0;
    padding: 0.28rem 0.5rem;
    vertical-align: top;
}
.tender-table tr:nth-child(even) td { background: #fdf4ec; }

/* Important notice bar */
.notice-bar {
    background: #fff3cd;
    border-left: 5px solid #ffc107;
    border-top: 1px solid #ffc107;
    border-bottom: 1px solid #ffc107;
    padding: 0.5rem 0.9rem;
    font-size: 0.82rem;
    color: #5a4000;
    margin-bottom: 0.6rem;
}

/* Footer policy links bar */
.footer-policy-bar {
    background: #c8cdd8;
    border-top: 1px solid #9aa;
    padding: 0.35rem 1rem;
    text-align: center;
    font-size: 0.74rem;
    color: #111;
}
.footer-policy-bar a {
    color: #00008b;
    text-decoration: underline;
    margin: 0 0.38rem;
}
.footer-policy-bar a:hover { color: #c00; }
.footer-policy-bar .sep { color: #666; }

/* NIC attribution bar */
.nic-footer-bar {
    background: #edf0f7;
    border-top: 2px solid #00008b;
    padding: 0.42rem 1rem;
    text-align: center;
    font-size: 0.73rem;
    color: #222;
}
.nic-footer-bar a { color: #00008b; text-decoration: underline; }

/* Visitor counter */
.visitor-count-row {
    text-align: center;
    padding: 0.28rem;
    font-size: 0.76rem;
    color: #b8c8e8;
}
.visitor-counter {
    display: inline-block;
    background: #111827;
    color: #4ade80;
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    letter-spacing: 3px;
    padding: 1px 7px;
    border: 1px inset #444;
    border-radius: 1px;
}