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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --text-color: #333;
    --light-gray: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

header {
    background-color: var(--light-gray);
    padding: 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* Filters Sidebar */
.filters {
    position: sticky;
    top: 2rem;
    height: fit-content;
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.filter-section {
    margin-bottom: 1.5rem;
}

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

#search {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
}

#year-filter {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
    background-color: #fff;
}

#tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-filter {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background-color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tag-filter:hover {
    background-color: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
}

.tag-filter.active {
    background-color: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
}

.clear-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.clear-btn:hover {
    opacity: 0.9;
}

/* Timeline */
.timeline {
    min-height: 400px;
}

#timeline-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.memory-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 2rem;
}

.memory-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.memory-header {
    padding: 1.5rem;
    background-color: var(--light-gray);
}

.memory-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.memory-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.memory-description {
    color: var(--text-color);
    line-height: 1.6;
}

.memory-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #666;
}

.memory-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.memory-image {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
}

.memory-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.memory-image:hover img {
    transform: scale(1.05);
}

.image-caption {
    padding: 0.5rem;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

#lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    display: block;
    margin: 0 auto;
}

.lightbox-caption {
    color: #fff;
    text-align: center;
    padding: 1rem;
    font-size: 1rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 1rem;
    transition: background-color 0.2s;
    z-index: 1001;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
}

.lightbox-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .filters {
        position: static;
        margin-bottom: 1rem;
    }

    .memory-title {
        font-size: 1.25rem;
    }

    .memory-images {
        grid-template-columns: 1fr;
    }

    .lightbox-prev,
    .lightbox-next {
        padding: 0.5rem;
        font-size: 1.5rem;
    }

    .lightbox-close {
        padding: 0.5rem 0.75rem;
    }
}
