/* CSS Variables for theming */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f7fafc;
    --text-primary: #333333;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    --text-quaternary: #a0aec0;
    --border-primary: #e2e8f0;
    --border-secondary: #e5e7eb;
    --accent-red: #e53e3e;
    --accent-green: #38a169;
    --accent-blue: #4299e1;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --chat-bg: #f8f9fa;
    --chat-hover: #f7fafc;
}

[data-theme="dark"] {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-tertiary: #4a5568;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-tertiary: #cbd5e0;
    --text-quaternary: #a0aec0;
    --border-primary: #4a5568;
    --border-secondary: #2d3748;
    --accent-red: #fc8181;
    --accent-green: #68d391;
    --accent-blue: #63b3ed;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.4);
    --chat-bg: #2d3748;
    --chat-hover: #4a5568;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.dark-mode-toggle:hover {
    background: var(--bg-tertiary);
    transform: scale(1.05);
}

.dark-mode-toggle:active {
    transform: scale(0.95);
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .toggle-icon {
    transform: rotate(180deg);
}

/* Remove the old CSS pseudo-element approach since we're using JS */

/* Hero section */
.hero {
    text-align: center;
    padding: 4rem 0 3rem;
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: 3rem;
}

.title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.typing-container {
    display: inline-block;
    position: relative;
}

.typing-text {
    display: inline-block;
}

.strikethrough {
    text-decoration: line-through;
    text-decoration-color: var(--accent-red);
    text-decoration-thickness: 3px;
}

.cursor {
    animation: blink 1s infinite;
    color: var(--accent-blue);
    display: inline-block;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.subtitle {
    font-size: 1.3rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

.analogy-section {
    margin-top: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.analogy-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
}

/* Main content layout */
.content-layout {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    margin-bottom: 4rem;
}

.example-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.example-header {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.bad-example .section-title {
    color: var(--accent-red);
}

.good-example .section-title {
    color: var(--accent-green);
}

/* Chat mockup styling - Discord/Slack style */
.chat-mockup {
    background: var(--chat-bg);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1rem;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 8px 25px -5px var(--shadow-light), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.chat-mockup:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -5px var(--shadow-medium), 0 6px 14px -2px rgba(0, 0, 0, 0.08);
}

.chat-message:hover {
    background-color: var(--chat-hover);
    border-radius: 4px;
    margin: 0.25rem -0.5rem;
    padding: 0.25rem 0.5rem;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.message-avatar.helper {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.message-meta {
    flex: 1;
    min-width: 0;
}

.message-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timestamp {
    font-size: 0.75rem;
    color: var(--text-quaternary);
    font-weight: 400;
}

.message-content {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Explanation content */
.explanation-content {
    color: var(--text-secondary);
}

.explanation-text {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.explanation-list {
    margin: 1rem 0 1rem 1.5rem;
    color: var(--text-tertiary);
}

.explanation-list li {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    font-style: italic;
}

.explanation-highlight {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin: 1.5rem 0 0 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 0;
    border-top: 1px solid var(--border-primary);
    margin-top: 3rem;
}

.footer-text {
    color: var(--text-tertiary);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.footer-text a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.footer-text a:hover {
    color: var(--text-secondary);
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 1024px) {
    .example-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .container {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .dark-mode-toggle {
        top: 1.5rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
    
    .hero {
        padding: 3rem 0 2rem;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .content-layout {
        gap: 3rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .chat-mockup {
        padding: 0.75rem;
    }
    
    .message-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .message-author {
        font-size: 0.9rem;
    }
    
    .message-content {
        font-size: 0.9rem;
    }
    
    .timestamp {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .dark-mode-toggle {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
    
    .toggle-icon {
        font-size: 1rem;
    }
    
    .hero {
        padding: 2rem 0 1.5rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .content-layout {
        gap: 2.5rem;
        margin-bottom: 3rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .explanation-text {
        font-size: 0.9rem;
    }
    
    .explanation-list {
        margin-left: 1rem;
    }
    
    .explanation-list li {
        font-size: 0.85rem;
    }
}

/* Smooth animations */
.chat-message {
    transition: background-color 0.15s ease;
}

.example-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.example-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .cursor {
        animation: none;
        opacity: 1;
    }
}