/* Project: Serious Games Tutorial - Deep Tech Dark Mode */

:root {
    --primary: #10b981; /* Vibrant Emerald */
    --primary-glow: rgba(16, 185, 129, 0.4);
    --primary-gradient: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    --bg-deep: #050814;
    --bg-card: rgba(15, 23, 42, 0.8);
    --bg-sidebar: rgba(10, 15, 30, 0.5);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --accent-blue: #38bdf8;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(16, 185, 129, 0.15);
    
    /* Typography - All OFL (Open Font License) */
    --header-font: 'Space Grotesk', sans-serif;
    --body-font: 'Inter', sans-serif;
    --mono-font: 'JetBrains Mono', monospace;
    
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.5);
}

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

html, body {
    font-family: var(--body-font);
    background-color: var(--bg-deep);
    background-image: 
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(56, 189, 248, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.7;
    scroll-behavior: smooth;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, .accordion {
    font-family: var(--header-font);
    font-weight: 600;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 2.5rem;
    margin-bottom: 2.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.2));
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #7dd3fc; /* Brighter blue on hover */
    text-decoration: underline;
}

/* --- Premium Navigation --- */
.topnav {
    background: rgba(5, 8, 20, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    padding: 0 8%;
    display: flex;
    justify-content: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.topnav a {
    color: var(--text-dim);
    text-align: center;
    padding: 20px 25px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: var(--transition);
    position: relative;
}

.topnav a::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
    transform: translateX(-50%);
    box-shadow: 0 0 10px var(--primary);
}

.topnav a:hover {
    color: var(--text-main);
}

.topnav a:hover::before {
    width: 40%;
}

.topnav a.active {
    color: var(--primary);
}

.topnav a.active::before {
    width: 70%;
}

/* --- Layout --- */
.container {
    display: flex;
    max-width: 1400px;
    margin: 40px auto;
    width: 95%;
    flex: 1;
    gap: 20px;
}

.sidebar-left, .sidebar-right {
    flex: 0 0 12%;
    background: var(--bg-sidebar);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.content {
    flex: 1;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 60px 80px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-premium);
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Modern Components --- */

/* Accordion */
.accordion {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    cursor: pointer;
    padding: 24px 32px;
    width: 100%;
    border: 1px solid var(--border-color);
    text-align: left;
    outline: none;
    font-size: 18px;
    transition: var(--transition);
    margin-top: 15px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.accordion::after {
    content: '\2192'; /* Arrow right */
    font-size: 22px;
    color: var(--primary);
    transition: var(--transition);
}

.accordion:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-glow);
    padding-left: 40px;
}

.accordion.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.accordion.active::after {
    transform: rotate(90deg);
}

.panel {
    padding: 0 40px;
    background: rgba(15, 23, 42, 0.4);
    max-height: 0;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 16px 16px;
}

/* Info Box */
.info-box {
    background: rgba(56, 189, 248, 0.05);
    border-left: 4px solid var(--accent-blue);
    padding: 25px;
    margin: 30px 0;
    border-radius: 4px 20px 20px 4px;
    color: #cbd5e1;
    position: relative;
}

.info-box strong {
    color: var(--accent-blue);
    display: block;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 14px;
}

/* Error Box specifically for highlighting critical deployment errors */
.error-box {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-left: 5px solid #ef4444;
    padding: 25px;
    margin: 30px 0;
    border-radius: 4px 20px 20px 4px;
    color: #fca5a5;
    position: relative;
}

.error-box strong {
    color: #ef4444;
    display: block;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 14px;
}

/* Comparison Table */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
    margin: 24px 0;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
    padding: 20px;
    text-align: left;
    font-family: var(--header-font);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.comparison-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* --- Technical Details --- */

.panel code {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-blue);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: var(--mono-font);
    font-size: 0.9em;
}

.panel pre {
    background: #010409;
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 20px;
    margin: 25px 0;
    overflow-x: auto;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.panel h3 {
    -webkit-text-fill-color: var(--primary);
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    background: none;
}

.source-ref {
    background: rgba(255, 255, 255, 0.02);
    padding: 20px;
    border-radius: 15px;
    border-left: 3px solid var(--primary);
    font-size: 0.85rem;
    color: var(--text-dim);
    margin: 30px 0;
}

figure {
    background: rgba(255, 255, 255, 0.02);
    padding: 30px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    margin: 40px 0;
    text-align: center;
}

figure img {
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    max-width: 100%;
}

figcaption {
    color: var(--text-dim);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Footer --- */
.site-footer {
    background: #050810;
    border-top: 1px solid var(--border-color);
    padding: 60px 0;
    margin-top: 100px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    margin-left: 30px;
    font-size: 14px;
    transition: var(--transition);
}

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

/* --- Responsive --- */
@media (max-width: 1100px) {
    .container { gap: 0; }
    .sidebar-left, .sidebar-right { display: none; }
    .content { padding: 40px 50px; }
}

@media (max-width: 768px) {
    .topnav { flex-direction: column; padding: 10px; }
    .topnav a { padding: 12px; width: 100%; }
    .content { padding: 30px 20px; border-radius: 0; }
    .footer-content { flex-direction: column; gap: 30px; text-align: center; }
    .footer-links a { margin: 0 15px; }
}
