/* 
 * Custom Styles for HTML & CSS Classroom M.2 
 * Tech-themed, modern, clean & uncluttered
 */

@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600&family=Fira+Code:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --tech-dark: #090d16;
    --tech-card-dark: #0f172a;
    --tech-border: #1e293b;
    --tech-cyan: #38bdf8;
    --tech-cyan-glow: rgba(56, 189, 248, 0.2);
    --secondary-color: #0d9488;
    --accent-color: #f59e0b;
    --dark-color: #0f172a;
    --text-muted: #64748b;
    --bg-page: #f8fafc;
    --card-border: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --card-hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Prompt', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-page);
    color: #334155;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark-color);
}

code, pre, .font-mono {
    font-family: 'Fira Code', Consolas, Monaco, monospace;
}

/* ========================================================
   TECH NAVBAR (Clean, Sleek, Uncluttered Developer Console)
   ======================================================== */
.navbar-tech {
    background: #090d16 !important;
    border-bottom: 1px solid rgba(56, 189, 248, 0.15);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

/* Brand */
.tech-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 700;
    color: #ffffff !important;
}

.tech-brand-logo {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: #090d16;
    font-family: 'Fira Code', monospace;
    font-weight: 800;
    font-size: 1rem;
    padding: 6px 10px;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
    letter-spacing: -0.5px;
    line-height: 1;
}

.tech-brand-name {
    font-family: 'Fira Code', 'Prompt', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.2px;
    line-height: 1.1;
}

.tech-brand-name .text-cyan {
    color: var(--tech-cyan);
}

.tech-brand-code {
    font-size: 0.72rem;
    color: #94a3b8;
    font-family: 'Fira Code', monospace;
    font-weight: 400;
}

/* Streamlined Nav Links */
.tech-nav-link {
    color: #94a3b8 !important;
    font-size: 0.88rem !important;
    font-weight: 500;
    padding: 0.45rem 0.85rem !important;
    border-radius: 8px;
    margin: 0 2px;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.tech-nav-link i {
    font-size: 0.95rem;
    opacity: 0.85;
}

.tech-nav-link:hover {
    color: #38bdf8 !important;
    background-color: rgba(56, 189, 248, 0.08);
}

.tech-nav-link.active {
    color: #ffffff !important;
    background-color: rgba(56, 189, 248, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.18);
    font-weight: 600;
}

.tech-nav-link.active i {
    color: #38bdf8;
    opacity: 1;
}

/* Tech User Pill */
.tech-user-pill {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 30px;
    padding: 4px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.tech-user-pill:hover, .tech-user-pill:focus {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.tech-user-name {
    color: #f1f5f9;
    font-size: 0.84rem;
    font-weight: 500;
}

.tech-chip-room {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    font-family: 'Fira Code', monospace;
}

.tech-chip-teacher {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.3);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

/* ========================================================
   CARDS & COMMON COMPONENTS
   ======================================================== */
.card-custom {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-custom:hover {
    box-shadow: var(--card-hover-shadow);
}

.card-header-clean {
    background: transparent;
    border-bottom: 1px solid var(--card-border);
    padding: 1.15rem 1.4rem;
}

/* Hero Banners */
.hero-banner {
    background: linear-gradient(135deg, #090d16 0%, #0f172a 50%, #1e3a8a 100%);
    color: #ffffff;
    border-radius: 18px;
    padding: 2rem 2.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.hero-banner::after {
    content: '</>';
    position: absolute;
    right: 20px;
    bottom: -15px;
    font-family: 'Fira Code', monospace;
    font-size: 9rem;
    font-weight: 700;
    opacity: 0.05;
    pointer-events: none;
}

/* Tech IDE Preview Window (Index Page) */
.tech-ide-window {
    background: #090d16;
    border: 1px solid #1e293b;
    border-radius: 14px;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.tech-ide-titlebar {
    background: #0f172a;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #1e293b;
}

.tech-ide-dots {
    display: flex;
    gap: 6px;
}

.tech-ide-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.tech-ide-tab {
    background: #090d16;
    color: #38bdf8;
    padding: 4px 12px;
    border-radius: 6px 6px 0 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    border-top: 2px solid #38bdf8;
}

.tech-ide-body {
    padding: 18px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #e2e8f0;
}

/* Stats Cards */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 1.4rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--card-shadow);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Badges */
.badge-room {
    background-color: #f1f5f9;
    color: #334155;
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-weight: 500;
    border: 1px solid #cbd5e1;
}

/* Interactive Playground */
.playground-editor-box {
    border: 1px solid #334155;
    border-radius: 10px;
    overflow: hidden;
    background: #1e293b;
}

.playground-header {
    background: #0f172a;
    color: #94a3b8;
    padding: 8px 16px;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playground-textarea {
    width: 100%;
    height: 280px;
    background: #1e293b;
    color: #f8fafc;
    border: none;
    font-family: 'Fira Code', Consolas, monospace;
    font-size: 0.95rem;
    padding: 15px;
    resize: vertical;
    outline: none;
    line-height: 1.5;
}

.playground-preview-frame {
    width: 100%;
    height: 320px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: white;
}

/* Question Options for Quiz */
.quiz-option-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    margin-bottom: 10px;
}

.quiz-option-label:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.quiz-option-label input[type="radio"]:checked + .option-text-wrapper {
    color: var(--primary-color);
    font-weight: 600;
}

.quiz-option-label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: var(--primary-soft);
}

/* Quiz Timer */
.timer-badge {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 30px;
    background: #fee2e2;
    color: #dc2626;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================================
   CYAN TECH ACCENTS & GAMIFICATION
   ======================================================== */
.text-cyan {
    color: #06b6d4 !important;
}
.bg-cyan {
    background-color: #06b6d4 !important;
    color: #ffffff !important;
}
.ring-2.ring-cyan {
    box-shadow: 0 0 0 2px #06b6d4 !important;
}
.ring-4.ring-cyan {
    box-shadow: 0 0 0 4px #06b6d4 !important;
}

/* Linter Widget Styling */
.linter-widget {
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}
.linter-widget code {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}
.linter-widget .alert {
    border-radius: 8px;
}
