/* ============================================
   Browser Console Override Tutorial - Styles
   ============================================ */

/* === Base Styles === */
:root {
    --primary-color: #4ecdc4;
    --secondary-color: #ff6b6b;
    --accent-color: #ffe66d;
    --dark-bg: #1a1a2e;
    --darker-bg: #16213e;
    --card-bg: #0f3460;
    --text-primary: #f1f1f1;
    --text-secondary: #b8b8b8;
    --code-bg: #2d2d2d;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

/* === Navigation === */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(26, 26, 46, 0.95) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
}

.nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.3s ease, transform 0.2s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* === Hero Section === */
.hero-section {
    padding: 160px 0 100px;
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 50%, var(--card-bg) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234ecdc4' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

.hero-section h1 {
    text-shadow: 0 0 40px rgba(78, 205, 196, 0.3);
}

.hero-section .btn-primary {
    background: var(--primary-color);
    border: none;
    padding: 15px 40px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.hero-section .btn-primary:hover {
    background: var(--accent-color);
    color: var(--dark-bg);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(78, 205, 196, 0.3);
}

/* === h4 size normalization (formerly h5 subheadings) === */
/* These contexts use h4 as a sub-h3 heading; keep visual size matching old h5 */
.interactive-controls h4,
.color-preview-box h4,
.math-breakdown h4,
.math-explanation h4,
.sin-visual + * h4,
.content-card > .row h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* === Sections === */
.tutorial-section {
    padding: 60px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

/* === Cards === */
.content-card {
    background: rgba(15, 52, 96, 0.5);
    border: 1px solid rgba(78, 205, 196, 0.2);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.content-card:hover {
    border-color: rgba(78, 205, 196, 0.4);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
}

.content-card h3 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-weight: 600;
}

.info-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(15, 52, 96, 0.8) 100%);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 25px;
}

.info-card h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* === Feature List === */
.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 10px 0 10px 35px;
    position: relative;
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* === Method Cards === */
.method-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    height: 100%;
    border-left: 4px solid var(--primary-color);
}

.method-card h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* === Console Demo === */
.console-demo {
    background: #1e1e1e;
    border-radius: 10px;
    overflow: hidden;
    font-family: 'Consolas', 'Monaco', monospace;
    margin: 20px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.console-header {
    background: #3c3c3c;
    padding: 10px 15px;
    font-size: 0.9rem;
    color: #ccc;
}

.console-body {
    padding: 15px;
}

.console-line {
    display: flex;
    margin-bottom: 5px;
}

.console-prompt {
    color: #569cd6;
    margin-right: 10px;
}

.console-input {
    color: #d4d4d4;
}

.console-output {
    color: #808080;
    padding-left: 25px;
    margin-bottom: 10px;
}

.console-return {
    color: #4ec9b0;
}

/* === Try It Box === */
.try-it-box {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.15) 0%, rgba(78, 205, 196, 0.05) 100%);
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.try-it-box h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* === Canvas Container === */
.canvas-container {
    background: #1e1e28;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 440px;
    border: 2px solid rgba(78, 205, 196, 0.3);
}

#disk-canvas canvas {
    border-radius: 8px;
}

/* === Value Display === */
.value-display {
    list-style: none;
    padding: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px 20px;
}

.value-display li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-family: 'Consolas', monospace;
}

.value-display span {
    color: var(--accent-color);
    font-weight: bold;
}

/* === Code Examples === */
.code-example {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 20px;
    position: relative;
}

.code-example h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1rem;
}

.code-example pre {
    margin: 0;
    border-radius: 8px;
}

.copy-btn {
    position: absolute;
    top: 15px;
    right: 15px;
}

/* === Alert Customization === */
.alert {
    border-radius: 10px;
    border: none;
}

.alert-info {
    background: rgba(78, 205, 196, 0.15);
    color: var(--text-primary);
    border-left: 4px solid var(--primary-color);
}

.alert-warning {
    background: rgba(255, 230, 109, 0.15);
    color: var(--text-primary);
    border-left: 4px solid var(--accent-color);
}

.alert-success {
    background: rgba(46, 204, 113, 0.15);
    color: var(--text-primary);
    border-left: 4px solid #2ecc71;
}

.alert h4 {
    color: var(--primary-color);
}

/* === Keyboard Keys === */
kbd {
    background: linear-gradient(180deg, #555 0%, #333 100%);
    border: 1px solid #222;
    border-radius: 5px;
    box-shadow: 0 2px 0 #222;
    color: #fff;
    display: inline-block;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    padding: 3px 8px;
    margin: 0 2px;
}

/* === Sin Wave Visual === */
.sin-visual {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

#sin-wave-visual {
    max-width: 100%;
    height: auto;
}

/* === Formula Box === */
.formula-box {
    background: var(--code-bg);
    border-radius: 8px;
    padding: 15px 20px;
    font-family: 'Consolas', monospace;
    font-size: 1.1rem;
    text-align: center;
    color: var(--accent-color);
}

/* === Interactive Controls === */
.interactive-controls {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 25px;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 500;
}

.control-group span {
    color: var(--accent-color);
    font-family: 'Consolas', monospace;
}

.form-range {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(78, 205, 196, 0.2);
}

.form-range::-webkit-slider-thumb {
    background: var(--primary-color);
}

/* === Color Channels === */
.color-channel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    height: 100%;
}

.color-channel.red h4 { color: #ff6b6b; }
.color-channel.green h4 { color: #6bff6b; }
.color-channel.blue h4 { color: #6b6bff; }

.channel-wave {
    height: 60px;
    margin: 15px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* === Color Preview === */
.color-preview-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
}

#color-preview-strip {
    height: 50px;
    border-radius: 8px;
    background: linear-gradient(90deg, 
        hsl(0, 80%, 60%), 
        hsl(60, 80%, 60%), 
        hsl(120, 80%, 60%), 
        hsl(180, 80%, 60%), 
        hsl(240, 80%, 60%), 
        hsl(300, 80%, 60%), 
        hsl(360, 80%, 60%)
    );
}

/* === Math Breakdown === */
.math-breakdown {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 25px;
}

.breakdown-steps {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.step-num {
    background: var(--primary-color);
    color: var(--dark-bg);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content p {
    margin: 5px 0 0;
    color: var(--text-secondary);
}

/* === Formula Visual === */
.formula-visual {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.phase {
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
}

.phase.red { background: rgba(255, 107, 107, 0.3); color: #ff6b6b; }
.phase.green { background: rgba(107, 255, 107, 0.3); color: #6bff6b; }
.phase.blue { background: rgba(107, 107, 255, 0.3); color: #6b6bff; }

/* === Table Styles === */
.table-dark {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.table-dark th {
    background: rgba(78, 205, 196, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

.table-dark td {
    border-color: rgba(255, 255, 255, 0.1);
}

/* === Save Methods === */
.method-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.save-method {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid var(--primary-color);
}

.save-method h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* === Tips Grid === */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.tip {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
}

.tip h4 {
    color: var(--accent-color);
    margin-bottom: 15px;
}

.tip pre {
    margin: 0;
    font-size: 0.85rem;
}

/* === Challenges === */
.challenge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.challenge {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 25px;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.challenge:hover {
    transform: translateY(-3px);
}

.challenge.beginner { border-color: #2ecc71; }
.challenge.intermediate { border-color: #f39c12; }
.challenge.advanced { border-color: #e74c3c; }

.difficulty {
    position: absolute;
    top: -10px;
    right: 20px;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.beginner .difficulty { background: #2ecc71; color: #fff; }
.intermediate .difficulty { background: #f39c12; color: #fff; }
.advanced .difficulty { background: #e74c3c; color: #fff; }

.challenge h4 {
    margin-top: 10px;
    color: var(--text-primary);
}

.challenge details {
    margin-top: 15px;
}

.challenge summary {
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 500;
}

.challenge details[open] summary {
    margin-bottom: 10px;
}

/* === Reference Grid === */
.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.ref-item {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.ref-item h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.ref-item pre {
    margin: 0;
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: hidden;
    max-width: 100%;
}

.copy-ref {
    position: absolute;
    top: 15px;
    right: 15px;
}

/* === Local Overrides Section === */
.numbered-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.step-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.step-item:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateX(5px);
}

.step-number {
    background: linear-gradient(135deg, var(--primary-color), #3db8b0);
    color: var(--dark-bg);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.step-item .step-content h4 {
    color: var(--accent-color);
    margin-bottom: 8px;
}

.step-item .step-content p {
    margin: 0;
    color: var(--text-secondary);
}

.step-item .step-content pre {
    margin-top: 10px;
}

/* DevTools Mockup */
.visual-reference {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 20px;
}

.devtools-mockup {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 0.9rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.mockup-tabs {
    background: #3c3c3c;
    padding: 8px 15px;
    display: flex;
    gap: 20px;
    border-bottom: 1px solid #555;
}

.mockup-tabs span {
    color: #aaa;
    padding: 5px 10px;
    cursor: pointer;
}

.mockup-tabs span.active {
    color: #fff;
    border-bottom: 2px solid var(--primary-color);
}

.mockup-content {
    display: flex;
    min-height: 150px;
}

.mockup-sidebar {
    width: 250px;
    background: #252526;
    border-right: 1px solid #3c3c3c;
}

.sidebar-tabs {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #2d2d2d;
    font-size: 0.8rem;
}

.sidebar-tabs span {
    color: #888;
    padding: 3px 8px;
}

.sidebar-tabs span.active {
    color: #fff;
    background: rgba(78, 205, 196, 0.2);
    border-radius: 4px;
}

.sidebar-content {
    padding: 15px;
    color: #ccc;
    font-size: 0.85rem;
}

.sidebar-content p {
    margin: 8px 0;
}

.mockup-main {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Comparison Box */
.comparison-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 25px;
}

.compare-item {
    padding: 20px;
    border-radius: 10px;
    height: 100%;
}

.compare-item.console {
    background: rgba(231, 76, 60, 0.15);
    border: 2px solid rgba(231, 76, 60, 0.4);
}

.compare-item.console h4 {
    color: #e74c3c;
}

.compare-item.overrides {
    background: rgba(46, 204, 113, 0.15);
    border: 2px solid rgba(46, 204, 113, 0.4);
}

.compare-item.overrides h4 {
    color: #2ecc71;
}

.compare-item ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.compare-item ul li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.compare-item.console ul li::before {
    content: '✗';
    position: absolute;
    left: 0;
    color: #e74c3c;
}

.compare-item.overrides ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2ecc71;
}

/* Practice Exercise */
.practice-exercise {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.1) 0%, rgba(78, 205, 196, 0.05) 100%);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 30px;
    margin-top: 20px;
}

.exercise-step {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.exercise-steps {
    padding-left: 25px;
}

.exercise-steps li {
    padding: 8px 0;
    color: var(--text-secondary);
}

.exercise-steps li::marker {
    color: var(--primary-color);
    font-weight: bold;
}

.practice-exercise pre {
    margin: 15px 0;
}

/* === Footer === */
.footer {
    background: rgba(0, 0, 0, 0.5);
    padding: 30px 0;
    margin-top: 60px;
    border-top: 1px solid rgba(78, 205, 196, 0.2);
}

.footer-link {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-color);
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero-section {
        padding: 120px 0 60px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .content-card {
        padding: 20px;
    }
    
    .formula-visual {
        flex-direction: column;
        gap: 10px;
    }
}

/* === Animations === */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--primary-color); }
    50% { box-shadow: 0 0 20px var(--primary-color); }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--darker-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* === Selection === */
::selection {
    background: var(--primary-color);
    color: var(--dark-bg);
}

/* === Code Highlighting Override === */
.hljs {
    background: transparent !important;
    padding: 0 !important;
}

pre code.hljs {
    padding: 15px !important;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5) !important;
}
