/* Public Themes - Apple-inspired Design */

:root {
    --apple-blue: #007aff;
    --apple-blue-dark: #0056b3;
    --apple-gray: #8e8e93;
    --apple-gray-light: #f2f2f7;
    --apple-gray-dark: #1c1c1e;
    --apple-text: #1d1d1f;
    --apple-text-secondary: #86868b;
    --apple-border: rgba(0, 0, 0, 0.1);
    --apple-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --apple-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --apple-radius: 16px;
    --apple-radius-small: 8px;
}

/* Page Layout */
.public-themes-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--apple-gray-light);
    min-height: 100vh;
}

/* Hero Section */
.themes-hero {
    background: linear-gradient(135deg, var(--apple-blue) 0%, var(--apple-blue-dark) 100%);
    color: white;
    padding: 4rem 0 5rem;
    position: relative;
    overflow: hidden;
}

.themes-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 1rem 0;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.4;
}

.hero-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

/* Themes Container */
.themes-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    transform: translateY(-2rem);
    position: relative;
    z-index: 3;
}

/* Theme Card */
.theme-card {
    background: white;
    border-radius: var(--apple-radius);
    box-shadow: var(--apple-shadow);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--apple-border);
}

.theme-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--apple-shadow-hover);
}

/* Theme Header with Dynamic Gradient */
.theme-header {
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.theme-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        var(--theme-color, var(--apple-blue)) 0%, 
        color-mix(in srgb, var(--theme-color, var(--apple-blue)) 80%, black 20%) 100%
    );
    z-index: 1;
}

.theme-header-content {
    position: relative;
    z-index: 2;
}

.theme-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.theme-description {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    line-height: 1.5;
    font-weight: 400;
}

.theme-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.event-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.event-duration{
    background: #ffffff30;
    padding: 10px 16px;
    color: white;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.theme-frise-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--theme-color, var(--apple-blue));
    text-decoration: none;
    background: white;
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

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

.theme-frise-link:hover::before {
    left: 100%;
}

.theme-frise-link:hover {
    background: white;
    transform: translateY(-2px) scale(1.05);
    color: var(--theme-color, var(--apple-blue));
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.theme-frise-link i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.theme-frise-link:hover i {
    transform: translateX(2px);
}

/* Events Timeline */
.events-timeline {
    padding: 0;
    margin: 0;
    background: white;
}

.event-link {
    display: block;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.event-link:hover {
    text-decoration: none;
}

.event-item {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--apple-gray-light);
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.event-item:last-child {
    border-bottom: none;
}

.event-link:hover .event-item {
    background-color: rgba(0, 122, 255, 0.03);
    transform: translateX(4px);
}

.event-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, 
        var(--theme-color, var(--apple-blue)) 0%, 
        color-mix(in srgb, var(--theme-color, var(--apple-blue)) 70%, black 30%) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.event-link:hover .event-item::before {
    opacity: 1;
}


.event-date-year {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.event-date-day {
    display: block;
    font-size: 0.8rem;
    color: var(--apple-text-secondary);
    font-weight: 500;
    line-height: 1;
}

.event-date-era {
    font-size: 0.7rem;
    color: var(--apple-text-secondary);
    font-weight: 500;
    margin-top: -0.25rem;
    line-height: 1;
}

/* Event Content */
.event-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.event-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--apple-text);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.event-link:hover .event-title {
    color: var(--theme-color, var(--apple-blue));
}

.event-description {
    color: var(--apple-text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    transition: color 0.3s ease;
}

.event-link:hover .event-description {
    color: var(--apple-text);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--apple-text-secondary);
    background: white;
    border-radius: var(--apple-radius);
    box-shadow: var(--apple-shadow);
    margin: 2rem 0;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
    color: var(--apple-gray);
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--apple-text);
    margin: 0 0 0.5rem 0;
}

.empty-state-description {
    font-size: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .themes-hero {
        padding: 3rem 0 4rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .theme-header {
        padding: 1.5rem;
    }
    
    .theme-title {
        font-size: 1.5rem;
    }
    
    .theme-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .event-item {
        padding: 1.25rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .event-link:hover .event-item {
        transform: translateX(0);
    }
    
    .event-date {
        width: auto;
        text-align: left;
    }
    
    .themes-container {
        transform: translateY(-1rem);
    }
}

@media (max-width: 480px) {
    .themes-container {
        padding: 0 0.75rem;
    }
    
    .theme-header {
        padding: 1.25rem;
    }
    
    .event-item {
        padding: 1rem 1.25rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading-shimmer {
    background: linear-gradient(90deg, 
        var(--apple-gray-light) 25%, 
        rgba(255, 255, 255, 0.5) 50%, 
        var(--apple-gray-light) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --apple-gray-light: #1c1c1e;
        --apple-text: #ffffff;
        --apple-text-secondary: #8e8e93;
        --apple-border: rgba(255, 255, 255, 0.1);
        --apple-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        --apple-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
    }
    
    .public-themes-page {
        background: var(--apple-gray-dark);
    }
    
    .theme-card {
        background: #2c2c2e;
        border-color: var(--apple-border);
    }
    
    .event-date {
        background: #3a3a3c;
    }
    
    .empty-state {
        background: #2c2c2e;
    }
}