:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(17, 24, 39, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    --primary-glow: rgba(59, 130, 246, 0.5);
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'Space Grotesk', 'Courier New', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-heading);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background Glowing Accents */
.glow-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, rgba(11,15,25,0) 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
    opacity: 0.6;
}

/* Header styling */
.app-header {
    text-align: center;
    padding: 2rem 1.5rem 1rem;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.shield-icon {
    font-size: 2.25rem;
    filter: drop-shadow(0 0 10px var(--primary));
}

.app-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.gradient-text {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 300;
}

/* Lab Tabs Controls Layout */
.tabs-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    z-index: 10;
}

.tab-btn {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0.75rem 1.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.tab-btn.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}

/* Tab contents rendering toggle */
.tab-content {
    display: none;
    width: 100%;
}

.tab-content.active-content {
    display: block;
}

/* App Grid Layout */
.app-container {
    max-width: 1700px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1.5rem;
    flex: 1;
    display: flex;
}

.split-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
    width: 100%;
    min-height: 600px;
}

.split-layout-terminal {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 1.5rem;
    width: 100%;
    min-height: 600px;
}

/* General Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.75rem;
}

.card-inner {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
}

.card-inner h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: #e5e7eb;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Buttons styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-heading);
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-success { background: rgba(16, 185, 129, 0.2); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.4); }
.btn-success:hover { background: rgba(16, 185, 129, 0.3); }

.btn-warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.4); }
.btn-warning:hover { background: rgba(245, 158, 11, 0.3); }

.btn-danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.4); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.3); }

/* Message Feed Panel Tab 1 */
.message-feed {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
}

.msg-feed-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.msg-feed-card:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.msg-feed-card.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
}

.msg-feed-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.msg-feed-card.completed h4::after {
    content: "✓";
    color: var(--success);
    font-weight: 800;
}

.msg-feed-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.msg-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-email { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-sms { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-voice { background: rgba(245, 158, 11, 0.15); color: #fbd38d; border: 1px solid rgba(245, 158, 11, 0.3); }

/* Inspection Viewer Tab 1 */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    color: var(--text-muted);
    font-style: italic;
}

.device-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    overflow-y: auto;
    max-height: 480px;
}

/* Smartphone Mockup */
.phone-mockup {
    width: 290px;
    height: 440px;
    background: #000;
    border: 8px solid #374151;
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.phone-header {
    background: #1f2937;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-muted);
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.phone-messages {
    flex-grow: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
}

.bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.825rem;
    line-height: 1.4;
    word-break: break-word;
}

.bubble.incoming {
    background: #2d3748;
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.bubble.outgoing {
    background: #3182ce;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Email Mockup Client */
.email-mockup {
    width: 100%;
    background: #111827;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.email-header-fields {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.email-field {
    display: flex;
    gap: 0.5rem;
}

.field-label {
    color: var(--text-muted);
    font-weight: 600;
    min-width: 60px;
}

.email-body {
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    background: #0f172a;
    min-height: 200px;
}

/* Interactive link hovering helper style */
.mock-link {
    color: #60a5fa;
    text-decoration: underline;
    cursor: pointer;
    position: relative;
}

.mock-link:hover::after {
    content: "URL Target: " attr(data-target);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    border: 1px solid #475569;
    color: #f3f4f6;
    font-family: var(--font-mono);
    padding: 0.35rem 0.7rem;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* Voice Call transcription UI */
.voice-mockup {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--text-primary);
}

.caller-id-hud {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.transcript-box {
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.5;
    height: 180px;
    overflow-y: auto;
}

/* Objective Indicators */
.objective-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.indicator-bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

.indicator-bullet.met {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.indicator-bullet.failed {
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}

/* TAB 2: Command Line Auditor Styles */
.scenario-target {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 0.75rem;
}

.cmd-ref-list {
    list-style: none;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cmd-ref-list code {
    background: rgba(0,0,0,0.4);
    color: #a78bfa;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
}

/* Terminal shell screen styling */
.terminal-panel {
    background: #020617;
    border: 1px solid #1e293b;
    font-family: var(--font-mono);
    padding: 0;
    min-height: 520px;
    overflow: hidden;
}

.terminal-header {
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.term-title {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.term-buttons {
    display: flex;
    gap: 0.4rem;
}

.term-buttons .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.term-buttons .dot.red { background-color: var(--danger); }
.term-buttons .dot.yellow { background-color: var(--warning); }
.term-buttons .dot.green { background-color: var(--success); }

.terminal-screen {
    padding: 1.25rem;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #e2e8f0;
    max-height: 400px;
}

.terminal-line {
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-line.user-input {
    color: #60a5fa;
    font-weight: 600;
}

.terminal-line.system { color: #94a3b8; }
.terminal-line.success { color: var(--success); }
.terminal-line.error { color: var(--danger); }
.terminal-line.warning { color: var(--warning); }

.terminal-input-bar {
    background: #090d16;
    border-top: 1px solid #1e293b;
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
}

.prompt {
    color: #3b82f6;
    margin-right: 0.5rem;
    font-weight: bold;
    user-select: none;
}

#terminal-input {
    background: transparent;
    border: none;
    outline: none;
    color: #f8fafc;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    flex-grow: 1;
}

/* Modal and Print configs */
.rule-builder-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 7, 12, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.cert-modal-content {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    width: 650px;
    max-width: 90%;
    animation: zoomIn 0.3s ease;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* App Footer styling */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
    background: rgba(11, 15, 25, 0.8);
    margin-top: auto;
}

/* Animations */
@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Print layout styles */
@media print {
    body * {
        visibility: hidden;
    }
    #cert-modal, #cert-modal * {
        visibility: visible;
    }
    #cert-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        background: white !important;
    }
    .cert-modal-content {
        border: none !important;
        background: white !important;
        box-shadow: none !important;
        margin: 0;
        padding: 0;
        width: 100%;
        max-width: 100%;
    }
    #print-area {
        background: white !important;
        color: black !important;
        border: 4px double black !important;
    }
    #student-name, #class-name, #instructor-name {
        color: black !important;
        border-bottom: 2px solid black !important;
    }
    .modal-buttons {
        display: none !important;
    }
}
