/* Base styles */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

/* Dark mode transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Theme-specific styles */
.light {
    background-color: #f0f4f8;
    color: #1a202c;
}

.dark {
    background-color: #121212;
    color: #e2e8f0;
}

.dark .tool-section {
    background-color: #1E1E1E;
}

.dark select,
.dark input[type="text"] {
    background-color: #2D2D2D;
    border-color: #3D3D3D;
    color: #e2e8f0;
}

.dark select:focus,
.dark input[type="text"]:focus {
    border-color: #4299e1;
    background-color: #3D3D3D;
}

.dark .alarm-preset-btn {
    color: #63b3ed;
    border-color: #2D2D2D;
}

.dark .alarm-preset-btn:hover {
    background-color: #2D2D2D;
}

.dark .alarm-preset-btn.active {
    background-color: #2D2D2D;
    border-color: #4299e1;
    color: #4299e1;
}

.dark .tab-button {
    background-color: #2D2D2D;
}

.dark .tab-button:hover {
    background-color: #3D3D3D;
}

.dark .tab-button.active {
    background-color: #4299e1;
}

.dark #alarmCurrentTime {
    color: #4299e1;
}

.dark .border-gray-100 {
    border-color: #2D2D2D;
}

.dark .text-gray-500 {
    color: #9CA3AF;
}

.dark .text-gray-600 {
    color: #D1D5DB;
}

.dark .text-gray-700 {
    color: #E5E7EB;
}

.dark .text-gray-800 {
    color: #F3F4F6;
}

.dark .bg-gray-50 {
    background-color: #2D2D2D;
}

.dark .divide-gray-50 > * + * {
    border-color: #2D2D2D;
}

.dark .notification-bar {
    background-color: #2D2D2D;
    color: #E5E7EB;
}

/* Tab styles */
.tab-button { 
    transition: background-color 0.3s, color 0.3s; 
}

.tab-button.active { 
    background-color: #2563eb; 
    color: white; 
}

/* Section styles */
.tool-section { 
    display: none; 
}

.tool-section.active { 
    display: block; 
}

.time-input { 
    width: 60px; 
    text-align: center; 
}

/* Animation styles */
.alarm-ringing { 
    animation: pulse 1s infinite; 
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Notification styles */
.notification-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #10b981;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
}

/* Fullscreen mode styles */
.fullscreen-mode .hide-in-fullscreen {
    display: none !important;
}

.fullscreen-mode {
    --fs-bg-color: var(--bg-color, #ffffff);
    --fs-text-primary: var(--text-primary, #1a202c);
    --fs-text-secondary: var(--text-secondary, #4a5568);
}

.fullscreen-mode #alarm {
    padding: 0;
    margin: 0;
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--fs-bg-color);
    z-index: 9000;
    overflow: hidden;
}

.fullscreen-mode .max-w-2xl {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.fullscreen-mode .clock-display-container {
    text-align: center;
    padding: 2rem;
    width: 100%;
}

.fullscreen-mode #alarmCurrentTime {
    font-size: clamp(4rem, 15vw, 12rem) !important;
    line-height: 1 !important;
    font-weight: 800;
    letter-spacing: -0.05em;
    text-align: center;
    margin: 0;
    padding: 0;
}

.fullscreen-mode .alarm-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

.fullscreen-mode #currentDate {
    font-size: clamp(1rem, 3vw, 2rem);
    margin-bottom: 1rem;
    text-align: center;
}

.fullscreen-mode .active-alarm-info {
    position: fixed;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    text-align: center;
    z-index: 9001;
}

.fullscreen-mode .active-alarm-time {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 600;
}

.fullscreen-mode .alarm-countdown {
    font-size: clamp(1rem, 3vw, 2rem);
    font-family: monospace;
}

.fullscreen-mode .esc-hint {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: clamp(0.875rem, 2vw, 1.125rem);
    font-weight: 500;
    z-index: 9002;
    white-space: nowrap;
}

.fullscreen-mode .hide-in-fullscreen,
.fullscreen-mode .alarm-history,
.fullscreen-mode .alarm-controls,
.fullscreen-mode .alarm-form,
.fullscreen-mode #exportAlarmData,
.fullscreen-mode #clearAlarmData {
    display: none !important;
}

/* Media queries */
@media (max-height: 500px) {
    .fullscreen-mode #alarmCurrentTime {
        font-size: clamp(3rem, 12vh, 8rem) !important;
    }
    
    .fullscreen-mode .alarm-title {
        font-size: clamp(1rem, 3vh, 1.5rem);
    }
    
    .fullscreen-mode #currentDate {
        font-size: clamp(0.875rem, 2.5vh, 1.25rem);
        margin-bottom: 0.5rem;
    }
    
    .fullscreen-mode .active-alarm-info {
        bottom: 8rem;
    }
    
    .fullscreen-mode .active-alarm-time {
        font-size: clamp(1rem, 3vh, 1.5rem);
    }
    
    .fullscreen-mode .alarm-countdown {
        font-size: clamp(0.875rem, 2.5vh, 1.25rem);
    }
}

/* Regular display styles */
#alarmCurrentTime {
    font-size: 8rem !important;
    line-height: 1 !important;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 1rem;
}

.clock-display-container {
    text-align: center;
    padding: 1rem 0;
}

/* Fullscreen mode enhancements */
.fullscreen-mode .clock-display-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9001;
    background-color: var(--fs-bg-color);
    padding: 2rem;
}

.fullscreen-mode .active-alarm-info {
    position: fixed;
    bottom: 8rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 9001;
    text-align: center;
    font-size: 1.5rem;
    color: var(--fs-text-secondary);
}

.fullscreen-mode .active-alarm-time {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--fs-text-primary);
}

.fullscreen-mode .alarm-countdown {
    font-size: 2rem;
    color: var(--fs-text-secondary);
    font-family: monospace;
}

/* Responsive styles */
@media (max-width: 768px) {
    .fullscreen-mode .active-alarm-info {
        bottom: 3rem;
        font-size: 1.25rem;
    }
    
    .fullscreen-mode .active-alarm-time {
        font-size: 2rem;
    }
    
    .fullscreen-mode .alarm-countdown {
        font-size: 1.5rem;
    }
}

@media (max-width: 1200px) {
    #alarmCurrentTime {
        font-size: 6rem !important;
    }
    
    .fullscreen-mode #alarmCurrentTime {
        font-size: 12rem !important;
    }
}

@media (max-width: 768px) {
    #alarmCurrentTime {
        font-size: 5rem !important;
    }
    
    .fullscreen-mode #alarmCurrentTime {
        font-size: 8rem !important;
    }
}

@media (max-width: 480px) {
    #alarmCurrentTime {
        font-size: 4rem !important;
    }
    
    .fullscreen-mode #alarmCurrentTime {
        font-size: 6rem !important;
    }
}

/* Clock display container updates */
.clock-display-container {
    text-align: center;
}

.alarm-title {
    font-size: 2.5rem !important;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

#currentDate {
    font-size: 1.75rem !important;
    margin-bottom: 1rem;
    text-align: center;
}

/* Fullscreen mode title and date styles */
.fullscreen-mode .alarm-title {
    font-size: clamp(2rem, 5vw, 3.5rem) !important;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

.fullscreen-mode #currentDate {
    font-size: clamp(1.5rem, 4vw, 2.5rem) !important;
    margin-bottom: 1rem;
    text-align: center;
}
