/* =============================================
   Smart Home Guide — TeoTek
   style.css
   ============================================= */

:root {
    --bg:            #0a0a0f;
    --bg-card:       rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --border:        rgba(255, 255, 255, 0.08);
    --border-hover:  rgba(230, 51, 18, 0.4);
    --text:          #e2e8f0;
    --text-muted:    rgba(226, 232, 240, 0.6);
    --accent:        #e63312;
    --accent-glow:   rgba(230, 51, 18, 0.25);
    --accent-dim:    rgba(230, 51, 18, 0.12);
    --blue:          #3b82f6;
    --green:         #10b981;
    --orange:        #f59e0b;
    --red:           #ef4444;
    --sidebar-w:     260px;
    --topnav-h:      52px;
    --font:          'Inter', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }


/* ── Top Navigation ──────────────────────────────── */

.topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topnav-h);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.topnav-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--accent);
    transition: opacity 0.2s;
}
.topnav-brand:hover { opacity: 0.75; }
.topnav-brand i { font-size: 12px; }

.topnav-sep { color: var(--text-muted); font-size: 14px; }

.topnav-current {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.topnav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 6px 11px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.topnav-toggle:hover { border-color: var(--accent); color: var(--accent); }


/* ── Layout ──────────────────────────────────────── */

.layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}


/* ── Sidebar ─────────────────────────────────────── */

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: var(--topnav-h);
    height: calc(100vh - var(--topnav-h));
    overflow-y: auto;
    padding: 32px 20px 32px 0;
    border-right: 1px solid var(--border);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-left: 12px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 450;
    color: var(--text-muted);
    transition: all 0.2s;
}
.sidebar-link i {
    width: 16px;
    font-size: 13px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar-link:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}
.sidebar-link.active {
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 500;
}


/* ── Main Content ────────────────────────────────── */

.main-content {
    flex: 1;
    padding: 40px 0 80px 40px;
    min-width: 0;
}

.section {
    margin-bottom: 64px;
    scroll-margin-top: calc(var(--topnav-h) + 20px);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.section-title i { color: var(--accent); font-size: 18px; }


/* ── Hero ────────────────────────────────────────── */

.hero {
    margin-bottom: 64px;
    scroll-margin-top: calc(var(--topnav-h) + 20px);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-dim);
    border: 1px solid rgba(230, 51, 18, 0.3);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.hero-title {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #ffb3a3 50%, #e63312 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 560px;
    margin-bottom: 24px;
    line-height: 1.75;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    transition: all 0.2s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }


/* ── Guide Cards (grid) ──────────────────────────── */

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.guide-grid--featured {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.25s;
    position: relative;
}
.guide-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(230, 51, 18, 0.15);
}
.guide-card--featured { padding: 24px; }

.guide-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-card__icon {
    width: 52px;
    height: 52px;
    background: var(--accent-dim);
    border: 1px solid rgba(230, 51, 18, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--accent);
}
.guide-card__icon--small { width: 42px; height: 42px; font-size: 18px; border-radius: 10px; }

.guide-card__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.guide-card__desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
}

.guide-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.guide-card__link {
    color: var(--accent);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    transition: gap 0.2s;
}
.guide-card:hover .guide-card__link { gap: 8px; }


/* ── Tags & Badges ───────────────────────────────── */

.guide-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 6px;
}
.guide-tag--new  { background: rgba(230,51,18,.15); color: #ff7a5e; border: 1px solid rgba(230,51,18,.3); }
.guide-tag--hot  { background: rgba(239,68,68,.15); color: #f87171; border: 1px solid rgba(239,68,68,.25); }

.guide-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 6px;
}
.guide-badge--beginner     { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.25); }
.guide-badge--intermediate { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.25); }
.guide-badge--advanced     { background: rgba(239,68,68,.15);  color: #f87171; border: 1px solid rgba(239,68,68,.25);  }


/* ── Guide List Rows ─────────────────────────────── */

.guide-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s;
}
.guide-row:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.guide-row__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.guide-row__icon--purple { background: rgba(230,51,18,.12); color: #ff7a5e; border: 1px solid rgba(230,51,18,.2); }
.guide-row__icon--blue   { background: rgba(59,130,246,.12); color: #60a5fa; border: 1px solid rgba(59,130,246,.2); }
.guide-row__icon--green  { background: rgba(16,185,129,.12); color: #34d399; border: 1px solid rgba(16,185,129,.2); }
.guide-row__icon--orange { background: rgba(245,158,11,.12); color: #fbbf24; border: 1px solid rgba(245,158,11,.2); }

.guide-row__content { flex: 1; min-width: 0; }
.guide-row__content h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}
.guide-row__content p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.guide-row__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.time {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Full-row clickable overlay */
.guide-row__link {
    position: absolute;
    inset: 0;
    border-radius: 12px;
}


/* ── FAQ ─────────────────────────────────────────── */

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.faq-item[open] { border-color: var(--border-hover); }

.faq-question {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    transition: background 0.2s;
    user-select: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question:hover { background: var(--bg-card-hover); }
.faq-question i {
    color: var(--accent);
    font-size: 12px;
    transition: transform 0.25s;
    flex-shrink: 0;
}
.faq-item[open] .faq-question i { transform: rotate(90deg); }

.faq-answer {
    padding: 14px 20px 16px 44px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.75;
    border-top: 1px solid var(--border);
}
.faq-answer strong { color: var(--text); }


/* ── Footer ──────────────────────────────────────── */

.footer {
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}
.footer a { color: var(--accent); font-weight: 500; }
.footer a:hover { text-decoration: underline; }


/* ── Responsive ──────────────────────────────────── */

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        top: var(--topnav-h);
        left: 0;
        height: calc(100vh - var(--topnav-h));
        z-index: 90;
        background: var(--bg);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: 24px 20px;
        border-right: 1px solid var(--border);
        width: var(--sidebar-w);
    }
    .sidebar--open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.5); }

    .topnav-toggle { display: block; }

    .layout { padding: 0; }
    .main-content { padding: 32px 20px 80px; }
    .hero-title { font-size: 38px; }
}

@media (max-width: 600px) {
    .hero-title { font-size: 30px; }
    .hero-desc { font-size: 15px; }
    .guide-grid,
    .guide-grid--featured { grid-template-columns: 1fr; }
    .guide-row__meta { display: none; }
    .section-title { font-size: 18px; }
    .topnav { padding: 0 16px; }
    .main-content { padding: 24px 16px 80px; }
}
