/**
 * Playground Grid Layout - v0.1.6 (Refactored)
 * Component-specific styles moved to individual CSS files
 * This file contains only: grid layout, header, mode visibility, shared utilities
 */

/* ========================================
   Header Layout
   ======================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    margin-bottom: 1.5rem;
    padding: 1.5rem 1rem 1rem 1rem;
    background: white;
    border-radius: 12px;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.header-left h1 {
    font-size: 2rem;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.subtitle {
    text-align: center;
    font-size: 1rem;
    color: #374151;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.version-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* Status Messages in Header */
.status-message {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.status-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.status-loading {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

/* ========================================
   Grid Layout
   ======================================== */

.container {
    max-width: none !important;
    padding: 0 1rem;
}

.playground-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    height: calc(100vh - 240px);
    min-height: 600px;
}

/* ========================================
   Column Base Styles
   ======================================== */

.column {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    overflow: hidden;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.column-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

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

.column-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========================================
   Mode Visibility System
   ======================================== */

.column-mode {
    display: none;
    flex: 1;
    overflow: hidden;
}

.column[data-mode="edit"] .column-mode-edit {
    display: flex;
    flex-direction: column;
}

.column[data-mode="view"] .column-mode-view {
    display: flex;
    flex-direction: column;
}

.column[data-mode="preview"] .column-mode-preview {
    display: flex;
    flex-direction: column;
}

/* ========================================
   Shared Utilities
   ======================================== */

/* Buttons */
.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

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

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    text-align: center;
    padding: 2rem;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state-text {
    font-size: 0.875rem;
}

/* Syntax Output */
.syntax-output {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ========================================
   Footer
   ======================================== */

.footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 1200px) {
    .playground-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
        min-height: 0;
    }

    .column {
        min-height: 400px;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
    }

    .status-message {
        width: 100%;
        text-align: center;
    }
}
