* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease;
}

/* Night Mode Styles */
body.night-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
}

body.night-mode .container {
    background: #16213e;
    color: #e0e0e0;
}

body.night-mode header h1 {
    color: #9fa8da;
}

body.night-mode .navigation {
    background: #1a1a2e;
}

body.night-mode .navigation h2 {
    color: #9fa8da;
}

body.night-mode .nav-btn {
    background: linear-gradient(135deg, #5c6bc0 0%, #7e57c2 100%);
}

body.night-mode .night-mode-btn {
    background: #1a1a2e;
    border-color: #9fa8da;
    color: #fff;
}

body.night-mode .night-mode-btn:hover {
    background: #5c6bc0;
}

body.night-mode .day-name {
    color: #9fa8da;
}

body.night-mode .day {
    background: #1a1a2e;
    color: #e0e0e0;
}

body.night-mode .day:not(.empty):hover {
    background: #5c6bc0;
}

body.night-mode .day.today {
    background: #7e57c2;
}

body.night-mode .event-dot {
    background: #9fa8da;
}

body.night-mode .event-display {
    background: #1a1a2e;
}

body.night-mode .event-display h3 {
    color: #9fa8da;
}

body.night-mode .event-display li {
    background: #0f0f1e;
    color: #e0e0e0;
    border-left-color: #9fa8da;
}

body.night-mode .event-item:hover {
    background: #1a1a2e;
}

body.night-mode .modal-content {
    background: #16213e;
    color: #e0e0e0;
}

body.night-mode #modalEventName,
body.night-mode .comparison-event,
body.night-mode .activity-comp-name {
    color: #9fa8da;
}

body.night-mode .modal-activity-item {
    background: #1a1a2e;
    border-color: #9fa8da;
}

body.night-mode .activity-name {
    color: #9fa8da;
}

body.night-mode .activity-number,
body.night-mode .value-box {
    background: #0f0f1e;
    border-color: #9fa8da;
    color: #9fa8da;
}

body.night-mode .compare-btn {
    background: linear-gradient(135deg, #5c6bc0 0%, #7e57c2 100%);
}

body.night-mode .close,
body.night-mode .close-comparison {
    color: #999;
}

body.night-mode .close:hover,
body.night-mode .close-comparison:hover {
    color: #e0e0e0;
}

body.night-mode .comparison-header {
    background: #1a1a2e;
}

body.night-mode .comparison-vs {
    color: #9fa8da;
}

body.night-mode .activity-comparison-item {
    background: #1a1a2e;
    border-color: #333;
}

body.night-mode .comparison-date {
    color: #999;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

header h1 {
    color: #667eea;
    font-size: 1.5rem;
    font-weight: 700;
}

.night-mode-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.night-mode-btn:hover {
    background: #667eea;
    transform: translateY(-50%) scale(1.1);
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.navigation h2 {
    color: #764ba2;
    font-size: 1.1rem;
    font-weight: 600;
}

.nav-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

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

#calendar {
    max-width: 400px;
    margin: 0 auto;
}

.day-names {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 8px;
}

.day-name {
    text-align: center;
    font-weight: 600;
    color: #667eea;
    font-size: 0.7rem;
    padding: 3px;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 2px;
    padding: 4px 2px;
}

.event-dots {
    display: flex;
    gap: 2px;
    margin-top: 2px;
}

.event-dot {
    width: 4px;
    height: 4px;
    background: #667eea;
    border-radius: 50%;
}

.day.today .event-dot {
    background: white;
}

.event-display {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 100px;
}

.event-display h3 {
    color: #764ba2;
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.event-display ul {
    list-style: none;
    padding: 0;
}

.event-display li {
    padding: 8px 12px;
    background: white;
    margin-bottom: 6px;
    border-radius: 6px;
    color: #333;
    font-size: 0.85rem;
    border-left: 3px solid #667eea;
}

.event-item {
    font-weight: 600;
    color: #764ba2;
    transition: background 0.2s ease;
}

.event-item:hover {
    background: #f0f0f0;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
}

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

.close {
    color: #999;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: #333;
}

.close-comparison {
    color: #999;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-comparison:hover {
    color: #333;
}

#modalEventName {
    color: #764ba2;
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

#modalActivitiesList {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.modal-activity-item {
    padding: 15px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 2px solid #667eea;
    color: #555;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    gap: 10px;
}

.activity-name {
    font-weight: 600;
    color: #764ba2;
    font-size: 0.9rem;
}

.activity-number {
    background: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
    border: 1px solid #667eea;
}

.compare-btn {
    width: 100%;
    margin-top: 20px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.compare-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

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

/* Compare mode banner */
.compare-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.compare-banner.hidden {
    display: none;
}

/* Comparison modal */
.comparison-modal-content {
    max-width: 600px;
}

.comparison-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.comparison-event {
    text-align: center;
    color: #764ba2;
}

.comparison-date {
    font-size: 0.8rem;
    color: #666;
}

.comparison-vs {
    font-weight: 700;
    color: #667eea;
    font-size: 1.2rem;
}

.activities-comparison {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-comparison-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.activity-comp-name {
    font-weight: 600;
    color: #764ba2;
    margin-bottom: 10px;
    text-align: center;
}

.activity-comp-values {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
}

.value-box {
    background: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    color: #667eea;
    border: 1px solid #667eea;
}

.change-indicator {
    font-weight: 700;
    font-size: 1rem;
    padding: 6px 12px;
    border-radius: 6px;
}

.change-indicator.positive {
    color: #28a745;
    background: #d4edda;
}

.change-indicator.negative {
    color: #dc3545;
    background: #f8d7da;
}

.day:not(.empty):hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.day.empty {
    background: transparent;
    cursor: default;
}

.day.today {
    background: #764ba2;
    color: white;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.3rem;
    }
    
    #calendar {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 20px;
    }
    
    .comparison-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .activity-comp-values {
        flex-direction: column;
        gap: 8px;
    }
    
    .nav-btn .btn-text {
        display: none;
    }
    
    .nav-btn {
        padding: 8px 12px;
        min-width: 40px;
    }
    
    .compare-banner {
        width: calc(100% - 40px);
        max-width: none;
        left: 20px;
        transform: none;
        top: 10px;
        font-size: 0.9rem;
        animation: slideDownMobile 0.3s ease;
    }
    
    @keyframes slideDownMobile {
        from {
            transform: translateY(-20px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}