/* ============================================
   Common Styles for LLM Interactive Lessons
   ============================================ */

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

/* Body & Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    color: white;
    padding: 40px 20px;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.3em;
    opacity: 0.95;
}

/* Content Cards */
.content-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Section Titles */
.section-title {
    font-size: 2em;
    color: #667eea;
    margin-bottom: 20px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

/* Explanation Boxes */
.explanation {
    background: #fff3cd;
    border-left: 5px solid #ffc107;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.explanation h3 {
    color: #856404;
    margin-bottom: 10px;
}

/* Interactive Demo Areas */
.interactive-demo {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 30px;
    margin: 20px 0;
}

/* Top Navigation Bar */
.top-nav {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #e0e0e0;
    padding: 15px 20px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.top-nav-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.top-nav-left,
.top-nav-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.top-nav-center {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1em;
    text-align: center;
}

.top-nav-btn {
    padding: 8px 16px;
    font-size: 0.95em;
    border: 2px solid #667eea;
    border-radius: 6px;
    background: white;
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.top-nav-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.top-nav-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Buttons */
button {
    padding: 15px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-classic {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-deep {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

/* Controls Container */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* Grid Layouts */
.grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}

/* Concept Boxes */
.concept-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
}

.concept-box h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
}

/* Feature Cards */
.feature-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.feature-icon {
    font-size: 3em;
    text-align: center;
    margin-bottom: 15px;
}

.feature-title {
    font-size: 1.3em;
    color: #667eea;
    margin-bottom: 10px;
    font-weight: bold;
}

/* Formulas */
.formula {
    background: white;
    color: #333;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    margin: 15px 0;
    text-align: center;
}

/* Sliders */
.slider-container {
    margin: 20px 0;
}

.slider-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #667eea;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.value-display {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    margin-left: 10px;
    font-weight: bold;
}

/* Text Inputs */
input[type="text"] {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #667eea;
    border-radius: 8px;
    margin: 10px 0;
}

/* Tokens & Words */
.token-box {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    margin: 5px;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.word-box {
    display: inline-block;
    padding: 15px 25px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 10px;
    margin: 10px;
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* Arrows */
.arrow {
    font-size: 2em;
    color: #667eea;
}

.arrow-down {
    text-align: center;
    font-size: 2em;
    color: #667eea;
    margin: 10px 0;
}

/* Comparison Grids & Tables */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
    position: relative;
}

.comparison-grid::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #667eea, #764ba2);
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.comparison-box {
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.comparison-table th,
.comparison-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.comparison-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.2em;
}

.comparison-table tr:hover {
    background: #f9f9f9;
}

/* Pros & Cons */
.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.pros, .cons {
    padding: 20px;
    border-radius: 10px;
}

.pros {
    background: #d4edda;
    border-left: 5px solid #28a745;
}

.cons {
    background: #f8d7da;
    border-left: 5px solid #dc3545;
}

.pros h3 {
    color: #155724;
    margin-bottom: 15px;
}

.cons h3 {
    color: #721c24;
    margin-bottom: 15px;
}

/* Neuron Visuals */
.neuron-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.input-node, .output-node {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2em;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    position: relative;
}

.weight-line {
    width: 150px;
    height: 3px;
    background: #667eea;
    position: relative;
}

.weight-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: bold;
    color: #667eea;
}

/* Architecture Diagrams */
.architecture-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.arch-box {
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    min-width: 150px;
    text-align: center;
}

.architecture-diagram {
    background: white;
    padding: 30px;
    border-radius: 10px;
    border: 2px solid #667eea;
    margin: 20px 0;
}

.flow-step {
    display: inline-block;
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin: 10px;
    font-weight: bold;
}

/* Network Diagrams */
.network-diagram {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 30px 0;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 10px;
}

.layer {
    text-align: center;
}

.layer-title {
    font-weight: bold;
    margin-bottom: 15px;
    color: #667eea;
    font-size: 1.2em;
}

.neurons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.neuron {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* Pipeline Visuals */
.pipeline-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pipeline-step {
    padding: 20px 30px;
    background: white;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    min-width: 150px;
    text-align: center;
}

/* Token Flow */
.token-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* Attention Grids */
.attention-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 5px;
    margin: 20px 0;
}

.attention-cell {
    padding: 15px;
    text-align: center;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
}

/* Metrics & Progress */
.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.metric-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.metric-value {
    font-size: 1.8em;
    font-weight: bold;
    margin: 5px 0;
}

.metric-label {
    font-size: 0.85em;
    opacity: 0.9;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Visualization Boxes */
.visualization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.viz-box {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    border: 2px solid #e0e0e0;
}

.viz-title {
    font-size: 1.1em;
    color: #667eea;
    margin-bottom: 10px;
    font-weight: bold;
}

.data-viz {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
}

/* Step Indicators */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 8px;
    background: #f0f0f0;
    margin: 3px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85em;
}

.step.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.05);
}

.step:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Prompts & Examples */
.prompt-example {
    background: #f5f5f5;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
}

.output-example {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
}

/* Cost Indicators */
.cost-indicator {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.cost-low {
    background: #c8e6c9;
    color: #2e7d32;
}

.cost-medium {
    background: #fff9c4;
    color: #f57f17;
}

.cost-high {
    background: #ffcdd2;
    color: #c62828;
}

/* Technique & Application Cards */
.technique-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s;
}

.technique-card:hover {
    transform: translateY(-5px);
}

.technique-card h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
}

.application-card {
    padding: 25px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    transition: transform 0.3s, box-shadow 0.3s;
}

.application-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.icon {
    font-size: 3em;
    text-align: center;
    margin-bottom: 15px;
}

/* Limitation Boxes */
.limitation-box {
    background: #ffebee;
    border-left: 5px solid #c62828;
    padding: 20px;
    margin: 15px 0;
    border-radius: 5px;
}

.limitation-box h4 {
    color: #c62828;
    margin-bottom: 10px;
}

/* Ethical Principles */
.ethical-principle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-card > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    .grid-3col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-grid::before {
        display: none;
    }
    
    .pros-cons {
        grid-template-columns: 1fr;
    }
    
    .neuron-visual {
        flex-direction: column;
    }
    
    .weight-line {
        width: 3px;
        height: 100px;
    }
    
    .network-diagram {
        flex-direction: column;
        gap: 30px;
    }
    
    .visualization-grid {
        grid-template-columns: 1fr;
    }
    
    .top-nav-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .top-nav-center {
        order: -1;
        font-size: 0.95em;
    }
    
    .grid-3col {
        grid-template-columns: 1fr;
    }
}
