/*
Purpose: Styles for the interactive Vibe Coding playground page
Author: Assistant
Last Modified: 2025-01-27
*/

/* Root Variables */
:root {
    --playground-bg: #0a0a0a;
    --panel-bg: #1a1a1a;
    --panel-border: #333;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Base Styles */
body {
    background: var(--playground-bg);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Navigation Overrides for Dark Theme */
.navbar {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--panel-border);
}

.navbar .nav-logo span,
.navbar .nav-menu a {
    color: var(--text-primary) !important;
}

.navbar .nav-menu a:hover {
    color: var(--accent-primary) !important;
}

.navbar .cta-button {
    background: var(--gradient-primary) !important;
    color: white !important;
}

/* Hero Section */
.hero-playground {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-playground::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>') repeat;
    opacity: 0.3;
}

.hero-playground .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: left;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Hero Visual Elements */
.hero-visual {
    position: relative;
    z-index: 2;
}

.code-preview {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-dots {
    display: flex;
    gap: 6px;
}

.code-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f56;
}

.code-dots span:nth-child(2) {
    background: #ffbd2e;
}

.code-dots span:nth-child(3) {
    background: #27ca3f;
}

.code-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
}

.code-content {
    padding: 20px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.code-line {
    margin-bottom: 8px;
}

.code-indent {
    padding-left: 20px;
}

.code-comment {
    color: #6a9955;
}

.code-keyword {
    color: #569cd6;
}

.code-variable {
    color: #9cdcfe;
}

.code-function {
    color: #dcdcaa;
}

.code-string {
    color: #ce9178;
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
}

.btn-secondary:hover {
    background: var(--panel-bg);
    border-color: var(--accent-primary);
}

/* Playground Section */
.playground-section {
    min-height: calc(100vh - 200px);
    padding: 0;
    background: var(--playground-bg);
}

.playground-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: calc(100vh - 200px);
    max-height: 800px;
    min-height: 600px;
}

.playground-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
}

.input-panel {
    border-right: none;
}

.output-panel {
    border-left: none;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.02);
}

.panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

.panel-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Input Panel Styles */
#vibe-prompt {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: 'Inter', monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 1rem;
    resize: none;
    outline: none;
    transition: var(--transition);
}

#vibe-prompt:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

#vibe-prompt::placeholder {
    color: var(--text-muted);
}

.input-hints {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--panel-border);
}

.input-hints p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.hint-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hint-tag {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.hint-tag:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

/* Output Panel Styles */
#vibe-output {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.4;
    padding: 1rem;
    margin: 0;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-status {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--panel-border);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.status-indicator.generating {
    color: var(--warning-color);
}

.status-indicator.success {
    color: var(--success-color);
}

.status-indicator.error {
    color: var(--error-color);
}

/* Button Styles */
.btn-generate, .btn-clear, .btn-copy, .btn-download {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-generate {
    background: var(--gradient-primary);
    color: white;
}

.btn-generate:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-clear {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-clear:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-copy, .btn-download {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--panel-border);
}

.btn-copy:hover, .btn-download:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Tools Library Section */
.tools-library-section {
    padding: 80px 0;
    background: var(--playground-bg);
    border-bottom: 1px solid var(--panel-border);
    position: relative;
    z-index: 1;
}

.tools-library-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 700;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.tool-card {
    background: var(--panel-bg);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--panel-border);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tool-card:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s ease;
}

.tool-card:hover::before {
    left: 100%;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.tool-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.5rem;
    color: white;
}

.tool-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.tool-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.9rem;
}

.tool-badge {
    display: inline-block;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.try-tool {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 0.9rem;
}

.try-tool:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.try-tool:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Use Cases Section */
.use-cases-section {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--playground-bg) 0%, #111 100%);
}

.use-cases-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 700;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.use-case-tile {
    background: var(--panel-bg);
    border-radius: 16px;
    padding: 2rem;
    text-align: left;
    transition: var(--transition);
    border: 1px solid var(--panel-border);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.use-case-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s ease;
}

.use-case-tile:hover::before {
    left: 100%;
}

.use-case-tile:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.use-case-tile h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.user-prompt {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    border-left: 3px solid var(--accent-primary);
    padding-left: 12px;
}

.output-snippet {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.output-snippet code {
    color: #e0e7ff;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: pre-wrap;
    display: block;
}

.rebuild {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    align-self: flex-start;
}

.rebuild:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.rebuild:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Footer Dark Theme */
.footer {
    background: #000;
    border-top: 1px solid var(--panel-border);
}

.footer h3,
.footer p,
.footer a {
    color: var(--text-primary) !important;
}

.footer a:hover {
    color: var(--accent-primary) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-playground .container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .playground-section {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .playground-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        height: auto;
        min-height: auto;
        gap: 1rem;
        margin-bottom: 3rem;
    }
    
    .input-panel {
        border-right: 1px solid var(--panel-border);
        border-bottom: none;
        min-height: 300px;
    }
    
    .output-panel {
        border-left: 1px solid var(--panel-border);
        border-top: none;
        min-height: 400px;
        display: flex;
        flex-direction: column;
    }
    
    .panel-content {
        padding: 1rem;
        flex: 1;
        min-height: 200px;
        overflow-y: auto;
    }
    
    .tools-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 1.5rem;
        padding: 0 1rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .tools-grid::-webkit-scrollbar {
        display: none;
    }
    
    .tool-card {
        min-width: 280px;
        scroll-snap-align: start;
        flex-shrink: 0;
    }
    
    .use-cases-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        padding: 0 1rem;
    }
    
    .panel-actions {
        flex-wrap: wrap;
    }
    
    .btn-generate, .btn-clear, .btn-copy, .btn-download {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .hero-playground {
        padding: 80px 0 40px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .playground-container {
        min-height: auto;
        margin-bottom: 3rem;
    }
    
    .tools-library-section {
        padding: 60px 0;
        margin-top: 2rem;
    }
    
    .panel-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .panel-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .tools-grid {
        padding: 0 1rem;
    }
    
    .use-cases-grid {
        padding: 0 1rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Syntax Highlighting for JSON */
.json-key {
    color: #79c0ff;
}

.json-string {
    color: #a5d6ff;
}

.json-number {
    color: #79c0ff;
}

.json-boolean {
    color: #ff7b72;
}

.json-null {
    color: #8b949e;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles */
button:focus,
textarea:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --panel-border: #666;
        --text-secondary: #ccc;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}