@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* =============================================
   RESET & ROOT VARIABLES
   ============================================= */

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

:root {
    --bg-primary:      #080c14;
    --bg-secondary:    #0d1321;
    --bg-card:         #111827;
    --bg-card-hover:   #1a2235;
    --bg-surface:      #162032;

    --accent-cyan:     #00d4ff;
    --accent-blue:     #3b82f6;
    --accent-glow:     rgba(0, 212, 255, 0.15);

    --text-primary:    #e2e8f0;
    --text-secondary:  #94a3b8;
    --text-muted:      #4a5568;
    --text-heading:    #f0f6ff;

    --border-subtle:   rgba(255, 255, 255, 0.06);
    --border-accent:   rgba(0, 212, 255, 0.3);

    --shadow-card:     0 4px 24px rgba(0, 0, 0, 0.6);
    --shadow-glow:     0 0 30px rgba(0, 212, 255, 0.1);

    /* Heights used for offset calculations */
    --header-height:   180px;
    --navbar-height:   52px;
    --mobile-header:   70px;
    --mobile-navbar:   44px;

    --font-display:    'Rajdhani', sans-serif;
    --font-body:       'Inter', sans-serif;
    --font-mono:       'JetBrains Mono', monospace;

    /* kept for billing pages */
    --btnbackcolor:    var(--accent-blue);
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(59,130,246,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(124,58,237,0.04)  0%, transparent 50%);
}

/* =============================================
   HEADER  —  always position:fixed
   ============================================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    background: linear-gradient(135deg, #080c14 0%, #0d1321 60%, #0a1628 100%);
    z-index: 1000;
    border-bottom: 1px solid var(--border-accent);
    box-shadow: 0 4px 32px rgba(0,0,0,0.5), var(--shadow-glow);
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,212,255,0.012) 2px,
        rgba(0,212,255,0.012) 4px
    );
    pointer-events: none;
    z-index: 0;
}

.header-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    filter: saturate(0.2) brightness(0.5);
    z-index: 0;
}

.header-left,
.header-right {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
}

.header-right {
    justify-content: flex-end;
    flex-grow: 1;
}

.company-name {
    font-family: var(--font-display);
    font-size: 2.2em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.circle-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 2;
    border: 2px solid var(--accent-cyan);
    box-shadow: 0 0 0 4px rgba(0,212,255,0.1), 0 0 24px rgba(0,212,255,0.25);
    background-color: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sign-in-button {
    position: relative;
    z-index: 2;
    padding: 10px 28px;
    font-family: var(--font-display);
    font-size: 0.95em;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--accent-blue);
    border: 1px solid var(--accent-cyan);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 130px;
}

.sign-in-button:hover {
    background: var(--accent-cyan);
    color: var(--bg-primary);
    box-shadow: 0 0 20px rgba(0,212,255,0.35);
}

/* =============================================
   NAVBAR  —  always position:fixed
   Desktop: centred pill below header
   Mobile:  full-width bar, burger toggles ul
   ============================================= */

.navbar {
    position: fixed;
    top: var(--header-height);      /* sits directly below header */
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 900px;
    height: var(--navbar-height);
    background: var(--bg-secondary);
    z-index: 999;
    border-radius: 0 0 12px 12px;
    border: 1px solid var(--border-subtle);
    border-top: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Desktop nav list */
.navbar ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0 12px;
    width: 100%;
}

.nav-link {
    display: block;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link::after { display: none; }

.nav-link:hover {
    color: var(--accent-cyan);
    background: rgba(0,212,255,0.08);
}

.nav-link.active {
    color: var(--bg-primary);
    background: var(--accent-cyan);
    box-shadow: 0 0 16px rgba(0,212,255,0.3);
}

/* ── Burger ──
   Hidden on desktop (display:none).
   Media query switches it to display:flex  */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    z-index: 1100;
}

.burger .bar {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--accent-cyan);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.burger.open .bar:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger.open .bar:nth-child(2) { opacity: 0; }
.burger.open .bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* =============================================
   MAIN CONTENT
   padding-top clears fixed header + navbar
   ============================================= */

.main-content {
    max-width: 900px;
    margin: 0 auto;
    padding-top: calc(var(--header-height) + var(--navbar-height) + 40px);
    padding-bottom: 120px;
    padding-left: 20px;
    padding-right: 20px;
}

/* =============================================
   SECTIONS — BASE
   ============================================= */

.section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    margin: 28px 0;
    padding: 32px;
    box-shadow: var(--shadow-card);
    transition: border-color 0.3s ease;
}

.section:hover {
    border-color: rgba(0,212,255,0.15);
}

section.content2 { visibility: hidden; }

/* =============================================
   BIO SECTION
   ============================================= */

.section.bio {
    border-left: 3px solid var(--accent-cyan);
    padding: 36px 40px;
    position: relative;
    overflow: hidden;
}

.section.bio::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 240px; height: 240px;
    background: radial-gradient(circle at top right, rgba(0,212,255,0.05), transparent 70%);
    pointer-events: none;
}

.section.bio h2 {
    font-family: var(--font-display);
    font-size: 1.55em;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--accent-cyan);
    text-align: center;
    margin-bottom: 28px;
    text-transform: uppercase;
}

.bio-content { max-width: 100%; }

.section.bio p {
    margin-bottom: 18px;
    color: var(--text-primary);
    font-size: 0.95em;
    text-align: justify;
    line-height: 1.85;
}

.section.bio p:last-child { margin-bottom: 0; }

.section.bio strong {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Stop bio p rules leaking into typewriter */
.section.bio .typewriter-window {
    text-align: left;
}

.section.bio .typewriter-window p {
    text-align: left !important;
    margin-bottom: 0 !important;
    font-size: 1em;
    color: inherit;
}

/* =============================================
   TYPEWRITER WINDOW
   ============================================= */

.typewriter-window {
    background: #05090f;
    border: 1px solid rgba(0,212,255,0.25);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0,212,255,0.06), inset 0 0 60px rgba(0,0,0,0.4);
    margin-top: 20px;
}

.typewriter-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0d1321;
    border-bottom: 1px solid rgba(0,212,255,0.12);
    padding: 10px 16px;
}

.tb-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.tb-dot.red   { background: #ff5f57; }
.tb-dot.amber { background: #febc2e; }
.tb-dot.green { background: #28c840; }

.tb-label {
    font-family: var(--font-mono);
    font-size: 0.78em;
    color: var(--text-muted);
    margin-left: 8px;
    letter-spacing: 0.05em;
}

.typewriter-body {
    padding: 28px 32px;
    min-height: 180px;
    font-family: var(--font-mono);
    font-size: 0.92em;
    line-height: 1.85;
    color: #a8d8a8;
    position: relative;
    text-align: left !important;
}

.tw-output-wrap {
    display: block;
    margin: 0; padding: 0;
    text-indent: 0 !important;
    text-align: left !important;
}

.tw-output {
    display: inline;
    white-space: pre-wrap;
}

.cursor {
    display: inline;
    color: var(--accent-cyan);
    animation: blink 0.75s step-end infinite;
    font-size: 0.85em;
    vertical-align: baseline;
    margin-left: 1px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.typewriter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0d1321;
    border-top: 1px solid rgba(0,212,255,0.12);
    padding: 8px 16px;
}

.tw-counter {
    font-family: var(--font-mono);
    font-size: 0.75em;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.tw-skip {
    font-family: var(--font-mono);
    font-size: 0.75em;
    color: var(--accent-cyan);
    background: transparent;
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: 4px;
    padding: 4px 14px;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: all 0.2s ease;
}

.tw-skip:hover { background: rgba(0,212,255,0.1); }

/* =============================================
   SHOWCASE SECTION
   ============================================= */

.section.showcase {
    background: var(--bg-secondary);
    border-top: 2px solid var(--accent-blue);
    padding: 36px;
}

.section.showcase h2 {
    font-family: var(--font-display);
    font-size: 1.25em;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-heading);
    text-align: center;
    margin-bottom: 6px;
}

.section.showcase > p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 4px;
}

.grid-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 28px;
}

.grid-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 16px;
    transition: all 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 20px rgba(0,212,255,0.08);
    background: var(--bg-card-hover);
    border-color: rgba(0,212,255,0.2);
}

.grid-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 12px;
    filter: brightness(0.88) saturate(0.85);
    transition: filter 0.3s ease;
}

.grid-item:hover img { filter: brightness(1) saturate(1); }

.grid-item p {
    font-size: 0.88em;
    color: var(--text-secondary);
    line-height: 1.6;
}

.notes {
    margin-top: 20px;
    padding: 16px 20px;
    background: rgba(0,212,255,0.03);
    border: 1px solid rgba(0,212,255,0.1);
    border-radius: 8px;
}

.notes p {
    font-size: 0.88em;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1.6;
}

/* =============================================
   FOOTER
   ============================================= */

.footer {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    padding: 10px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-accent);
    text-align: center;
    z-index: 1000;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}

.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
    opacity: 1;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
}

.social-icons a:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0,212,255,0.3);
    transform: translateY(-2px);
}

.social-icons img {
    width: 18px; height: 18px;
    /* filter: brightness(0) invert(1); */
    opacity: 1;
    transition: opacity 0.2s ease;
}

.social-icons a:hover img { opacity: 1; }

.footer-note {
    font-family: var(--font-mono);
    font-size: 0.7em;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

/* =============================================
   BILLING / ADMIN
   ============================================= */

.controls {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
    margin-top: 20px;
    height: 60px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0 12px;
}

.refresh-indicator {
    display: flex;
    align-items: center;
    background: var(--accent-blue);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.8em;
    width: 160px;
}

.btn-refresh {
    height: 38px;
    background: var(--accent-blue);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.85em;
    width: 120px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin: 0 5px;
}
.btn-refresh:hover { background: #2563eb; }

.logout-button {
    height: 38px;
    width: 160px;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: 6px;
    color: #f87171;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
}
.logout-button:hover { background: rgba(239,68,68,0.22); }

table { width: 100%; border-collapse: collapse; margin-top: 20px; }

th, td {
    border: 1px solid var(--border-subtle);
    padding: 10px 12px;
    text-align: left;
    font-size: 0.9em;
}

th {
    background: var(--accent-blue);
    color: white;
    font-family: var(--font-display);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.8em;
}

td { color: var(--text-primary); background: var(--bg-card); }
tr:nth-child(even) td { background: var(--bg-secondary); }
tr:hover td           { background: var(--bg-card-hover); }

.office-section {
    margin-bottom: 32px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 20px;
    background: var(--bg-card);
}

.office-section .eml-button {
    height: 38px; width: 160px;
    background: var(--accent-blue);
    border: none; border-radius: 6px;
    color: white; font-size: 0.82em; cursor: pointer;
}

.office-header {
    background: var(--accent-blue);
    color: white;
    padding: 14px 16px;
    margin: -20px -20px 20px -20px;
    border-radius: 8px 8px 0 0;
    font-family: var(--font-display);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.table-group { display: flex; gap: 20px; flex-wrap: wrap; }
.table-container { flex: 1; min-width: 280px; }

.table-container h4 {
    background: var(--bg-surface);
    color: var(--text-secondary);
    padding: 10px;
    margin: 0 0 10px 0;
    border-radius: 4px;
    border-left: 3px solid var(--accent-blue);
    font-size: 0.88em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table-container table { margin-top: 0; }

.Search-Form {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    padding: 0 16px;
    margin-top: 16px;
}

.office-section form { margin-top: 15px; display: block; width: 100%; }

/* =============================================
   MEDIA QUERY — MOBILE  (max 930px)

   KEY RULE: navbar stays position:fixed but
   moves to full-width below the smaller header.
   Burger becomes visible. ul collapses to 0.
   ============================================= */

@media (max-width: 930px) {

    /* ── Header shrinks but stays fixed ── */
    .header {
        height: var(--mobile-header);   /* 70px */
        padding: 0 16px;
    }

    .company-name  { font-size: 1.2em; }
    .circle-image  { width: 50px; height: 50px; }
    .sign-in-button {
        font-size: 0.78em;
        padding: 7px 12px;
        min-width: auto;
    }

    /* ── Navbar: still fixed, full-width, below smaller header ── */
    .navbar {
        position: fixed;
        top: var(--mobile-header);      /* 70px — matches smaller header */
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        height: var(--mobile-navbar);   /* 44px — just enough for burger */
        border-radius: 0;
        border-left: none;
        border-right: none;
        justify-content: flex-end;      /* burger sits on the right */
        overflow: visible;              /* allow dropdown to escape */
        background: var(--bg-secondary);
        z-index: 999;
    }

    /* ── Burger: show it ── */
    .burger {
        display: flex;                  /* override desktop display:none */
        position: relative;
        margin-right: 12px;
    }

    /* ── Nav list: hidden by default, drops down on .show ── */
    .navbar ul {
        display: flex;                  /* keep flex so show transition works */
        flex-direction: column;
        position: fixed;
        top: calc(var(--mobile-header) + var(--mobile-navbar)); /* 70+44=114px */
        left: 0;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-accent);
        box-shadow: 0 8px 20px rgba(0,0,0,0.5);
        padding: 0;
        gap: 0;
        transition: max-height 0.35s ease, padding 0.35s ease;
        z-index: 998;
    }

    .navbar ul.show {
        max-height: 400px;
        padding: 6px 0;
    }

    .navbar ul li { width: 100%; }

    .nav-link {
        display: block;
        padding: 14px 24px;
        font-size: 1em;
        color: var(--text-secondary);
        border-radius: 0;
        border-bottom: 1px solid var(--border-subtle);
        text-align: left;
    }

    .nav-link:hover,
    .nav-link.active {
        background: rgba(0,212,255,0.1);
        color: var(--accent-cyan);
        box-shadow: none;
    }

    /* ── Main content: clear fixed header + fixed navbar ── */
    .main-content {
        padding-top: calc(var(--mobile-header) + var(--mobile-navbar) + 20px);
        padding-left: 12px;
        padding-right: 12px;
        padding-bottom: 120px;
    }

    /* ── Sections ── */
    .section       { padding: 20px 18px; margin: 14px 0; }
    .section.bio   { padding: 22px 18px; }

    .section.bio h2 { font-size: 1.15em; }

    .section.bio p {
        font-size: 0.88em;
        text-align: left;
    }

    .section.showcase  { padding: 22px 16px; }
    .section.showcase h2 { font-size: 1.05em; }

    .grid-gallery {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .grid-item img { height: 200px; }

    /* ── Typewriter ── */
    .typewriter-body {
        padding: 20px 18px;
        font-size: 0.82em;
    }

    /* ── Footer ── */
    .footer { padding: 7px 12px; }

    .social-icons a { width: 28px; height: 28px; }
    .social-icons img { width: 14px; height: 14px; }
    .footer-note { font-size: 0.65em; }

    /* ── Billing ── */
    .controls {
        margin-top: 30px;
        height: auto;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }

    .refresh-indicator { font-size: 0.72em; width: 110px; height: 34px; }
    .btn-refresh { font-size: 0.75em; width: 100px; height: 34px; }

    .Search-Form {
        margin-top: 30px;
        flex-wrap: wrap;
        height: auto;
        gap: 10px;
        padding: 10px;
    }
}

/* 2-col grid for mid tablets */
@media (min-width: 931px) and (max-width: 1100px) {
    .grid-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}
