/* SSR-specific styles */
.ssr-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.header-stats span {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* SSR Introduction Styles */
.ssr-intro {
    margin-top: 30px;
}

.definition-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.definition-card {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid #10b981;
}

.definition-card h3 {
    color: var(--accent-success);
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.definition-card p {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.1rem;
}

.process-flow {
    background: #f8fafc;
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid #3b82f6;
}

.process-flow h3 {
    color: var(--accent-primary);
    font-size: 1.6rem;
    margin-bottom: 20px;
    text-align: center;
}

.flow-steps {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    flex: 1;
}

.step-number {
    background: #10b981;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
}

.step-content h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 5px;
    text-align: center;
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.4;
}

.flow-arrow {
    font-size: 1.5rem;
    color: var(--accent-success);
    font-weight: bold;
}

.ssr-characteristics {
    background: #ecfdf5;
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid #22c55e;
}

.ssr-characteristics h3 {
    color: var(--accent-success);
    font-size: 1.8rem;
    margin-bottom: 25px;
    text-align: center;
}

.characteristics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.characteristic-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-top: 3px solid #22c55e;
}

.char-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.characteristic-item h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.characteristic-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Detailed Comparison Styles */
.detailed-comparison {
    margin-top: 30px;
}

.comparison-visual {
    background: #f8fafc;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
    border-left: 5px solid #8b5cf6;
}

.comparison-timeline h3 {
    color: #6b21a8;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.timeline-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.timeline-track {
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #10b981;
}

.csr-track {
    border-left-color: #3b82f6;
}

.timeline-track h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.timeline-events {
    position: relative;
    height: 40px;
    background: #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
}

.event {
    position: absolute;
    height: 100%;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.event:hover {
    transform: scaleY(1.1);
    z-index: 10;
}

.server-processing {
    background: #f59e0b;
}

.html-download {
    background: #10b981;
}

.first-paint {
    background: #22c55e;
}

.js-download {
    background: #3b82f6;
}

.hydration {
    background: #8b5cf6;
}

.interactive {
    background: #06b6d4;
}

.html-shell {
    background: #6b7280;
}

.js-execution {
    background: #ef4444;
}

.api-calls {
    background: #f59e0b;
}

.event-label {
    font-weight: 600;
    font-size: 0.6rem;
}

.event-time {
    font-size: 0.5rem;
    opacity: 0.9;
}

.metrics-comparison {
    background: #f0f9ff;
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid #0ea5e9;
    margin-bottom: 40px;
}

.metrics-comparison h3 {
    color: #0c4a6e;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.vitals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.vital-metric {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.vital-metric h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
}

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

.metric-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-label {
    width: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
}

.bar {
    height: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    min-width: 60px;
    transition: width 0.5s ease;
}

.ssr-bar .bar {
    background: linear-gradient(90deg, #10b981, #059669);
}

.csr-bar .bar {
    background: linear-gradient(90deg, #3b82f6, #1e40af);
}

.trade-offs-analysis {
    background: #f8fafc;
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid #6b7280;
}

.trade-offs-analysis h3 {
    color: #374151;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.trade-offs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.trade-off-item {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.trade-off-item h4 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
}

.trade-off-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.trade-off-side {
    padding: 15px;
    border-radius: 8px;
}

.ssr-side {
    background: #dcfce7;
    border-left: 4px solid #10b981;
}

.csr-side {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
}

.trade-off-side h5 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.ssr-side h5 {
    color: #059669;
}

.csr-side h5 {
    color: var(--accent-primary);
}

.trade-off-side ul {
    list-style: none;
    padding: 0;
}

.trade-off-side li {
    padding: 4px 0;
    padding-left: 15px;
    position: relative;
    color: #374151;
    font-size: 0.9rem;
}

.ssr-side li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-success);
    font-weight: bold;
}

.csr-side li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: bold;
}

/* Hydration Styles */
.hydration-content {
    margin-top: 30px;
}

.hydration-explanation {
    background: #f0f9ff;
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid #0ea5e9;
    margin-bottom: 40px;
}

.hydration-explanation h3 {
    color: #0c4a6e;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.hydration-definition {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.hydration-definition p {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.1rem;
}

.hydration-process {
    margin-bottom: 40px;
}

.hydration-process h3 {
    color: var(--text-primary);
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.hydration-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.hydration-step {
    width: 100%;
    max-width: 600px;
}

.step-visual {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-top: 4px solid #0ea5e9;
}

.html-state h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.html-preview {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #6b7280;
    font-family: 'Fira Code', monospace;
    margin-bottom: 15px;
}

.element {
    margin: 5px 0;
    font-size: 0.9rem;
}

.tag {
    color: #7c3aed;
    font-weight: 500;
}

.content {
    color: var(--text-primary);
    margin: 0 5px;
}

.js-code {
    background: #1f2937;
    color: #e5e7eb;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 15px;
}

.interactive-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 15px;
}

.demo-button {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.demo-button:hover {
    background: #059669;
    transform: translateY(-1px);
}

.demo-counter {
    font-family: 'Fira Code', monospace;
    color: var(--text-primary);
    font-weight: 500;
}

.state-indicator {
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
}

.state-indicator.static {
    background: #fee2e2;
    color: #dc2626;
}

.state-indicator.hydrating {
    background: #fef3c7;
    color: #d97706;
}

.state-indicator.interactive {
    background: #dcfce7;
    color: var(--accent-success);
}

.hydration-arrow {
    font-size: 2rem;
    color: #0ea5e9;
    margin: 15px 0;
}

.hydration-challenges {
    background: #fff5f5;
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid #ef4444;
    margin-bottom: 40px;
}

.hydration-challenges h3 {
    color: #dc2626;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.challenge-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-top: 3px solid #ef4444;
}

.challenge-icon {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 15px;
}

.challenge-item h4 {
    color: #dc2626;
    margin-bottom: 10px;
    font-size: 1.2rem;
    text-align: center;
}

.challenge-item p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
}

.challenge-demo {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.fake-interactive {
    background: #d1d5db;
    color: var(--text-secondary);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: not-allowed;
    font-weight: 500;
    margin-bottom: 10px;
}

.demo-explanation small {
    color: var(--text-secondary);
    font-style: italic;
}

.mismatch-example {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
}

.server-render,
.client-render {
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

.server-render {
    background: #dcfce7;
    color: var(--accent-success);
}

.client-render {
    background: #dbeafe;
    color: var(--accent-primary);
}

.mismatch-result {
    text-align: center;
    margin-top: 10px;
}

.mismatch-result small {
    color: #dc2626;
    font-weight: 500;
}

.bundle-impact {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.bundle-size,
.hydration-time {
    margin: 8px 0;
    font-family: 'Fira Code', monospace;
    font-weight: 500;
    color: var(--text-primary);
}

#optimizeBundle {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 10px;
    transition: all 0.3s ease;
}

#optimizeBundle:hover {
    background: #059669;
}

.hydration-optimization {
    background: #ecfdf5;
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid #22c55e;
}

.hydration-optimization h3 {
    color: var(--accent-success);
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.optimization-techniques {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.technique-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-top: 3px solid #22c55e;
}

.technique-card h4 {
    color: var(--accent-success);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.technique-example {
    background: #1f2937;
    color: #e5e7eb;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Next.js Demo Styles */
.nextjs-demo {
    margin-top: 30px;
}

.demo-explanation {
    background: #f0f9ff;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border-left: 5px solid #0ea5e9;
}

.demo-explanation h3 {
    color: #0c4a6e;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.demo-explanation p {
    color: var(--text-primary);
    line-height: 1.6;
}

.demo-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.demo-controls {
    background: #f8fafc;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.demo-controls button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ssr-btn {
    background: #10b981;
    color: white;
}

.ssr-btn:hover {
    background: #059669;
}

.nav-btn {
    background: #3b82f6;
    color: white;
}

.nav-btn:hover {
    background: #1e40af;
}

.reset-btn {
    background: #6b7280;
    color: white;
}

.reset-btn:hover {
    background: #4b5563;
}

.demo-stages {
    padding: 25px;
}

.stage-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.stage {
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #e5e7eb;
    transition: all 0.3s ease;
}

.stage.active {
    border-left-color: var(--accent-success);
    background: #ecfdf5;
}

.stage h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.stage-content {
    margin-bottom: 15px;
}

.request-info {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
}

.request-url {
    background: #1f2937;
    color: #e5e7eb;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.request-headers {
    background: #f8fafc;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #6b7280;
}

.request-headers div {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin: 2px 0;
}

.server-code {
    background: #1f2937;
    color: #e5e7eb;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    overflow-x: auto;
}

.html-output {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #10b981;
}

.html-preview {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.browser-result {
    background: #f0f9ff;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #0ea5e9;
}

.result-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stage-status {
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

.stage-status.pending {
    background: #f3f4f6;
    color: var(--text-secondary);
}

.stage-status.processing {
    background: #fef3c7;
    color: #d97706;
}

.stage-status.completed {
    background: #dcfce7;
    color: var(--accent-success);
}

.demo-metrics {
    background: #f8fafc;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
}

.demo-metrics h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    text-align: center;
}

.metrics-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.metric-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.metric-value {
    font-weight: 600;
    color: var(--text-primary);
}

.code-examples {
    background: #f8fafc;
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid #6366f1;
}

.code-examples h3 {
    color: #4338ca;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.code-tabs {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px 20px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: white;
    color: #4338ca;
    border-bottom: 2px solid #4338ca;
}

.tab-btn:hover:not(.active) {
    background: #f3f4f6;
    color: #374151;
}

.tab-content {
    display: none;
    padding: 25px;
}

.tab-content.active {
    display: block;
}

.tab-content h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-family: 'Fira Code', monospace;
}

.tab-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
}

/* Optimization Styles */
.optimization-content {
    margin-top: 30px;
}

.optimization-overview {
    background: #fff5f5;
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid #ef4444;
    margin-bottom: 40px;
}

.optimization-overview h3 {
    color: #dc2626;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.bottlenecks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.bottleneck-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-align: center;
    border-top: 3px solid #ef4444;
}

.bottleneck-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.bottleneck-item h4 {
    color: #dc2626;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.bottleneck-details p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
}

.bottleneck-metrics {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.bottleneck-metrics span {
    background: #fee2e2;
    color: #dc2626;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.bundle-impact {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.bundle-size,
.hydration-time {
    font-family: 'Fira Code', monospace;
    margin: 8px 0;
    font-weight: 500;
}

#bundleSize {
    color: #dc2626;
}

#hydrationTime {
    color: #d97706;
}

.optimization-strategies {
    margin-bottom: 40px;
}

.optimization-strategies h3 {
    color: var(--text-primary);
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.strategies-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.strategy-category {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-top: 4px solid #10b981;
}

.strategy-category h4 {
    color: #059669;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.strategy-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.strategy-item {
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    border-left: 3px solid #10b981;
}

.strategy-item h5 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.strategy-code {
    background: #1f2937;
    color: #e5e7eb;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
}

.strategy-benefits {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.strategy-benefits span {
    background: #dcfce7;
    color: var(--accent-success);
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.performance-demo {
    background: #f0f9ff;
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid #0ea5e9;
}

.performance-demo h3 {
    color: #0c4a6e;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.perf-demo-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.optimization-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
}

.toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-success);
}

.perf-test-btn {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.perf-test-btn:hover {
    background: #0284c7;
}

.performance-results {
    margin-top: 25px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.result-metric {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border-left: 3px solid #0ea5e9;
}

.result-metric h5 {
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.result-metric .metric-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    display: block;
    margin-bottom: 5px;
}

.metric-change {
    font-size: 0.8rem;
    font-weight: 500;
}

.metric-change.positive {
    color: #059669;
}

.metric-change.negative {
    color: #dc2626;
}

.optimization-impact {
    background: #f0f9ff;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #0ea5e9;
}

.optimization-impact h5 {
    color: #0c4a6e;
    margin-bottom: 10px;
}

.impact-summary {
    color: #374151;
    line-height: 1.5;
}

/* Summary Styles - inheriting from main CSS and adding SSR-specific */
.summary-content {
    margin-top: 30px;
}

.ssr-summary {
    margin-bottom: 40px;
}

.ssr-summary h3 {
    color: var(--text-primary);
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.takeaways-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.takeaway-item {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.takeaway-item.pros {
    border-top: 4px solid #10b981;
}

.takeaway-item.cons {
    border-top: 4px solid #ef4444;
}

.takeaway-item h4 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.pros h4 {
    color: #059669;
}

.cons h4 {
    color: #dc2626;
}

.takeaway-item ul {
    list-style: none;
    padding: 0;
}

.takeaway-item li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    color: #374151;
    line-height: 1.5;
}

.pros li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-success);
    font-weight: bold;
}

.cons li::before {
    content: '✗';
    position: absolute;
    left: 0;
    color: #ef4444;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {

    .definition-section,
    .comparison-visual,
    .takeaways-grid,
    .use-cases,
    .trade-off-comparison {
        grid-template-columns: 1fr;
    }

    .flow-steps,
    .demo-controls,
    .optimization-toggles {
        flex-direction: column;
        align-items: center;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    .vs-divider {
        margin: 20px 0;
    }

    .timeline-events .event {
        position: static;
        width: 100%;
        margin: 5px 0;
        border-radius: 6px;
    }

    .stage-container {
        grid-template-columns: 1fr;
    }

    .code-examples pre,
    .strategy-code,
    .technique-example {
        font-size: 0.7rem;
    }

    .tab-buttons {
        flex-direction: column;
    }
}