:root {
    --bg-primary: #FAFAF5;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --text-primary: #2C2C2C;
    --text-secondary: #5A5A5A;
    --text-muted: #8A8A8A;
    --accent: #8B7355;
    --accent-light: #A89070;
    --accent-dark: #6B5340;
    --border: #E8E4DE;
    --shadow: rgba(139, 115, 85, 0.1);
    --shadow-hover: rgba(139, 115, 85, 0.2);
    --highlight: #FFF8E7;
    --highlight-border: #D4AF37;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(139, 115, 85, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 115, 85, 0.03) 0%, transparent 50%);
}

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

.header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.main-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.main-title::before,
.main-title::after {
    content: '❧';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--accent);
    opacity: 0.6;
}

.main-title::before {
    left: -2.5rem;
}

.main-title::after {
    right: -2.5rem;
    transform: translateY(-50%) scaleX(-1);
}

.subtitle {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--shadow);
    border: 1px solid var(--border);
}

.controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    align-items: flex-end;
}

.controls-row:first-child {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.15);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.btn-clear-search {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-wrapper:hover .btn-clear-search,
.search-input:focus + .btn-clear-search {
    opacity: 1;
}

.btn-clear-search:hover {
    color: var(--accent);
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.btn-share {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

.btn-saved {
    background: linear-gradient(135deg, #E74C3C, #C0392B);
    color: white;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    position: relative;
}

.btn-saved:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}

.saved-count {
    background: white;
    color: #E74C3C;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.25rem;
}

.section-count {
    margin-left: auto;
    background: var(--bg-primary);
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    color: var(--accent);
    transform: rotate(90deg);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-icon {
    font-size: 2rem;
}

.modal-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem 2rem;
}

.modal-body p {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

.btn-share-item {
    background: var(--bg-primary);
    color: var(--accent-dark);
    border: 2px solid var(--accent);
}

.btn-share-item:hover {
    background: var(--accent);
    color: white;
}

.btn-save-item {
    background: linear-gradient(135deg, #E74C3C, #C0392B);
    color: white;
}

.btn-save-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}

.btn-save-item.saved {
    background: #95a5a6;
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

.toast.info {
    background: var(--accent);
}

.toast-message {
    font-size: 0.9375rem;
}

.event-item.clickable {
    cursor: pointer;
}

.event-item.clickable:hover::after {
    content: '👆';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1rem;
    opacity: 0.5;
}

@media (max-width: 1024px) {
    .content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card:nth-child(3) {
        grid-column: span 2;
    }
}

.date-picker-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.date-picker {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.date-picker:hover {
    border-color: var(--accent-light);
}

.date-picker:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.15);
}

.button-group {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(139, 115, 85, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 115, 85, 0.4);
}

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

.btn-secondary {
    background: var(--bg-primary);
    color: var(--accent-dark);
    border: 2px solid var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1.125rem;
}

.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.loading.active {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

.error-message {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.error-message.active {
    display: flex;
}

.error-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.btn-retry {
    background: var(--text-primary);
    color: white;
    padding: 0.625rem 1.25rem;
}

.btn-retry:hover {
    background: var(--accent-dark);
}

.content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    flex: 1;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.content.hidden {
    display: none;
}

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

.card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border-bottom: 2px solid var(--border);
}

.card-icon {
    font-size: 1.5rem;
}

.card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

.card-body {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    max-height: 600px;
}

.event-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
}

.event-item:last-child {
    margin-bottom: 0;
}

.event-item:hover {
    border-color: var(--accent-light);
    box-shadow: 0 4px 12px var(--shadow-hover);
    transform: translateY(-2px);
}

.event-item.highlighted {
    background: var(--highlight);
    border: 2px solid var(--highlight-border);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(212, 175, 55, 0);
    }
}

.event-year {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 60px;
    flex-shrink: 0;
}

.event-content {
    flex: 1;
}

.event-title {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.event-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.event-title a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.event-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--accent);
    text-decoration: none;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.event-link:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

.event-link-icon {
    font-size: 0.875rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-text {
    font-size: 1rem;
}

.about-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px var(--shadow);
}

.about-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.about-title::after {
    content: '';
    position: absolute;
    bottom: -0.35rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.25rem 0;
}

.feature {
    text-align: center;
    padding: 1rem 0.75rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px var(--shadow-hover);
    border-color: var(--accent-light);
}

.feature-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.feature-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.feature-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding-bottom: 1.5rem;
}

.footer-column {
    text-align: center;
}

.footer-column-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.35rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-email {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.3s ease;
}

.footer-email:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.footer-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-text a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-text a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card:nth-child(3) {
        grid-column: span 2;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .main-title::before,
    .main-title::after {
        display: none;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-picker-wrapper {
        width: 100%;
    }
    
    .date-picker {
        width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
    
    .content {
        grid-template-columns: 1fr;
    }
    
    .card:nth-child(3) {
        grid-column: span 1;
    }
    
    .card-body {
        max-height: 400px;
    }
    
    .about-section {
        padding: 1.5rem;
    }
    
    .about-title {
        font-size: 1.75rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 0.875rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.125rem;
    }
    
    .event-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .event-year {
        font-size: 1rem;
    }
}
