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

:root {
    /* Dark Theme Colors - Default */
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #06B6D4;
    --accent-color: #F59E0B;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --bg-card: #1E293B;
    
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #64748B;
    
    --border-color: #334155;
    --border-hover: #475569;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --transition: all 0.2s ease-in-out;
    --transition-slow: all 0.3s ease-in-out;
}

/* Base Typography */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: var(--transition-slow);
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    padding: 2rem 0;
    text-align: center;
    color: var(--text-primary);
    margin: 0 -1rem;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo-icon {
    width: 3rem;
    height: 3rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.tagline {
    font-size: 1.125rem;
    opacity: 0.9;
    margin: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 3rem 0;
}

/* Calculator Section */
.calculator-section {
    margin-bottom: 0;
}

.calculator-container {
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: var(--radius-lg);
}

.mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.mode-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.mode-btn:hover:not(.active) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.mode-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Calculator Forms */
.calculator-form {
    display: none;
}

.calculator-form.active {
    display: block;
}

.calculator-form h2 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    text-align: center;
}

.calculator-form h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.875rem;
    color: var(--text-primary);
    text-align: center;
}

/* Time Input Group */
.time-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.time-input {
    display: flex;
    flex-direction: column;
}

.time-input label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.time-input select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 14px;
    max-height: 120px;
    overflow-y: auto;
    scroll-behavior: smooth;
    transform-origin: center;
    will-change: transform, box-shadow;
}

.time-input select::-webkit-scrollbar {
    width: 8px;
}

.time-input select::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.time-input select::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.time-input select::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.time-input select option {
    padding: 8px 12px;
    background: white;
    color: #374151;
    border-radius: 6px;
    margin: 2px 0;
    transition: all 0.2s ease;
}

.time-input select option:hover {
    background: #f8fafc;
    color: #4f46e5;
}

.time-input select option:checked {
    background: #4f46e5;
    color: white;
    font-weight: 600;
}

.time-input select:hover {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgb(79 70 229 / 0.1);
}

.time-input select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgb(79 70 229 / 0.1);
}

/* Current Time Display */
.current-time {
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    padding: 0.875rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

#current-time-display {
    font-weight: 600;
    color: var(--primary-color);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    text-align: center;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

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

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

/* Results Section */
.results-section {
    margin-bottom: 4rem;
    opacity: 1;
    transform: translateY(0);
    transition: var(--transition-slow);
}

.results-section.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.results-container {
    max-width: 640px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.results-container h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    text-align: center;
}

.results-content {
    display: grid;
    gap: 1rem;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.result-item:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.result-time {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.result-cycles {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}







/* Footer */
.footer {
    margin-top: auto;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    margin: 0 -1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-content p {
    color: var(--text-secondary);
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .header {
        margin: 0 -0.5rem;
        padding: 1.5rem 0;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 2rem 0;
    }
    
    .calculator-container,
    .results-container {
        padding: 1.25rem;
        margin: 0 0.5rem;
    }
    
    .time-input-group {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .mode-toggle {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .mode-btn {
        padding: 1rem;
    }
    
    
    
    .footer {
        margin: 0 -0.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        gap: 1rem;
    }
    

}

@media (max-width: 480px) {
    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo h1 {
        font-size: 1.75rem;
    }
    
    .calculator-container,
    .results-container {
        padding: 0.875rem;
    }
    
    .result-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calculator-form.active {
    animation: fadeInUp 0.3s ease-out;
}

.result-item {
    animation: fadeInUp 0.3s ease-out;
}

.result-item:nth-child(2) {
    animation-delay: 0.1s;
}

.result-item:nth-child(3) {
    animation-delay: 0.2s;
}

.result-item:nth-child(4) {
    animation-delay: 0.3s;
}

.result-item:nth-child(5) {
    animation-delay: 0.4s;
}

.result-item:nth-child(6) {
    animation-delay: 0.5s;
}

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

/* Focus styles for better accessibility */
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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