* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #000000;
    color: #ffffff;
}

/* Remove container styles since we don't need them anymore */

/* Floating year selector in top-right corner */
.year-selector-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    user-select: none;
}

.year-current {
    background-color: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(10px);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(102, 102, 102, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease-in-out;
    min-width: 120px;
    text-align: center;
}

.year-current:hover {
    background-color: rgba(51, 51, 51, 0.9);
    border-color: rgba(102, 102, 102, 0.6);
    transform: translateY(-1px);
}

.year-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(102, 102, 102, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    min-width: 120px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 8px;
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

.year-dropdown.show {
    display: block;
}

.year-option {
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    color: #ffffff;
    font-size: 14px;
    border-bottom: 1px solid rgba(102, 102, 102, 0.2);
}

.year-option:last-child {
    border-bottom: none;
}

.year-option:hover {
    background-color: rgba(51, 51, 51, 0.8);
}

.year-option.active {
    background-color: rgba(51, 51, 51, 0.9);
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Full-width photo grid container */
.photo-grid-container {
    width: 100vw;
    padding: 0 10px; /* Minimal padding */
}

#photoGrid {
    display: grid;
    gap: 1px; /* Minimal gap between cells */
    margin: 0 auto;
    background-color: #000000;
    width: 100%;
    box-sizing: border-box; /* Include padding in width calculation */
    
    /* Dynamic grid sizing based on viewport */
    /* Calculate cell size to fit all 365 days in available space */
    --available-width: calc(100vw - 20px); /* Account for minimal padding */
    --available-height: calc(100vh - 20px); /* Nearly full viewport height */
    --grid-size: min(var(--available-width), var(--available-height));
    --cell-size: calc(var(--grid-size) / 20); /* Start with 20 cells per row */
    
    grid-template-columns: repeat(auto-fit, minmax(var(--cell-size), 1fr));
    grid-auto-rows: var(--cell-size); /* Force consistent row heights */
    max-height: var(--available-height);
    justify-content: center;
    padding-top: 10px; /* Small top padding */
}

.day-cell {
    position: relative;
    width: 100%;
    background-color: #1a1a1a;
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Prevent content from extending outside cell */
    padding: 0; /* Remove any default padding */
    margin: 0; /* Remove any default margin */
    border: none; /* Remove any default border */
}

/* Improve hover effects on grid cells */
.day-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill entire cell, crop if needed */
    background-color: #000000;
    transition: all 0.2s ease-in-out;
    display: block;
    padding: 0;
    margin: 0;
    border: none;
}

.day-cell:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.date-label {
    position: absolute;
    bottom: 2px; /* Small offset from bottom */
    left: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.8); /* Stronger background for visibility */
    color: white;
    font-size: 8px;
    padding: 2px 4px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2; /* Ensure label appears above image */
    border-radius: 2px; /* Slight rounding for better appearance */
}

.day-cell:hover .date-label {
    opacity: 1;
}

@media (min-width: 768px) {
    .date-label {
        font-size: 10px;
    }
}

.empty {
    background-color: #1a1a1a;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    #photoGrid {
        --available-width: calc(100vw - 20px);
        --available-height: calc(100vh - 20px);
        --cell-size: calc(var(--grid-size) / 19);
    }
}

@media (max-width: 768px) {
    .year-selector-floating {
        top: 10px;
        right: 10px;
    }
    
    .year-current {
        padding: 10px 12px;
        font-size: 13px;
        min-width: 100px;
    }
    
    #photoGrid {
        --available-width: calc(100vw - 20px);
        --available-height: calc(100vh - 20px);
        --cell-size: calc(var(--grid-size) / 18);
        gap: 1px;
    }

    .container {
        padding: 5px 10px;
    }
    
    .year-stats {
        margin-bottom: 10px;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .year-selector-floating {
        top: 10px;
        right: 10px;
    }
    
    .year-current {
        padding: 8px 10px;
        font-size: 12px;
        min-width: 90px;
    }
    
    .year-option {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    #photoGrid {
        --available-width: calc(100vw - 20px);
        --available-height: calc(100vh - 20px);
        --cell-size: calc(var(--grid-size) / 15); /* Fewer columns on mobile */
        gap: 1px;
    }
    
    .container {
        padding: 5px;
    }
    
    .year-stats {
        margin-bottom: 10px;
        gap: 8px;
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    /* Special handling for landscape tablets/small laptops */
    .year-selector-floating {
        top: 10px;
        right: 10px;
    }
    
    #photoGrid {
        --available-height: calc(100vh - 20px);
        --cell-size: calc(var(--grid-size) / 22);
    }
    
    .year-stats {
        margin-bottom: 5px;
    }
}

.error-message {
    color: #ff4444;
    padding: 20px;
    text-align: center;
    background-color: #1a1a1a;
    border-radius: 4px;
    margin: 20px 0;
}

/* Hover preview styles */
.hover-preview {
    position: fixed;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    pointer-events: none; /* Allow mouse events to pass through */
    display: none;
    animation: fadeInPreview 0.2s ease-in-out;
}

.hover-preview img {
    max-width: 300px;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

@keyframes fadeInPreview {
    from { 
        opacity: 0; 
        transform: scale(0.9) translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

/* Overlay styles */
.image-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    cursor: pointer;
}

.image-overlay img {
    max-width: 90%;
    max-height: 90vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    background-color: transparent;
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.2em;
}

/* Remove old year-stats styles - now using floating selector */ 

/* Mobile-specific hover preview adjustments */
@media (max-width: 768px) {
    .hover-preview {
        /* Smaller preview on mobile */
        max-width: 90vw;
    }
    
    .hover-preview img {
        max-width: 250px;
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    .hover-preview img {
        max-width: 200px;
        max-height: 200px;
    }
    
    /* On small mobile devices, disable hover preview since touch is primary */
    @media (hover: none) {
        .hover-preview {
            display: none !important;
        }
    }
} 