:root {
    /* Modern dark theme with vibrant accents */
    --bg-base: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-hover: #334155;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    --accent-primary: #6366f1; /* Indigo */
    --accent-primary-hover: #4f46e5;
    
    --accent-warning: #ef4444; /* Red for blockers */
    --accent-warning-light: rgba(239, 68, 68, 0.1);
    
    --accent-success: #10b981;
    
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 4px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(239, 68, 68, 0.1) 0px, transparent 50%);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

/* Typography elements */
.text-warning {
    color: var(--accent-warning);
}

/* Layout */
.app-container {
    display: flex;
    height: 100%;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    padding: 1rem;
    background-color: var(--bg-surface-hover);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.history-item:hover {
    border-color: var(--border-color);
    transform: translateY(-1px);
}

.history-item.active {
    border-color: var(--accent-primary);
    background-color: rgba(99, 102, 241, 0.1);
}

.history-item-date {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.history-item-preview {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Editor Area */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 1.5rem;
    gap: 1.5rem;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
}

.main-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.timer-widget {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1.25rem;
    font-weight: 600;
}

.editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Scrollbar */
.editor-content::-webkit-scrollbar {
    width: 8px;
}
.editor-content::-webkit-scrollbar-track {
    background: transparent;
}
.editor-content::-webkit-scrollbar-thumb {
    background: var(--bg-surface-hover);
    border-radius: 4px;
}

.section-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 200px;
    padding: 1.5rem;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.section-card:focus-within {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
    border-color: var(--accent-primary);
}

.section-card.border-warning:focus-within {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
    border-color: var(--accent-warning);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

textarea {
    flex: 1;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    outline: none;
    line-height: 1.6;
}

textarea::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.text-warning-focus:focus {
    color: #fca5a5;
}

.main-footer {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem;
}

.actions-right, .actions-left {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn:active {
    transform: scale(0.98);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

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

.btn-primary:hover {
    background-color: var(--accent-primary-hover);
}

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

.btn-secondary:hover {
    background-color: #475569;
}

.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background-color: var(--bg-surface-hover);
}

.btn-text {
    background-color: transparent;
    color: var(--accent-primary);
    padding: 0.25rem 0.5rem;
}

.btn-text:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-success);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .actions-right, .actions-left {
        width: 100%;
        justify-content: stretch;
    }
    
    .btn {
        flex: 1;
    }
}
