/* ========================================
   Teach Telecom - Global Styles
   Professional Telecom OSS Learning Platform
   Version: 1.3 (Production Final)
   ======================================== */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --secondary: #06b6d4;
    --accent-amber: #f59e0b;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --border-radius-card: 1.5rem;
    --border-radius-sm: 0.75rem;

    --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 15px -3px rgba(0,0,0,0.08);

    --transition: all 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #f0f4fa 0%, #e2e8f0 100%);
    color: var(--gray-700);
    line-height: 1.6;
}

/* ---------- Auth Loading State (Essential) ---------- */
.auth-loading {
    visibility: hidden;
}

/* ---------- Selection Styling ---------- */
::selection {
    background: #bfdbfe;
    color: #111827;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
}

h3 {
    font-size: 1.25rem;
    margin: 1rem 0 0.5rem;
}

p {
    margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.75rem; }
}

/* ---------- Links ---------- */
a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ---------- Cards ---------- */
.topic-card,
.glass-card {
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(2px);
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-sm);
}

.glass-card {
    border: 1px solid rgba(255,255,255,0.4);
}

.topic-card {
    background: white;
    padding: 2rem;
    border: 1px solid var(--gray-200);
}

.topic-card:hover,
.glass-card:hover {
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .topic-card {
        padding: 1.25rem;
    }
}

/* ---------- Badges ---------- */
.badge-beginner,
.badge-time,
.badge-example,
.badge-bss {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-beginner {
    background: #dbeafe;
    color: #1e40af;
}

.badge-time {
    background: #fed7aa;
    color: #9a3412;
}

.badge-example {
    background: #d1fae5;
    color: #065f46;
}

.badge-bss {
    background: #e0e7ff;
    color: #3730a3;
}

/* ---------- Information Boxes ---------- */
.example-box,
.bss-connect,
.operations-impact,
.telecom-note {
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    margin: 1rem 0;
}

.example-box {
    background: #f0fdf4;
    border-left: 4px solid var(--accent-green);
}

.bss-connect {
    background: #eff6ff;
    border-left: 4px solid var(--primary);
}

.operations-impact {
    background: #fffbeb;
    border-left: 4px solid var(--accent-amber);
}

.telecom-note {
    background: #eff6ff;
    border-left: 4px solid var(--primary);
}

/* ---------- Code Blocks ---------- */
.code-block {
    background: var(--gray-900);
    color: #f9fafb;
    border-radius: 1rem;
    padding: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    margin: 1rem 0;
}

.code-block pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.code-inline {
    background: var(--gray-200);
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.85em;
    color: #d97706;
}

/* ---------- Architecture Diagrams ---------- */
.diagram-box {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 1rem;
    padding: 1rem;
    transition: var(--transition);
    margin: 1rem 0;
}

.diagram-box:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.flow-arrow {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: bold;
}

/* ---------- Responsive Tables ---------- */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
    margin: 1rem 0;
    -webkit-overflow-scrolling: touch;
}

/* ---------- Vendor Tables ---------- */
.vendor-table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.vendor-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    text-align: left;
    padding: 0.75rem 0.5rem;
    background: var(--gray-100);
    font-weight: 600;
}

.vendor-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: top;
}

/* Zebra Striping */
.vendor-table tbody tr:nth-child(even) {
    background: rgba(243, 244, 246, 0.45);
}

.vendor-table tbody tr:hover {
    background: rgba(219, 234, 254, 0.25);
}

/* ---------- Interview Questions ---------- */
.interview-q {
    background: #f8fafc;
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    transition: var(--transition);
    margin: 0.5rem 0;
}

.interview-q:hover {
    background: #f1f5f9;
}

/* ---------- Term Badges ---------- */
.term-badge {
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 9999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
    margin: 0.2rem;
}

/* ---------- Learn More Links ---------- */
.learn-more-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary);
    font-weight: 600;
    transition: var(--transition);
    margin-top: 0.75rem;
}

.learn-more-link:hover {
    color: var(--primary-dark);
    transform: translateX(4px);
}

/* ---------- Knowledge Path ---------- */
.knowledge-path {
    background: linear-gradient(135deg, #eff6ff, #ecfdf5);
    padding: 1.25rem;
    border-radius: 1rem;
    margin-top: 1.5rem;
}

/* ---------- Navigation ---------- */
.nav-sticky {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ---------- Progress Bar ---------- */
.progress-container {
    width: 100%;
    background: var(--gray-200);
    border-radius: 9999px;
    height: 0.5rem;
    margin-bottom: 1rem;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    height: 0.5rem;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* ---------- Buttons ---------- */
.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ---------- Accessibility ---------- */
:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.1rem; }
    .topic-card { padding: 1.25rem; }
    .badge-beginner,
    .badge-time,
    .badge-example,
    .badge-bss {
        font-size: 0.65rem;
    }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* ---------- Print Styles ---------- */
@media print {
    body { background: white; }
    .nav-sticky,
    .no-print,
    .btn-primary,
    select,
    .mobile-nav-select {
        display: none !important;
    }
    .topic-card {
        box-shadow: none;
        padding: 0;
        border: none;
    }
    a {
        text-decoration: none;
        color: black;
    }
    .code-block {
        background: #f3f4f6;
        color: black;
        border: 1px solid var(--gray-200);
    }
    .table-wrapper {
        overflow: visible;
    }
    .vendor-table {
        font-size: 0.7rem;
    }
}

/* ---------- Watermark ---------- */
#teach-telecom-watermark {
    position: fixed;
    bottom: 6px;
    right: 6px;
    font-size: 8px;
    color: #cbd5e1;
    background: rgba(255,255,255,0.5);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.35;
}