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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary-color: #8b5cf6;
    --secondary-dark: #7c3aed;
    --accent-color: #f59e0b;
    --accent-dark: #d97706;
    --success-color: #10b981;
    --success-dark: #059669;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --warning-color: #f59e0b;
    --warning-dark: #d97706;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --text-muted: #d1d5db;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-accent: #f8fafc;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
}

/* Dark theme overrides */
[data-theme="dark"] {
    --text-primary: #e5e7eb;
    --text-secondary: #cbd5e1;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    --bg-primary: #0f172a; /* slate-900 */
    --bg-secondary: #111827; /* gray-900 */
    --bg-tertiary: #1f2937; /* gray-800 */
    --bg-accent: #0b1220;
    --border-color: #243041;
    --border-light: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 6px 10px -2px rgba(0, 0, 0, 0.6), 0 3px 6px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 14px 20px -4px rgba(0, 0, 0, 0.6), 0 6px 8px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 24px 28px -6px rgba(0, 0, 0, 0.6), 0 12px 12px -6px rgba(0, 0, 0, 0.5);
}

/* Elements that need explicit color/background adjustments in dark */
[data-theme="dark"] .navbar {
    background-color: var(--bg-secondary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .nav-link {
    color: var(--text-secondary);
}
[data-theme="dark"] .nav-link:hover {
    background: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .page-tabs {
    background-color: var(--bg-tertiary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .tab-content {
    background-color: var(--bg-secondary);
}

[data-theme="dark"] .tab-column section,
[data-theme="dark"] .time-display,
[data-theme="dark"] .alarm-form,
[data-theme="dark"] .ad-banner,
[data-theme="dark"] .info-card,
[data-theme="dark"] .action-btn,
[data-theme="dark"] .active-alarms-list {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .mobile-bottom-nav {
    background-color: var(--bg-secondary);
    border-top-color: var(--border-color);
}

[data-theme="dark"] .nav-toggle span {
    background-color: var(--text-primary);
}

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-weight: 400;
    letter-spacing: -0.01em;
}

html, body {
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 600; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Navigation */
.navbar {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-logo h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0;
}

.nav-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-top: -0.25rem;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: none;
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-1px);
}

.nav-link.active {
    color: white;
    background-color: var(--primary-color);
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.25);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

.nav-toggle:hover {
    background-color: var(--bg-secondary);
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Simple hamburger active state */
.nav-toggle.active span:nth-child(1) {
    background-color: var(--primary-color);
}

.nav-toggle.active span:nth-child(2) {
    background-color: var(--primary-color);
}

.nav-toggle.active span:nth-child(3) {
    background-color: var(--primary-color);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Time Display */
.time-display {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 2rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.time-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary-color);
}

/* Time Format Toggle */
.time-format-toggle {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.format-btn {
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.format-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.format-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.25);
}

.format-btn .format-icon {
    font-size: 1.1rem;
}

.format-btn .format-label {
    font-size: 0.85rem;
}

.current-time {
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(99, 102, 241, 0.1);
}

.current-date {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Active Alarms Quick Section */
.active-alarms-quick {
    margin-bottom: 2rem;
}

.active-alarms-quick h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.active-alarms-list {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1rem;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.no-alarms-message {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
    padding: 1rem 0;
}

.active-alarm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.active-alarm-time {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

.active-alarm-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.active-alarm-actions {
    display: flex;
    gap: 0.5rem;
}

.active-alarm-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-height: auto;
}

/* Voice Section */
.voice-section {
    text-align: center;
    margin-bottom: 3rem;
}

/* Quick Alarms */
.quick-alarms {
    margin-bottom: 3rem;
}

.quick-alarms h3 {
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-align: center;
    font-size: 1.5rem;
}

.alarm-section {
    margin-bottom: 2.5rem;
}

.alarm-section h4 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    padding: 0.5rem 1rem;
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.quick-alarm-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 100%;
    margin: 0 auto;
}

.quick-alarm-btn {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-light);
    padding: 1.25rem 0.75rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--text-primary);
    min-height: 70px;
    justify-content: center;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.quick-alarm-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px 0 rgba(99, 102, 241, 0.25);
}

.quick-alarm-btn.active {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.25);
    position: relative;
}

.quick-alarm-btn.active::after {
    content: '✓';
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.quick-alarm-btn.morning {
    background-color: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.quick-alarm-btn.morning:hover {
    background-color: #f59e0b;
    border-color: #d97706;
    color: white;
}

.quick-alarm-btn.nap {
    background-color: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

.quick-alarm-btn.nap:hover {
    background-color: #3b82f6;
    border-color: #2563eb;
    color: white;
}

.quick-alarm-btn.workout {
    background-color: #dcfce7;
    border-color: #10b981;
    color: #065f46;
}

.quick-alarm-btn.workout:hover {
    background-color: #10b981;
    border-color: #059669;
    color: white;
}

.quick-alarm-btn.study {
    background-color: #f3e8ff;
    border-color: #8b5cf6;
    color: #5b21b6;
}

.quick-alarm-btn.study:hover {
    background-color: #8b5cf6;
    border-color: #7c3aed;
    color: white;
}

.quick-time {
    font-size: 1.1rem;
    font-weight: 700;
    color: inherit;
}

.quick-label {
    font-size: 0.75rem;
    color: inherit;
    opacity: 0.8;
    font-weight: 500;
}

.voice-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.25);
    position: relative;
    overflow: hidden;
}

.voice-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: none;
    transition: left 0.5s;
}

.voice-btn:hover::before {
    left: 100%;
}

.voice-btn:hover {
    background-color: var(--accent-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px 0 rgba(245, 158, 11, 0.35);
}

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

.voice-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.voice-status.success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.voice-status.error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Alarm Controls */
.alarm-controls {
    margin-bottom: 3rem;
}

.alarm-form {
    background-color: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.time-input,
.category-select,
.sound-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    appearance: none;
    transition: border-color 0.2s ease;
}

.time-input:focus,
.category-select:focus,
.sound-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Improve visibility of time input in dark mode */
[data-theme="dark"] .time-input {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Ensure time fields are legible across browsers */
.time-input::-webkit-datetime-edit-fields-wrapper { color: var(--text-primary); }
.time-input::-webkit-datetime-edit { color: var(--text-primary); }
.time-input::-webkit-datetime-edit-hour-field { color: var(--text-primary); }
.time-input::-webkit-datetime-edit-minute-field { color: var(--text-primary); }
.time-input::-webkit-calendar-picker-indicator { filter: invert(0.8); opacity: 0.8; }
.time-input::-ms-clear { display: none; }
.time-input::-moz-focus-inner { border: 0; }

.day-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.day-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.day-checkbox input[type="checkbox"] {
    display: none;
}

.day-checkbox span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.day-checkbox input[type="checkbox"]:checked + span {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.day-checkbox:hover span {
    border-color: var(--primary-color);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
    font-style: italic;
}

/* Buttons */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: none;
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(139, 92, 246, 0.25);
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(139, 92, 246, 0.35);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background-color: var(--danger-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(239, 68, 68, 0.35);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    background-color: var(--success-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(16, 185, 129, 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(99, 102, 241, 0.25);
}

/* Active Alarms */
.active-alarms {
    margin-bottom: 3rem;
}

.active-alarms h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.alarms-list {
    display: grid;
    gap: 1rem;
}

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

.alarm-info {
    flex: 1;
}

.alarm-time {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.alarm-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.alarm-actions {
    display: flex;
    gap: 0.5rem;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 3rem;
}

.quick-actions h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-btn {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.action-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn svg {
    width: 32px;
    height: 32px;
    fill: var(--primary-color);
}

/* AdSense Section */
.adsense-section {
    margin-bottom: 3rem;
}

.ad-banner {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
}

.ad-placeholder {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        position: relative;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        flex-direction: column;
        padding: 1rem;
        z-index: 1001;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-color);
        text-align: center;
        font-size: 1.1rem;
    }
    
    .nav-links .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .current-time {
        font-size: 3rem;
    }
    
    .time-format-toggle {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .format-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .alarm-form {
        padding: 1.5rem;
    }
    
    .day-selector {
        justify-content: center;
    }
    
    .quick-alarm-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .quick-alarm-btn {
        padding: 1rem 0.75rem;
        min-height: 65px;
        font-size: 0.9rem;
    }
    
    .alarm-section {
        margin-bottom: 2rem;
    }
    
    .alarm-section h4 {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .quick-time {
        font-size: 1rem;
    }
    
    .quick-label {
        font-size: 0.7rem;
    }
    
    .time-display {
        padding: 2rem 1rem;
    }
    
    .current-time {
        font-size: 3.5rem;
    }
    
    .current-date {
        font-size: 1.1rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Home page responsive adjustments */
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .tools-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .tool-card {
        padding: 2rem 1.5rem;
        width: 100% !important;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Tab columns responsive */
    .tab-columns {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .tab-column {
        width: 100% !important;
    }
    
    .tab-column section {
        padding: 1rem;
    }
    
    .tab-column h3 {
        font-size: 1.1rem;
    }
    
    .info-card {
        padding: 0.75rem;
    }
    
    .info-card h4 {
        font-size: 0.9rem;
    }
    
    .info-card p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .current-time {
        font-size: 2.5rem;
    }
    
    .voice-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .alarm-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .alarm-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .nav-toggle {
        padding: 0.75rem;
    }
    
    .nav-toggle span {
        width: 28px;
        height: 4px;
    }
    
    .nav-links {
        padding: 1.5rem 1rem;
    }
    
    .nav-links .nav-link {
        padding: 1rem 0;
        font-size: 1.2rem;
    }
    
    /* Adjust main content padding for tabs */
    .main-content {
        padding-top: 0.5rem;
    }
    
    /* Additional mobile optimizations for very small screens */
    .quick-alarm-buttons {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .quick-alarm-btn {
        padding: 0.875rem 0.5rem;
        min-height: 60px;
        font-size: 0.85rem;
    }
    
    .quick-time {
        font-size: 0.95rem;
    }
    
    .quick-label {
        font-size: 0.65rem;
    }
    
    .alarm-section h4 {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .time-display {
        padding: 1.5rem 0.75rem;
    }
    
    .current-time {
        font-size: 3rem;
    }
    
    .current-date {
        font-size: 1rem;
    }
    
    .tab-column section {
        padding: 0.75rem;
    }
    
    .alarm-form {
        padding: 1rem;
    }
}

/* Additional mobile breakpoint for smaller screens */
@media (max-width: 1024px) {
    .tab-columns {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0rem !important;
    }
    
    .tab-column {
        width: 100% !important;
    }
    
    /* Home page tools grid - single column on tablets */
    .tools-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .tool-card {
        width: 100% !important;
    }
}

/* Page Tabs - Unified Design */
.page-tabs {
    display: flex;
    position: sticky;
    top: 0;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    margin: 0 -1rem 1rem -1rem;
    padding: 0 1rem;
    z-index: 100;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    box-shadow: var(--shadow-sm);
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom));
    height: calc(64px + constant(safe-area-inset-bottom));
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: none;
    align-items: center;
    justify-content: space-around;
    z-index: 2000;
    padding-bottom: env(safe-area-inset-bottom);
    padding-bottom: constant(safe-area-inset-bottom);
}

.mobile-bottom-nav .mobile-nav-item {
    flex: 1;
    text-decoration: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 100%;
}

.mobile-bottom-nav .mobile-nav-item .nav-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.mobile-bottom-nav .mobile-nav-item .nav-label {
    font-size: 0.7rem;
}

.mobile-bottom-nav .mobile-nav-item.active {
    color: var(--primary-color);
}

/* Show bottom nav on small screens and add page bottom padding */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: calc(68px + env(safe-area-inset-bottom));
        padding-bottom: calc(68px + constant(safe-area-inset-bottom));
    }
}

/* Responsive tab adjustments */
@media (max-width: 768px) {
    .page-tabs {
        margin: 0 -1rem 1rem -1rem;
        padding: 0 1rem;
    }
    
    .tab-btn {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .tab-btn .tab-icon {
        font-size: 1rem;
    }
    
    .tab-btn .tab-label {
        font-size: 0.7rem;
    }
    
    /* Ensure tab columns stack on mobile */
    .tab-columns {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .tab-column {
        width: 100% !important;
    }
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 0.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn .tab-icon {
    font-size: 1.2rem;
}

.tab-btn .tab-label {
    font-size: 0.8rem;
}

.tab-content {
    position: relative;
    background-color: var(--bg-primary);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-sm);
    min-height: 400px;
}

.tab-pane {
    display: none;
    padding: 1.5rem;
}

.tab-pane.active {
    display: block;
}

/* Tab Columns Layout */
.tab-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.tab-column {
    display: flex;
    flex-direction: column;
    gap: 0rem;
}

.tab-column section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.tab-column h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.info-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.info-card h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.info-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mt-4 { margin-top: 1.5rem; }

.hidden { display: none; }
.visible { display: block; }

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

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

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

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

/* Home Page Styles */
.hero-section {
    text-align: center;
    padding: 5rem 3rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--radius-xl);
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: white;
    font-weight: 800;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-size: 1.375rem;
    opacity: 0.95;
    margin-bottom: 0;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Home header time/date (compact) */
.home-hero-time {
    padding: 1rem 0 1.5rem 0;
    text-align: center;
}
.home-time-wrap { display: inline-flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.home-time { font-size: 2rem; font-weight: 800; letter-spacing: 0.02em; color: var(--primary-color); font-family: 'Courier New', monospace; }
.home-date { font-size: 0.95rem; color: var(--text-secondary); }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.tool-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-light);
}

.tool-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.tool-card h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.tool-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.25);
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
}

.tool-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: none;
    transition: left 0.5s;
}

.tool-btn:hover::before {
    left: 100%;
}

.tool-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px 0 rgba(99, 102, 241, 0.35);
}

/* Tool card themes */
.alarm-card:hover {
    border-color: var(--accent-color);
}

.timer-card:hover {
    border-color: var(--success-color);
}

.stopwatch-card:hover {
    border-color: var(--primary-color);
}

.global-card:hover {
    border-color: var(--secondary-color);
}

.features-section {
    text-align: center;
    margin-bottom: 4rem;
}

.features-section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    padding: 2rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-item h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.feature-item p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Print Styles */
@media print {
    .navbar,
    .voice-section,
    .alarm-controls,
    .quick-actions,
    .adsense-section,
    .footer {
        display: none;
    }
    
    .time-display {
        border: none;
        background: none;
    }
}

