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

:root {
    /* Golden Theme (Default) */
    --primary-color: #D4AF37;
    --secondary-color: #F4E4BC;
    --accent-color: #B8860B;
    --background-primary: #0F0F0F;
    --background-secondary: #1A1A1A;
    --text-primary: #FFFFFF;
    --text-secondary: #D4AF37;
    --glass-bg: rgba(212, 175, 55, 0.1);
    --glass-border: rgba(212, 175, 55, 0.2);
    --shadow-color: rgba(212, 175, 55, 0.3);
}

[data-theme="emerald"] {
    --primary-color: #50C878;
    --secondary-color: #98FB98;
    --accent-color: #228B22;
    --background-primary: #0A0F0A;
    --background-secondary: #1A1F1A;
    --text-primary: #FFFFFF;
    --text-secondary: #50C878;
    --glass-bg: rgba(80, 200, 120, 0.1);
    --glass-border: rgba(80, 200, 120, 0.2);
    --shadow-color: rgba(80, 200, 120, 0.3);
}

[data-theme="crimson"] {
    --primary-color: #DC143C;
    --secondary-color: #FFB6C1;
    --accent-color: #8B0000;
    --background-primary: #0F0A0A;
    --background-secondary: #1F1A1A;
    --text-primary: #FFFFFF;
    --text-secondary: #DC143C;
    --glass-bg: rgba(220, 20, 60, 0.1);
    --glass-border: rgba(220, 20, 60, 0.2);
    --shadow-color: rgba(220, 20, 60, 0.3);
}

[data-theme="sapphire"] {
    --primary-color: #0F52BA;
    --secondary-color: #87CEEB;
    --accent-color: #003366;
    --background-primary: #0A0A0F;
    --background-secondary: #1A1A1F;
    --text-primary: #FFFFFF;
    --text-secondary: #0F52BA;
    --glass-bg: rgba(15, 82, 186, 0.1);
    --glass-border: rgba(15, 82, 186, 0.2);
    --shadow-color: rgba(15, 82, 186, 0.3);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    transition: all 0.5s ease;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 10%;
    animation-delay: 5s;
}

.orb-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 50%;
    animation-delay: 10s;
}

.orb-4 {
    width: 100px;
    height: 100px;
    top: 30%;
    right: 30%;
    animation-delay: 15s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    33% { transform: translateY(-30px) translateX(20px); }
    66% { transform: translateY(20px) translateX(-10px); }
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px var(--shadow-color);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { filter: drop-shadow(0 0 10px var(--shadow-color)); }
    100% { filter: drop-shadow(0 0 20px var(--shadow-color)); }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Theme Selector */
.theme-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.theme-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-btn:hover,
.theme-btn.active {
    background: var(--primary-color);
    color: var(--background-primary);
    box-shadow: 0 0 20px var(--shadow-color);
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

/* Timer Setup */
.timer-setup {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.datetime-input,
.timer-name-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.datetime-input:focus,
.timer-name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--shadow-color);
}

/* Preset Buttons */
.preset-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.preset-btn {
    padding: 0.75rem;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

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

/* Start Button */
.start-btn {
    width: 100%;
    padding: 1.2rem;
    border: none;
    border-radius: 15px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    color: var(--background-primary);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--shadow-color);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.start-btn:hover .btn-shine {
    left: 100%;
}

/* Timer Display */
.timer-display {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.timer-name-display {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 500;
}

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

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-value {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 20px var(--shadow-color);
    animation: pulse 2s ease-in-out infinite;
    min-width: 60px;
}

.time-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.time-separator {
    font-size: 2rem;
    color: var(--primary-color);
    opacity: 0.7;
    animation: blink 1s infinite;
}

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

@keyframes blink {
    0%, 50% { opacity: 0.7; }
    51%, 100% { opacity: 0.3; }
}

/* Progress Ring */
.progress-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    opacity: 0.3;
}

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

.progress-ring-circle {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    animation: progress-ring 1s ease-in-out forwards;
}

@keyframes progress-ring {
    to { stroke-dashoffset: 0; }
}

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

.control-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    font-weight: 500;
}

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

/* Multiple Timers */
.multiple-timers {
    grid-column: 1 / -1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.timers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.mini-timer {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(5px);
    position: relative;
}

.mini-timer-name {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.mini-timer-time {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.mini-timer-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.mini-timer-remove:hover {
    color: var(--primary-color);
}

/* Completion Modal */
.completion-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.completion-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    backdrop-filter: blur(20px);
    animation: modalSlide 0.5s ease-out;
    min-width: 300px;
}

@keyframes modalSlide {
    0% { transform: translateY(-50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.modal-message {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.modal-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    color: var(--background-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--shadow-color);
}

/* Sound Controls */
.sound-controls {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.sound-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-btn:hover {
    background: var(--primary-color);
    color: var(--background-primary);
    transform: scale(1.1);
}

.sound-btn.muted {
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .time-units {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .time-value {
        font-size: 1.5rem;
    }
    
    .timer-controls {
        flex-wrap: wrap;
    }
    
    .theme-selector {
        flex-wrap: wrap;
    }
}

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

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(255, 255, 255, 0.1);
        --glass-border: rgba(255, 255, 255, 0.3);
    }
}

.developer-credit {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.8rem;
    font-family: 'Poppins', sans-serif;
    color: #e0e0e0;
    opacity: 0.75;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 100;
    transition: all 0.3s ease;
    letter-spacing: 0.4px;
}

.developer-credit:hover {
    opacity: 1;
    transform: translateY(-2px) scale(1.015);
    box-shadow: 0 6px 18px rgba(255, 193, 111, 0.35);
}

.explorer-signature {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 500;
    font-size: 0.8rem;
    color: #f3f3f3;
    letter-spacing: 0.5px;
}

.eccentric {
    font-weight: 700;
    font-family: 'Georgia', 'Times New Roman', serif;
    background: linear-gradient(90deg, #fcb045, #fd1d1d, #833ab4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    background-size: 200% auto;
    animation: shimmerText 4s ease infinite;
}