/* Modern Coffee Timer Styles */
:root {
    --timer-primary: #2c1810;
    --timer-secondary: #8b6f47;
    --timer-accent: #d4a574;
    --timer-success: #4ade80;
    --timer-warning: #f59e0b;
    --timer-danger: #ef4444;
    --timer-bg: #faf8f6;
    --timer-card-bg: #fff;
    --timer-text: #1f2937;
    --timer-text-muted: #6b7280;
    --timer-border: #e5e7eb;
    --timer-shadow: 0 4px 6px -1px rgb(0 0 0 / 10%), 0 2px 4px -1px rgb(0 0 0 / 6%);
    --timer-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -2px rgb(0 0 0 / 5%);
    --timer-radius: 16px;
    --timer-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --timer-bg: #0f0f0f;
        --timer-card-bg: #1a1a1a;
        --timer-text: #f9fafb;
        --timer-text-muted: #9ca3af;
        --timer-border: #374151;
    }
}

/* Base styles */
body {
    background-color: var(--timer-bg);
    color: var(--timer-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

/* Main container */
.coffee-app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Grid layout */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .card-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* Cards */
.coffee-timer-card,
.brewing-steps-card {
    background: var(--timer-card-bg);
    border-radius: var(--timer-radius);
    padding: 2rem;
    box-shadow: var(--timer-shadow);
    border: 1px solid var(--timer-border);
    transition: var(--timer-transition);
}

.coffee-timer-card:hover,
.brewing-steps-card:hover {
    box-shadow: var(--timer-shadow-lg);
}

/* Recipe selector */
.recipe-selector {
    margin-bottom: 2rem;
}

.coffee-recipe-selector {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    border-radius: 12px;
    border: 2px solid var(--timer-border);
    background-color: var(--timer-card-bg);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--timer-text);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    transition: var(--timer-transition);
    cursor: pointer;
}

.coffee-recipe-selector:hover {
    border-color: var(--timer-secondary);
}

.coffee-recipe-selector:focus {
    outline: none;
    border-color: var(--timer-primary);
    box-shadow: 0 0 0 3px rgb(44 24 16 / 10%);
}

/* Timer display */
.coffee-timer-display {
    width: 280px;
    height: 280px;
    margin: 2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Modern circular progress */
.timer-progress-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

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

.timer-progress-ring-progress {
    stroke: var(--timer-secondary);
    stroke-width: 8;
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.timer-progress-ring-progress.warning {
    stroke: var(--timer-warning);
}

.timer-progress-ring-progress.danger {
    stroke: var(--timer-danger);
}

/* Timer text */
.coffee-timer-text {
    font-size: 4rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    color: var(--timer-text);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.coffee-timer-text.completed {
    color: var(--timer-success);
    animation: pulse 2s ease-in-out infinite;
}

/* Step progress */
.step-progress-container {
    margin: 2rem 0;
}

.step-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.current-step-text {
    font-size: 0.875rem;
    color: var(--timer-text-muted);
    font-weight: 500;
}

.step-countdown {
    font-size: 0.875rem;
    color: var(--timer-text);
    font-weight: 600;
    background: var(--timer-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--timer-border);
}

.step-progress-bar {
    height: 6px;
    background-color: var(--timer-border);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.step-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--timer-secondary), var(--timer-accent));
    border-radius: 3px;
    transition: width 1s linear;
    position: relative;
}

.step-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50px;
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / 30%));
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-50px); }
    100% { transform: translateX(50px); }
}

/* Controls */
.coffee-timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.coffee-timer-btn {
    padding: 0.875rem 2rem;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--timer-transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    justify-content: center;
}

.coffee-timer-btn.start {
    background: linear-gradient(135deg, var(--timer-primary), var(--timer-secondary));
    color: white;
    box-shadow: 0 4px 14px 0 rgb(44 24 16 / 30%);
}

.coffee-timer-btn.start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgb(44 24 16 / 40%);
}

.coffee-timer-btn.pause {
    background: var(--timer-warning);
    color: white;
}

.coffee-timer-btn.reset {
    background: var(--timer-bg);
    color: var(--timer-text);
    border: 2px solid var(--timer-border);
}

.coffee-timer-btn.reset:hover {
    background: var(--timer-border);
}

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

.coffee-timer-btn:focus-visible {
    outline: 3px solid var(--timer-secondary);
    outline-offset: 2px;
}

/* Brewing steps */
.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1.5rem;
    color: var(--timer-text);
}

.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step-counter;
}

.step {
    position: relative;
    padding: 1rem 1rem 1rem 3rem;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    background: var(--timer-bg);
    border: 2px solid transparent;
    transition: var(--timer-transition);
    cursor: pointer;
    counter-increment: step-counter;
}

.step::before {
    content: counter(step-counter);
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: var(--timer-border);
    color: var(--timer-text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--timer-transition);
}

.step:hover {
    border-color: var(--timer-border);
    transform: translateX(4px);
}

.step.active {
    background: linear-gradient(135deg, var(--timer-primary), var(--timer-secondary));
    color: white;
    border-color: transparent;
    box-shadow: var(--timer-shadow);
}

.step.active::before {
    background: white;
    color: var(--timer-primary);
}

.step.completed {
    opacity: 0.6;
}

.step.completed::before {
    content: '✓';
    background: var(--timer-success);
    color: white;
}

/* Notification */
.coffee-notification {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 50%);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.coffee-notification-content {
    background: var(--timer-card-bg);
    border-radius: var(--timer-radius);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--timer-shadow-lg);
    animation: slideUp 0.3s ease;
}

.coffee-notification-content h3 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
    color: var(--timer-text);
}

.coffee-notification-content p {
    color: var(--timer-text-muted);
    margin: 0 0 1.5rem;
}

.coffee-notification-close {
    padding: 0.75rem 2rem;
    background: var(--timer-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--timer-transition);
}

.coffee-notification-close:hover {
    background: var(--timer-secondary);
}

/* Animations */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Responsive */
@media (max-width: 768px) {
    .coffee-timer-card,
    .brewing-steps-card {
        padding: 1.5rem;
    }
    
    .coffee-timer-display {
        width: 240px;
        height: 240px;
    }
    
    .coffee-timer-text {
        font-size: 3rem;
    }
    
    .coffee-timer-controls {
        flex-direction: column;
        width: 100%;
        max-width: 280px;
        margin: 2rem auto 0;
    }
    
    .coffee-timer-btn {
        width: 100%;
    }
    
    .card-grid {
        gap: 1rem;
    }
}

/* Back button styling */
.back-button-container {
    display: inline-block;
    margin-right: 1rem;
}

.btn {
    background: linear-gradient(135deg, var(--timer-primary), var(--timer-secondary));
    box-shadow: 0 4px 14px 0 rgb(44 24 16 / 30%);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgb(44 24 16 / 40%);
}