@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Sleek Light Clinical */
    --bg-base: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    --bg-input-focus: #ffffff;
    
    --color-primary: #0d9488;       /* Clean Medical Teal */
    --color-primary-rgb: 13, 148, 136;
    --color-primary-hover: #0f766e;
    --color-secondary: #2563eb;     /* Professional Medical Blue */
    --color-secondary-rgb: 37, 99, 235;
    --color-accent: #db2777;        /* Gentle Rose Accent */
    
    /* Text Colors */
    --text-main: #0f172a;           /* Dark Slate */
    --text-muted: #64748b;          /* Cool Grey */
    --text-light: #475569;          /* Medium Slate */
    
    /* Borders & Shadows */
    --border-color: #e2e8f0;
    --border-color-hover: rgba(13, 148, 136, 0.3);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 6px -1px rgba(15,23,42,0.05), 0 2px 4px -1px rgba(15,23,42,0.02);
    --shadow-lg: 0 10px 25px -5px rgba(15,23,42,0.08), 0 8px 10px -6px rgba(15,23,42,0.03);
    --shadow-glow: 0 0 20px rgba(13, 148, 136, 0.08);
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 80px; /* Space for fixed header */
}

.container {
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 2rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.nav-container {
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    letter-spacing: -0.03em;
}

.logo span {
    color: var(--color-primary);
}

.logo-tag {
    font-size: 0.65rem;
    background: rgba(13, 148, 136, 0.08);
    color: var(--color-primary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(13, 148, 136, 0.15);
    margin-left: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

nav {
    display: flex;
    gap: 1.8rem;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    padding: 0.4rem 0;
    position: relative;
}

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

nav a:hover, nav a.active {
    color: var(--color-primary);
}

nav a:hover::after, nav a.active::after {
    width: 100%;
}

/* Premium Medical Callout CTA button */
.terminal-btn {
    background: var(--color-primary);
    color: #ffffff;
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.15);
    border: none;
    cursor: pointer;
}

.terminal-btn:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 6px 15px rgba(13, 148, 136, 0.25);
    transform: translateY(-1px);
}

/* Mobile Toggle Hamburger */
.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    z-index: 1100;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-main);
    margin: 4px 0;
    transition: var(--transition);
}

/* Bento Grid System */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    margin: 2rem 0 4rem;
}

.bento-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}

.bento-panel:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-2px);
}

.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.row-2 { grid-row: span 2; }
.row-3 { grid-row: span 3; }

/* Status Bar Panel */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.9rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    box-shadow: var(--shadow-sm);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 8px rgba(13, 148, 136, 0.4);
}

/* UI Typography */
h1, h2, h3, h4 {
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.15;
    margin-bottom: 1.2rem;
}

h1 span {
    color: var(--color-primary);
}

h2 {
    font-size: clamp(1.4rem, 3vw, 2.0rem);
    margin-bottom: 1.2rem;
}

h3 {
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
    margin-bottom: 1.2rem;
    color: var(--color-primary);
}

.panel-title span {
    font-size: 1.2rem;
}

.panel-icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.3rem;
    flex-shrink: 0;
}

.panel-text {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

/* Bento Grid Badge */
.bento-badge {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--bg-input);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: var(--text-muted);
}

/* Link Style */
.bento-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: auto; /* Push to bottom of bento card */
    transition: var(--transition);
}

.bento-link:hover {
    gap: 0.5rem;
    color: var(--color-primary-hover);
}

/* Inline Interactive Elements */

/* 1. Interactive BNO filter */
.bento-search-box {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    transition: var(--transition);
}

.bento-search-box:focus-within {
    background: var(--bg-card);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.bento-search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.85rem;
    width: 100%;
}

.bento-search-box input::placeholder {
    color: var(--text-muted);
}

.bento-bno-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.bno-item {
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    transition: var(--transition);
    align-items: center;
}

.bno-item:hover {
    background: rgba(13, 148, 136, 0.03);
    border-color: rgba(13, 148, 136, 0.2);
}

.bno-item span.code {
    color: var(--color-primary);
    font-weight: 700;
}

.bno-item span.name {
    color: var(--text-light);
    text-align: right;
}

/* 2. Interactive SMS Console - White iOS Phone Simulator */
.phone-simulator {
    background: #ffffff;
    border: 10px solid #e2e8f0;
    border-radius: 32px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 300px;
    margin-bottom: 1.2rem;
}

.phone-simulator-header {
    background: #f8fafc;
    border-bottom: 1px solid #cbd5e1;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
}

.phone-simulator-body {
    flex: 1;
    padding: 0.8rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: #f8fafc;
}

.phone-sms-msg {
    max-width: 80%;
    padding: 0.6rem 0.8rem;
    border-radius: 14px;
    font-size: 0.75rem;
    line-height: 1.3;
}

.phone-sms-msg.recv {
    background: #e2e8f0;
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 3px;
}

.phone-sms-msg.sent {
    background: #3b82f6; /* iOS blue */
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}

.phone-simulator-footer {
    display: flex;
    padding: 0.6rem;
    border-top: 1px solid #e2e8f0;
    gap: 0.4rem;
    background: #ffffff;
}

.phone-simulator-footer input {
    flex: 1;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    outline: none;
}

.phone-simulator-footer input:focus {
    border-color: var(--color-primary);
    background: #ffffff;
}

.phone-simulator-footer button {
    background: var(--color-primary);
    border: none;
    color: #ffffff;
    padding: 0.4rem 1rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.phone-simulator-footer button:hover {
    background: var(--color-primary-hover);
}

/* 3. Interactive Code Calculator */
.calc-console-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.calc-console-row input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.6rem;
    color: var(--text-main);
    font-size: 0.85rem;
    flex: 1;
    outline: none;
    transition: var(--transition);
}

.calc-console-row input:focus {
    background: var(--bg-card);
    border-color: var(--color-primary);
}

.calc-console-row button {
    background: var(--color-secondary);
    border: none;
    color: #ffffff;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.calc-console-row button:hover {
    opacity: 0.9;
}

.calc-console-result {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.8rem;
}

/* 4. FTAR Directory Explorer */
.file-tree {
    list-style: none;
    padding-left: 0.5rem;
}

.file-tree-node {
    margin: 0.5rem 0;
    font-size: 0.8rem;
}

.file-tree-dir {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.file-tree-dir::before {
    content: '▶';
    font-size: 0.55rem;
    color: var(--color-primary);
    display: inline-block;
    transition: transform 0.2s ease;
}

.file-tree-dir.expanded::before {
    transform: rotate(90deg);
}

.file-tree-sub {
    list-style: none;
    padding-left: 1.2rem;
    margin-top: 0.3rem;
    border-left: 1px dashed var(--border-color);
    display: none; /* Collapsed by default */
}

.file-tree-sub.open {
    display: block;
}

.file-tree-file {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.file-tree-file::before {
    content: '📄';
    font-size: 0.75rem;
}

.file-tree-file a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.file-tree-file a:hover {
    color: var(--color-primary);
}

/* Details summary list */
details {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.8rem;
    overflow: hidden;
    transition: var(--transition);
}

details[open] {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

summary {
    padding: 1rem 1.2rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    color: var(--text-main);
    font-size: 0.9rem;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '[+]';
    color: var(--color-primary);
    font-size: 0.85rem;
}

details[open] summary::after {
    content: '[-]';
    color: var(--color-accent);
}

details .details-content {
    padding: 0 1.2rem 1.2rem;
    color: var(--text-light);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.8rem;
}

/* Callout */
.callout-block {
    background: rgba(13, 148, 136, 0.03);
    border-left: 4px solid var(--color-primary);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 2rem 0;
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-light);
}

.callout-block a {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 700;
}

.callout-block a:hover {
    color: var(--color-primary-hover);
}

/* Data Tables */
.table-container {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
    background: var(--bg-card);
}

th, td {
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-base);
    color: var(--text-main);
    font-weight: 700;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg-base);
}

/* Footer */
footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 5rem 2rem 2rem;
    position: relative;
    z-index: 10;
}

.footer-grid {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
}

.footer-col h4 {
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.6rem;
}

.footer-col ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.85rem;
    font-weight: 500;
}

.footer-col ul li a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    max-width: 1300px;
    margin: 0 auto;
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 1rem;
    font-weight: 550;
}

.footer-bottom a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: var(--color-primary);
}

/* Responsive Rules */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .span-12, .span-8, .span-6, .span-4, .span-3 {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    .container {
        padding: 1.5rem 1.2rem;
    }
    
    header {
        height: 70px;
    }
    
    .nav-container {
        padding: 0 1.2rem;
    }
    
    .hamburger {
        display: block;
    }
    
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 260px;
        height: 100vh;
        background: #ffffff;
        border-left: 1px solid var(--border-color);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        transition: var(--transition);
        z-index: 1050;
        padding: 2rem;
        box-shadow: var(--shadow-lg);
    }
    
    nav.open {
        right: 0;
    }
    
    .hamburger.open span:nth-child(1) {
        transform: rotate(45deg) translate(4px, 4px);
    }
    
    .hamburger.open span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.open span:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px);
    }
    
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .span-12, .span-8, .span-6, .span-4, .span-3 {
        grid-column: span 1;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}
