/* Main Application Styles */

:root {
    /* Color Palette */
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #06b6d4;
    
    /* Temperature Colors */
    --temp-cold: #0088ff;
    --temp-cool: #44aaff;
    --temp-warm: #ffaa00;
    --temp-hot: #ff4444;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Border Colors */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #94a3b8;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Typography */
    --font-family-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-family-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: var(--font-family-sans);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl) 0;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Main Content */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

/* Status Section */
.status-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

/* Thermometer Section */
.thermometer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.temperature-graph-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

.temperature-graph {
    width: 100%;
    height: 100%;
    opacity: 0.3;
}

.thermometer-container {
    margin-bottom: var(--spacing-lg);
    position: relative;
    z-index: 2;
}

.temperature-info {
    display: flex;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-lg);
}

.current-temp,
.average-temp {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    min-width: 100px;
}

.temp-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.temp-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-family-mono);
}

/* Controls Section */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.main-controls {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
}

.settings-toggle {
    display: flex;
    justify-content: center;
}

/* Buttons */
.primary-button,
.secondary-button,
.settings-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.primary-button {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    box-shadow: var(--shadow-md);
}

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

.primary-button:active {
    transform: translateY(0);
}

.primary-button.recording {
    background: linear-gradient(135deg, var(--error-color), var(--warning-color));
    animation: pulse 2s infinite;
}

.secondary-button {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.secondary-button:hover {
    background: var(--border-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.settings-button {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.settings-button:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.button-icon {
    font-size: 1.25rem;
}

/* Settings Panel */
.settings-panel {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
}

.settings-panel.hidden {
    display: none;
}

.settings-content h3 {
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
    font-weight: 600;
}

.setting-group {
    margin-bottom: var(--spacing-lg);
}

.setting-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.slider-container input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.1);
}

.slider-value {
    min-width: 80px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: var(--font-family-mono);
}

.setting-group input[type="checkbox"] {
    margin-right: var(--spacing-sm);
    scale: 1.2;
    accent-color: var(--primary-color);
}

/* Debug Panel */
.debug-panel {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    font-family: var(--font-family-mono);
    font-size: 0.875rem;
}

.debug-panel.hidden {
    display: none;
}

.debug-content h3 {
    margin-bottom: var(--spacing-lg);
    font-family: var(--font-family-sans);
    color: var(--text-primary);
    font-weight: 600;
}

.debug-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.debug-label {
    color: var(--text-secondary);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: var(--spacing-xl) 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: var(--spacing-2xl);
    border-top: 1px solid var(--border-light);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.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;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: var(--spacing-sm);
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .main-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .temperature-info {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .status-section {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .thermometer-section {
        padding: var(--spacing-lg);
    }
    
    .toast-container {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        left: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.75rem;
    }
    
    .app-subtitle {
        font-size: 1rem;
    }
    
    .primary-button,
    .secondary-button,
    .settings-button {
        padding: var(--spacing-md);
        width: 100%;
        justify-content: center;
    }
}