/**
 * Peppol Events Manager - Complete Frontend Styles
 */

/* ============================================
   BASE CONTAINER
   ============================================ */

.fast-events-container {
    --primary: #d2691e;
    --secondary: #173752;
    --light: #f8f9fa;
    --grey: #667788;
    --light-grey: #e9ecef;
    --border: #dee2e6;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

.fast-events-container * {
    box-sizing: border-box;
}

/* ============================================
   HEADER SECTION
   ============================================ */

.fast-events-header {
    background-color: #173752;
    color: white;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
    border-radius: 15px;
}

.fast-events-header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    font-weight: 600;
    color: white !important;
    position: relative;
    z-index: 1;
    margin-top: 0;
}

.fast-events-header p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 30px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* ============================================
   LOADING & STATUS STATES
   ============================================ */

.loading-container {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    border: 1px solid var(--border);
    margin: 20px 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-grey);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-container, .empty-container {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    border: 1px solid var(--border);
    margin: 20px 0;
}

.error-icon, .empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
}

.error-icon {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.empty-icon {
    background: rgba(210, 105, 30, 0.1);
    color: var(--primary);
}

/* ============================================
   FILTERS SECTION
   ============================================ */

.events-filters {
    background-color: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    border: 1px solid var(--border);
}

.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-tab {
    padding: 12px 20px;
    border: 2px solid var(--light-grey);
    border-radius: 25px;
    background: transparent;
    color: var(--grey);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

.filter-tab.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-tab:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-stats {
    display: flex;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--light-grey);
    flex-wrap: wrap;
    justify-content: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--grey);
}

.stat-badge {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.stat-badge.upcoming { background: var(--success); color: white; }
.stat-badge.past { background: var(--grey); color: white; }
.stat-badge.total { background: var(--primary); color: white; }

/* ============================================
   EVENTS SECTIONS
   ============================================ */

.events-section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-grey);
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-icon {
    width: 45px;
    height: 45px;
    background-color: rgba(210, 105, 30, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 22px;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 30px;
}

/* ============================================
   EVENT CARD - WITH IMAGE FIX
   ============================================ */

.event-card {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    border-color: var(--primary);
}

/* IMAGE CONTAINER - FIXED ASPECT RATIO */
.event-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.event-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* FIX: Behoud aspect ratio */
    object-position: center;
    display: block;
}

/* FIX: Natuurlijke afmeting 381x200 voor enkele events - klein en gecentreerd */
.events-grid .event-card:only-child .event-image-container,
.events-section .events-grid .event-card:only-child .event-image-container {
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f5f5f5;
}

.events-grid .event-card:only-child .event-image,
.events-section .events-grid .event-card:only-child .event-image {
    width: 381px;
    height: 200px;
    max-width: 100%;
    object-fit: none;
    object-position: center;
}

/* FIX: Max-width voor enkele events */
.events-grid:has(.event-card:only-child) {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
}

.event-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
}

.event-status-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.status-upcoming {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.status-past {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #9ca3af;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.event-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(210, 105, 30, 0.15);
    color: var(--primary);
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Event header row met categories en date badge */
.event-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.event-date-badge {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 25px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(210, 105, 30, 0.3);
    text-align: center;
    min-width: 80px;
    flex-shrink: 0;
    white-space: nowrap;
}

.event-date-badge.past {
    background: var(--grey);
    box-shadow: 0 2px 10px rgba(102, 119, 136, 0.3);
}

.event-date-time {
    display: inline;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 0;
    opacity: 1;
}

.event-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.event-title {
    font-size: 1.4rem;
    color: var(--secondary);
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.3;
}

.event-organizer {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 15px;
    font-style: italic;
}

/* ============================================
   EXPANDABLE DESCRIPTION
   ============================================ */

.event-excerpt-container {
    margin-bottom: 20px;
    flex: 1;
}

.event-excerpt {
    color: var(--grey);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.event-excerpt.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-excerpt.expanded {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.read-more-btn {
    background: rgba(210, 105, 30, 0.1);
    border: 1px solid rgba(210, 105, 30, 0.2);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    padding: 6px 12px;
    margin: 5px 0 0 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    border-radius: 15px;
    font-family: inherit;
    line-height: 1.2;
}

.read-more-btn:hover {
    color: #b85c1a;
    background: rgba(210, 105, 30, 0.2);
    border-color: rgba(210, 105, 30, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(210, 105, 30, 0.2);
}

.read-more-btn .arrow {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
    margin-left: 2px;
    display: inline-block;
}

.read-more-btn.expanded .arrow {
    transform: rotate(180deg);
}

.event-excerpt.expanding {
    animation: fadeInDescription 0.4s ease;
}

@keyframes fadeInDescription {
    from { 
        opacity: 0.5;
        max-height: 4.5em;
    }
    to { 
        opacity: 1;
        max-height: 500px;
    }
}

/* ============================================
   EVENT META
   ============================================ */

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--grey);
}

.meta-icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

/* ============================================
   EVENT FOOTER
   ============================================ */

.event-footer {
    padding: 0 25px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: auto;
}

.event-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.event-type {
    font-size: 0.85rem;
    color: var(--grey);
    font-style: italic;
    flex-shrink: 0;
}

.event-button {
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    display: inline-block;
}

.event-button.primary {
    background-color: var(--primary);
    color: white !important;
}

.event-button.primary:hover {
    background-color: #b85c1a;
    transform: translateY(-2px);
    text-decoration: none;
    color: white !important;
}

.event-button.secondary {
    background-color: transparent;
    color: var(--primary) !important;
    border: 2px solid var(--primary);
}

.event-button.secondary:hover {
    background-color: var(--primary);
    color: white !important;
    text-decoration: none;
}

.event-button.tertiary {
    background-color: var(--light-grey);
    color: var(--grey) !important;
    border: 1px solid var(--border);
}

.event-button.tertiary:hover {
    background-color: var(--grey);
    color: white !important;
    text-decoration: none;
}

/* ============================================
   FEATURED EVENT
   ============================================ */

.featured-event {
    border: 2px solid var(--primary);
    position: relative;
}

.featured-badge {
    position: absolute;
    top: -1px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: 5px 15px;
    border-radius: 0 0 10px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(210, 105, 30, 0.3);
}

/* ============================================
   CTA SECTION
   ============================================ */

.events-cta {
    margin-top: 80px;
    background-color: var(--secondary);
    border-radius: 15px;
    padding: 50px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.events-cta h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: white !important;
    margin-top: 0;
}

.events-cta p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-block;
    padding: 14px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-align: center;
}

.primary-button {
    background-color: var(--primary);
    color: white !important;
}

.primary-button:hover {
    background-color: #b85c1a;
    transform: translateY(-2px) scale(1.02);
    text-decoration: none;
}

.secondary-button {
    background-color: transparent;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.secondary-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .fast-events-header h1 {
        font-size: 2.5rem;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
    }

    .event-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .event-actions {
        justify-content: center;
    }

    .event-type {
        text-align: center;
        margin-bottom: 15px;
    }

    .event-button {
        text-align: center;
        flex: 1;
        min-width: 120px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .events-cta {
        padding: 40px 25px;
    }

    .section-title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .section-icon {
        margin: 0 auto;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-card {
    animation: fadeInUp 0.6s ease forwards;
}