/* CSS Variables, Resets, Utility Classes, Theme Definitions */

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

:root {
    --bg-color: #ffffff;
    --bg-color-rgb: 255, 255, 255;
    --text-color: #333333;
    --text-color-rgb: 51, 51, 51;
    --border-color: #d0d0d0;
    --border-color-secondary: #e8e8e8;
    --input-bg: #ffffff;
    --button-bg: #f5f5f5;
    --button-hover: #e8e8e8;
    --shadow: rgba(0, 0, 0, 0.1);
    --notes-width: 50%;
    --checklist-width: 35%;
    --calculator-width: 15%;
    --notes-flex: 5;
    --checklist-flex: 3.5;
    --calculator-flex: 1.5;
    /* 8px-based spacing scale */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 40px;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --bg-color-rgb: 26, 26, 26;
    --text-color: #e0e0e0;
    --text-color-rgb: 224, 224, 224;
    --border-color: #404040;
    --border-color-secondary: #2a2a2a;
    --input-bg: #2d2d2d;
    --button-bg: #333333;
    --button-hover: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* CSS Utility Classes */
.border-std { border: 1px solid var(--border-color); }
.radius-sm { border-radius: 4px; }
.radius-md { border-radius: 6px; }
.radius-lg { border-radius: 8px; }
.transition-fast { transition: all 0.15s ease; }
.transition-std { transition: all 0.2s ease; }
.transition-slow { transition: all 0.3s ease; }

/* Enhanced Focus Indicators for Keyboard Navigation */
*:focus {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Specific focus styles for main interactive elements */
#notesTextarea:focus,
#checklistInput:focus,
#calculatorDisplay:focus,
#timerDisplay:focus {
    outline: 2px solid #007AFF;
    outline-offset: 1px;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Focus for buttons and interactive elements */
.calc-btn:focus,
.timer-btn:focus,
.mode-btn:focus,
.delete-btn:focus {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
    z-index: 1;
}

/* Focus for checklist items */
.checklist-item:focus {
    outline: 2px solid #007AFF;
    outline-offset: -2px;
    background-color: rgba(0, 122, 255, 0.05);
    z-index: 1;
    position: relative;
    transform: none !important; /* Override hover transform when focused */
}

.checklist-item:focus-within {
    outline: 2px solid #007AFF;
    outline-offset: -2px;
    background-color: rgba(0, 122, 255, 0.05);
    z-index: 1;
    position: relative;
    transform: none !important; /* Override hover transform when focused */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

html {
    height: 100%;
}