/* Smart Microwave UI - Modern Dark Theme */

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

:root {
    --bg-primary: #0f1115;
    --bg-secondary: #151821;
    --bg-tertiary: #1e2329;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #6b7280;
    --accent-primary: #3b82f6;
    --accent-secondary: #10b981;
    --accent-danger: #ef4444;
    --accent-warning: #f59e0b;
    --border-color: #374151;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s ease-in-out;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f1115 0%, #1a1d23 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.microwave-container {
    width: 100%;
    max-width: 640px;
    min-height: 600px;
}

.microwave-frame {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clock {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.status-indicators {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Main Content */
.main-content {
    padding: 30px;
    min-height: 400px;
}

.screen {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
    display: block;
}

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

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.action-btn {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 25px 20px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: 100px;
    justify-content: center;
}

.action-btn:hover {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #2563eb 100%);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn .icon {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

/* Quantity Selector */
.quantity-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.quantity-btn {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    min-height: 60px;
}

.quantity-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.quantity-btn.selected {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow);
}

.custom-quantity {
    margin: 20px 0;
    text-align: center;
}

.custom-quantity input {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 15px;
    color: var(--text-primary);
    font-size: 1.2rem;
    text-align: center;
    width: 200px;
}

.custom-quantity input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Food Grid */
.food-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.food-btn {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: 80px;
    justify-content: center;
}

.food-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.food-btn.selected {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow);
}

.food-btn .icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Preview Card */
.preview-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 25px;
    margin: 20px 0;
}

.preview-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.food-info {
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.food-type {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.food-quantity {
    font-size: 1rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 5px;
}

.time-controls, .power-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.time-controls label, .power-controls label {
    font-weight: 600;
    color: var(--text-primary);
}

.time-input {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.time-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px 15px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

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

#preview-time {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 15px;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    width: 120px;
    font-variant-numeric: tabular-nums;
}

.power-slider {
    display: flex;
    align-items: center;
    gap: 15px;
}

#power-slider {
    flex: 1;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

#power-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
}

#power-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.power-value {
    font-weight: 700;
    color: var(--text-primary);
    min-width: 40px;
    text-align: center;
}

/* Keypad */
.keypad {
    background: var(--bg-tertiary);
    padding: 25px;
    border-top: 1px solid var(--border-color);
}

.time-display {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-variant-numeric: tabular-nums;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.key-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.key-btn:active {
    transform: translateY(0);
}

.key-btn.start-btn {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, #059669 100%);
    border-color: var(--accent-secondary);
    color: white;
}

.key-btn.stop-btn {
    background: linear-gradient(135deg, var(--accent-danger) 0%, #dc2626 100%);
    border-color: var(--accent-danger);
    color: white;
}

/* Bottom Controls */
.bottom-controls {
    background: var(--bg-tertiary);
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.control-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 15px 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-height: 80px;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.control-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.control-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.control-btn .icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

.nav-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 15px 30px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    font-weight: 600;
    min-width: 100px;
}

.nav-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.nav-btn.back-btn {
    background: var(--bg-tertiary);
}

.nav-btn.next-btn, .nav-btn.start-btn {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #2563eb 100%);
    border-color: var(--accent-primary);
    color: white;
}

.nav-btn.favorite-btn {
    background: linear-gradient(135deg, var(--accent-warning) 0%, #d97706 100%);
    border-color: var(--accent-warning);
    color: white;
}

/* Running Screen */
.timer-display {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.progress-ring {
    position: relative;
    width: 200px;
    height: 200px;
}

.progress-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 8;
}

.progress-fill {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease-in-out;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.running-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

/* Recipes */
.recipes-list, .favorites-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.recipe-card, .favorite-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.recipe-card:hover, .favorite-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.recipe-title, .favorite-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.recipe-summary, .favorite-summary {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.4;
}

.recipe-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.recipe-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 600;
}

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

.recipe-btn.use-btn {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, #059669 100%);
    border-color: var(--accent-secondary);
    color: white;
}

/* Settings */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin: 20px 0;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
}

.setting-item label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.toggle-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    min-width: 80px;
}

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

.toggle-btn.active {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: white;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 15px 20px;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
}

.toast.success {
    border-color: var(--accent-secondary);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(16, 185, 129, 0.1) 100%);
}

.toast.error {
    border-color: var(--accent-danger);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(239, 68, 68, 0.1) 100%);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .microwave-container {
        max-width: 100%;
        padding: 10px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .food-grid {
        grid-template-columns: 1fr;
    }
    
    .quantity-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .keypad-grid {
        gap: 10px;
    }
    
    .key-btn {
        padding: 15px;
        font-size: 1.2rem;
    }
    
    .bottom-controls {
        flex-wrap: wrap;
    }
    
    .control-btn {
        min-width: 80px;
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .clock {
        font-size: 1.5rem;
    }
    
    .time-display {
        font-size: 2rem;
    }
    
    .timer-text {
        font-size: 2rem;
    }
    
    .progress-ring {
        width: 150px;
        height: 150px;
    }
    
    .nav-buttons {
        flex-direction: column;
    }
    
    .nav-btn {
        width: 100%;
    }
}

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

/* Focus states for keyboard navigation */
button:focus, input:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #ffffff;
        --text-secondary: #ffffff;
    }
}
