/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.2;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px 10px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 0 px;
    color: white;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: px;
}

.header-left {
    text-align: left;
}

.header-left h1 {
    font-family: 'Nunito', 'Poppins', 'Arial Rounded MT Bold', 'Helvetica Rounded', Arial, sans-serif;
    font-weight: 800;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-icon {
    width: 48px;
    height: 48px;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}


.header-left p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.header-right {
    display: flex;
    align-items: center;
}

/* Star Counter */
.star-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    font-weight: 600;
    font-size: 1.1rem;
}

.star-counter i {
    color: #ffd700;
    font-size: 1.2rem;
}

.star-counter span {
    color: white;
    font-weight: 700;
}

/* Responsive star counter for phones */
@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        margin-bottom: 15px;
    }
    
    .header-right {
        align-self: flex-end;
    }
}

/* Confetti Animation */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #ff6b6b;
    animation: confetti-fall 3s ease-in-out forwards;
    transform-origin: center center;
    opacity: 0.9;
}

.confetti-piece:nth-child(2n) {
    background: #4ecdc4;
    animation-delay: 0.1s;
}

.confetti-piece:nth-child(3n) {
    background: #45b7d1;
    animation-delay: 0.2s;
}

.confetti-piece:nth-child(4n) {
    background: #96ceb4;
    animation-delay: 0.3s;
}

.confetti-piece:nth-child(5n) {
    background: #feca57;
    animation-delay: 0.4s;
}

.confetti-piece:nth-child(6n) {
    background: #ff9ff3;
    animation-delay: 0.5s;
}

.confetti-piece:nth-child(7n) {
    background: #54a0ff;
    animation-delay: 0.6s;
}

.confetti-piece:nth-child(8n) {
    background: #5f27cd;
    animation-delay: 0.7s;
}

/* Different confetti shapes and sizes */
.confetti-piece:nth-child(3n) {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.confetti-piece:nth-child(5n) {
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

.confetti-piece:nth-child(7n) {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Star-shaped confetti */
.confetti-piece.star {
    width: 16px;
    height: 16px;
    background: transparent !important;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transform-origin: center center;
}

/* Multi-colored stars */
.confetti-piece.star:nth-child(2n) {
    color: #ff6b6b; /* Red */
}

.confetti-piece.star:nth-child(3n) {
    color: #4ecdc4; /* Teal */
}

.confetti-piece.star:nth-child(4n) {
    color: #45b7d1; /* Blue */
}

.confetti-piece.star:nth-child(5n) {
    color: #96ceb4; /* Green */
}

.confetti-piece.star:nth-child(6n) {
    color: #feca57; /* Yellow */
}

.confetti-piece.star:nth-child(7n) {
    color: #ff9ff3; /* Pink */
}

.confetti-piece.star:nth-child(8n) {
    color: #54a0ff; /* Light Blue */
}

.confetti-piece.star:nth-child(9n) {
    color: #5f27cd; /* Purple */
}

.confetti-piece.star:nth-child(10n) {
    color: #ff9f43; /* Orange */
}

.confetti-piece.star:nth-child(11n) {
    color: #00d2d3; /* Cyan */
}

@keyframes confetti-fall {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 1;
    }
    25% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--end-x), var(--end-y)) scale(1) rotate(720deg);
        opacity: 0;
    }
}

/* Center tada emoji */
.confetti-center-emoji {
    position: absolute;
    left: 51%;
    top: 51%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    z-index: 10000;
    animation: emoji-bounce 1.5s ease-in-out forwards;
    pointer-events: none;
}

@keyframes emoji-bounce {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    20% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    40% {
        transform: translate(-50%, -50%) scale(0.9);
    }
    60% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.settings-btn,
#settingsBtn,
button#settingsBtn,
.btn#settingsBtn,
.btn.btn-icon#settingsBtn {
    background: transparent !important;
    color: white !important;
    border: none !important;
    outline: none !important;
    padding: 10px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 18px !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    display: inline-block !important;
    font-weight: normal !important;
    text-decoration: none !important;
    min-width: auto !important;
    width: auto !important;
    height: auto !important;
    justify-content: initial !important;
    backdrop-filter: none !important;
}

.settings-btn:hover {
    background: transparent !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

.settings-btn:focus {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.settings-btn:active {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.clock i {
    font-size: 1.1rem;
    opacity: 0.9;
}

#currentTime {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    letter-spacing: 1px;
}

#currentTimeString {
    font-size: 4.5rem;
    opacity: 0.9;
    color: #5a6fd8;
}

#currentDateString {
    font-size: 1.1rem;
    opacity: 0.9;
    color: #6c757d;
}

/* Main content */
.main-content {
    flex: 1;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    height: 100%; /* Fill the container height */
    display: flex;
    flex-direction: column;
}

/* Controls section */
.controls {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

/* Results section */
.results {
    height: 100%; /* Fill the main content area */
    display: flex;
    flex-direction: column;
    flex: 1; /* Take up remaining space */
}

.controls-header {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Period filter styles */
.period-filter {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.period-filter button {
    min-width: 100px;
    border: 2px solid #5a6fd8;
}

.period-filter button.active
{
    background: #5a6fd8 !important;
    color: white !important;
    border-color: 5a6fd8 !important;
    transform: translateY(-1px);
}

.period-filter button.active:hover {
    background: #5a6fd8  !important;
    border: 2px solid #5a6fd8 !important;
    color: white !important;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #4ade80;
    color: white;
}

.btn-secondary:hover {
    background: #22c55e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 222, 128, 0.4);
}

.btn-outline {
    background: transparent;
    color: #5a6fd8;
    border: 2px solid #5a6fd8;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* Active state for filter buttons */
.btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.btn-icon {
    padding: 12px;
    width: 48px;
    height: 48px;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* Override btn-icon specifically for settings button */
.btn-icon#settingsBtn {
    background: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    color: white !important;
    border: none !important;
    outline: none !important;
}

/* Style the close button in settings modal */
#closeSettings {
    background: transparent !important;
    color: #5a6fd8 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 8px !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#closeSettings:hover {
    background: rgba(90, 111, 216, 0.1) !important;
    color: #5a6fd8 !important;
    transform: scale(1.1) !important;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

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


.loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
    font-size: 18px;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* Main content area - Two column layout */
.main-content-area {
    height: calc(100vh - 120px); /* Fixed height based on viewport */
    overflow: hidden; /* Prevent main content from scrolling */
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 20px;
    height: 100%; /* Fill the main content area */
}

/* Grid item positioning */
.clock-grid-item {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.timeline-header-grid-item {
    grid-column: 2;
    grid-row: 1;
}

.timer-container-grid-item {
    grid-column: 1;
    grid-row: 2;
    margin: 0px 0px 20px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timeline-container-grid-item {
    grid-column: 2;
    grid-row: 2;
    height: calc(100% - 20px);
    overflow: hidden;
}

/* Grid-based layout - old column styles removed */

.timeline-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 20px;
    gap: 15px;
}

.timeline-header h3 {
    margin-bottom: 0;
    color: #495057;
    font-size: 1.5rem;
}

.day-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-date {
    background: #667eea;
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    min-width: 120px;
    text-align: center;
    width: 220px;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* Make navigation buttons round */
.day-navigation .btn {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Make period filter buttons more pill-shaped */
.period-filter .btn {
    border-radius: 25px;
    padding: 6px 12px;
}

/* Make the All button less wide */
.period-filter .btn[data-period="all"] {
    min-width: auto;
    width: auto;
    padding: 6px 12px;
}

/* Weather Widget Styles */
.weather-widget {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 280px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.weather-icon {
    font-size: 0.8rem;
    color: rgb(173, 181, 189);
}

.weather-temp {
    font-size: 1rem;
    font-weight: 600;
    color: rgb(173, 181, 189);
}

.weather-temp #tempUnit {
    font-size: 1rem;
    opacity: 0.8;
}

.weather-details {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1rem;
    color: rgb(173, 181, 189);
}

.weather-high-low {
    display: flex;
    gap: 10px;
}

.weather-high-low .high {
    color: rgb(173, 181, 189);
}

.weather-high-low .low {
    color: rgb(173, 181, 189);
}

.weather-rain {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgb(173, 181, 189);
}

.weather-rain i {
    font-size: 0.8rem;
}

/* Responsive weather widget */
@media (max-width: 768px) {
    .weather-widget {
        min-width: 240px;
    }
    
    .weather-main {
        gap: 10px;
    }
    
    .weather-icon {
        font-size: 0.7rem;
    }
    
    .weather-temp {
        font-size: 0.9rem;
    }
    
    .weather-temp #tempUnit {
        font-size: 0.9rem;
    }
    
    .weather-details {
        font-size: 0.9rem;
        gap: 10px;
    }
    
    .weather-rain i {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .clock-grid-item {
        gap: 5px;
    }
    
    .weather-widget {
        min-width: 200px;
    }
    
    .weather-main {
        gap: 8px;
    }
    
    .weather-icon {
        font-size: 0.6rem;
    }
    
    .weather-temp {
        font-size: 0.8rem;
    }
    
    .weather-temp #tempUnit {
        font-size: 0.8rem;
    }
    
    .weather-details {
        font-size: 0.8rem;
        gap: 8px;
    }
    
    .weather-rain i {
        font-size: 0.6rem;
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification i {
    font-size: 1.2rem;
}

.notification-success i {
    color: #28a745;
}

.notification-error i {
    color: #dc3545;
}

.notification-info i {
    color: #17a2b8;
}

.notification span {
    color: #333;
    font-weight: 500;
}

.timeline-container {
    position: relative;
    max-width: 100%;
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f3f4;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px 20px 0px 20px;
    margin: 0 20px 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

/* Force scrollbar to always be visible */
.timeline-container::-webkit-scrollbar {
    width: 12px; /* Slightly wider for better visibility */
}

.timeline-container::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
    border: 1px solid #667eea;
}

.timeline-container::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
    border-color: #5a6fd8;
}



/* CSS Variables for calendar theming */
:root {
    --calendar-color: #667eea; /* Default fallback color */
}

/* Events list - Timeline style */
.event-item {
    position: relative;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

/* New four-column layout */
.event-layout {
    display: grid;
    grid-template-columns: 100px 50px 1fr 50px;
    align-items: center;
}

/* Time column */
.event-time-column {
    text-align: left;
}

.event-time-range {
    display: block;
    color: #adb5bd; /* Gray color for all event times */
    font-weight: 600;
    font-size: 18px; /* Increased from 14px to 18px */
    margin-bottom: 5px;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
    text-align: left;
}

.event-time-all-day {
    display: block;
    color: #4ade80;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

/* Icon column */
.event-icon-column {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 20px;
}

.event-icon {
    font-size: 3rem; /* Increased from 2rem to 3rem */
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Content column */
.event-content-column {
    flex: 1;
    background: color-mix(in srgb, var(--calendar-color) 8%, white);
    padding: 15px;
    border-radius: 8px;
    margin-left: 15px;
    margin-right: 5px;
}

/* Checkbox column */
.event-checkbox-column {
    display: flex;
    justify-content: center;
    align-items: center;
}

.event-checkbox {
    width: 30px;
    height: 30px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    background: white;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.event-checkbox:hover {
    transform: scale(1.1);
}

.event-checkbox.checked {
    background: #667eea;
}

.event-checkbox.checked::after {
    content: "✓";
    font-weight: bold;
    color: white;
}

/* Star for current/future completed events */
.event-checkbox.checked.star::after {
    content: "★";
    color: #ffd700;
}

.event-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #495057;
    line-height: 1.3;
}

.event-location {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.event-description {
    color: #495057;
    line-height: 1.5;
    font-size: 14px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

/* All-day event styling */
.event-item.all-day .event-time-all-day {
    color: #4ade80;
    font-weight: 600;
}

/* Event status color coding */
.event-item.ended {
    border-color: #ff6347;
}

.event-item.ended .event-content-column {
    background: #667eea; /* Blue background for ended events */
    border-radius: 8px 0 0 8px; /* Rounded left corners only */
    padding: 15px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    height: 100%;
    min-height: 100%;
}

.event-item.ended .event-checkbox-column {
    background: #667eea; /* Same blue background */
    border-radius: 0 8px 8px 0; /* Rounded right corners only */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 100%;
}


.event-item.current .event-content-column {
    background: #4ade80; /* Green background for current events */
    border-radius: 8px 0 0 8px; /* Rounded left corners only */
    padding: 15px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(74, 222, 128, 0.3);
    height: 100%;
    min-height: 100%;
}

.event-item.current .event-checkbox-column {
    background: #4ade80; /* Same green background */
    border-radius: 0 8px 8px 0; /* Rounded right corners only */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 100%;
}


.event-item.upcoming {
    border-color: #20b2aa;
}

.event-item.upcoming .event-content-column {
    background: #40e0d0; /* Turquoise background for upcoming events */
    border-radius: 8px 0 0 8px; /* Rounded left corners only */
    padding: 15px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(64, 224, 208, 0.3);
    height: 100%;
    min-height: 100%;
}

.event-item.upcoming .event-checkbox-column {
    background: #40e0d0; /* Same turquoise background */
    border-radius: 0 8px 8px 0; /* Rounded right corners only */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 100%;
}


/* Text color adjustments for better readability on colored backgrounds */
.event-item.ended .event-title {
    color: #ffffff; /* White text for ended event titles */
}

.event-item.ended .event-location {
    color: #ffffff; /* White text for ended event locations */
}

.event-item.ended .event-description {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff; /* White text for ended event descriptions */
}

.event-item.current .event-title {
    color: #ffffff; /* White text for title on hot pink background */
    font-weight: 700;
}

.event-item.current .event-location {
    color: #ffffff; /* White text for location on hot pink background */
}

.event-item.current .event-description {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff; /* White text for description on hot pink background */
}

.event-item.upcoming .event-title {
    color: #ffffff; /* White text for upcoming event titles */
}

.event-item.upcoming .event-location {
    color: #ffffff; /* White text for upcoming event locations */
}

.event-item.upcoming .event-description {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff; /* White text for upcoming event descriptions */
}

/* Right Column: Visual Timer */
.timer-column h3 {
    color: #495057;
    font-size: 1.5rem;
    text-align: center;
}

.timer-container {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

/* Current Event Timer */
.current-event {
    text-align: center;
    height: 100%;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    /* padding: 20px; */
}

.current-event h4,
.next-event h4 {
    font-size: 1.4rem;
    color: #495057;
    margin-bottom: 8px;
    font-weight: 600;
    padding: 20px
}

.visual-timer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 320px;
    height: 320px;
    max-width: 320px;
    padding: 10px;
    box-sizing: border-box;
}

.event-timer {
    transform: scale(0.6);
    transform-origin: center center;
}

.event-timer {
    display: flex;
    justify-content: center;
    align-items: center;
}

.next-event {
    text-align: center;
}

.event-icon-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.event-icon-large {
    font-size: 3rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
    border: 3px solid #e9ecef;
    transition: all 0.3s ease;
}

.event-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6c757d;
    font-size: 16px;
    margin-top: 15px;
}

/* No Events State */
.no-events {
    text-align: center;
    color: #6c757d;
}

.no-events i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-events h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #495057;
}

.no-events p {
    font-size: 14px;
    opacity: 0.8;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    margin: 0;
}

.footer-content p {
    flex: 1;
    text-align: center;
}

.footer .btn-icon {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.footer .btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Responsive design  to be stacked*/
@media (max-width: 1200px) and (orientation: portrait) {
    html, body {
        overflow-x: hidden; /* Prevent horizontal scrolling */
        overflow-y: auto; /* Allow vertical scrolling */
        width: 100%;
        max-width: 100vw;
    }

    .main-content-area {
        overflow: auto; /* Allow scrolling when stacked */
        height: auto; /* Let content determine height */
        min-height: calc(100vh - 120px);
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .content-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 15px;
        padding: 0px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    /* Smaller text for event table on small devices */
    .event-title {
        font-size: 1rem;
        line-height: 1.3;
    }

    .event-location {
        font-size: 12px;
        line-height: 1.2;
    }

    .event-description {
        font-size: 12px;
        line-height: 1.3;
    }

    .event-time-range {
        font-size: 14px;
        line-height: 1.2;
    }

    .event-time-all-day {
        font-size: 12px;
        line-height: 1.2;
    }

    /* Smaller icons for portrait orientation */
    .event-icon {
        width: 18px;
        height: 18px;
    }

    /* Even smaller text for very small devices */
    @media (max-width: 480px) {
        .event-title {
            font-size: 0.9rem;
        }

        .event-location {
            font-size: 11px;
        }

        .event-description {
            font-size: 11px;
        }

        .event-time-range {
            font-size: 13px;
        }

        .event-time-all-day {
            font-size: 11px;
        }

        /* Smaller icons for very small devices */
        .event-icon {
            width: 16px;
            height: 16px;
        }
    }

    .clock-grid-item {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        padding: 0px 20px;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .clock {
        word-wrap: break-word;
        word-break: break-word;
        text-align: center;
        width: 100%;
    }


    .current-event h4,
    .next-event h4 {
        padding: 0px;
    }

    .timer-container-grid-item {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        padding: 0px 20px;
        margin: 0px;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .timer-container {
        padding: 20px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .visual-timer-container {
        width: 320px;
        height: 320px;
        max-width: 320px;
        box-sizing: border-box;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 10px;
    }

    .event-timer {
        transform: scale(0.5);
        transform-origin: center center;
    }

    .timeline-header-grid-item {
        grid-column: 1;
        grid-row: 3;
        width: 100%;
        padding: 0px 20px;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .day-navigation .btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .day-navigation {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 10px;
    }

    /* Current date on first row */
    .day-navigation .current-date {
        order: 0;
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    /* Today button first on second row */
    .day-navigation #todayBtn {
        order: 1;
    }

    /* Other navigation buttons below */
    .day-navigation #prevDay,
    .day-navigation #nextDay,
    .day-navigation #fetchEvents {
        order: 2;
    }

    .period-filter {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .period-filter .btn {
        white-space: normal;
        text-align: center;
        word-wrap: break-word;
        word-break: break-word;
        min-height: auto;
        height: auto;
        padding: 8px 12px;
    }

    .period-filter .btn[data-period="all"] {
        min-width: auto;
        width: auto;
        padding: 6px 12px;
    }

    .current-date {
        min-width: 120px;
        width: auto;
        flex-shrink: 0;
    }

    .current-date {
        word-wrap: break-word;
        word-break: break-word;
        white-space: normal;
        text-align: center;
        width: 100%;
        max-width: 100%;
    }

    .timeline-container-grid-item {
        grid-column: 1;
        grid-row: 4;
        width: 100%;
        padding: 0px 20px;
        max-width: 100vw;
        box-sizing: border-box;
    }

    /* Hide second column when stacked */
    .timeline-header-grid-item,
    .timeline-container-grid-item {
        grid-column: 1;
    }
    .timeline-header {
        padding: 0px;
    }

    .timeline-container {
        margin: 0px;
    }
}

@media (max-width: 1200px) and (orientation: landscape) {
    .content-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto 1fr;
        gap: 20px;
    }

    .clock-grid-item {
        grid-column: 1;
        grid-row: 1;
    }

    .timeline-header-grid-item {
        grid-column: 2;
        grid-row: 1;
    }

    .timer-container-grid-item {
        grid-column: 1;
        grid-row: 2;
    }

    .timeline-container-grid-item {
        grid-column: 2;
        grid-row: 2;
    }

    .visual-timer-container {
        width: 320px;
        height: 320px;
        max-width: 320px;
        padding: 10px;
        box-sizing: border-box;
    }

    .event-timer {
        transform: scale(0.6);
        transform-origin: center center;
    }
}


/* Animation for loading */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

.event-complete-container {
    margin-top: 20px;
    text-align: center;
}

.event-complete-checkbox {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #495057;
    user-select: none;
}

.event-complete-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #f8f9fa;
    border: 2px solid #6c757d;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.event-complete-checkbox:hover input ~ .checkmark {
    background-color: #e9ecef;
}

.event-complete-checkbox input:checked ~ .checkmark {
    background-color: #4ade80;
    border-color: #4ade80;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.event-complete-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.event-complete-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Clock in grid layout */
.clock {
    display: flex;
    align-items: center;
    font-size: 5rem;
    font-weight: 600;
    color: #667eea;
    text-shadow: none;
    transition: all 0.3s ease;
    justify-content: center;
}

/* Settings Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.settings-overlay.hidden {
    display: none;
}

.settings-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    height: 80vh;
    position: relative;
    animation: slideIn 0.3s ease-out;
    overflow: hidden;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #e9ecef;
    background: white;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.settings-header h2 {
    margin: 0;
    color: #495057;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-header h2 i {
    color: #667eea;
}

.settings-content {
    padding: 24px;
    overflow-y: auto;
    position: absolute;
    top: 80px;
    bottom: 80px;
    left: 0;
    right: 0;
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section h3 {
    margin: 0 0 16px 0;
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #6c757d;
    font-size: 12px;
    line-height: 1.4;
}

.settings-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 24px;
    border-top: 1px solid #e9ecef;
    background: white;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.settings-actions .btn {
    min-width: 120px;
}

/* Responsive adjustments for settings */
@media (max-width: 768px) {
    .settings-modal {
        margin: 20px;
        height: calc(100vh - 40px);
        max-height: calc(100vh - 40px);
    }
    
    .settings-actions {
        flex-direction: column;
        flex-shrink: 0;
    }
    
    .settings-actions .btn {
        width: 100%;
    }
}
/* 
