/**
 * FourBlock Events - Modern Grid/List View
 * Brand colors and card-based design
 */

/* Brand Colors */
:root {
    --fb-navy: #516681;
    --fb-red: #9E2124;
    --fb-blue: #1D478A;
    --fb-dark-navy: #1D3054;
    --fb-light-blue: #1890ff;
    --fb-hover-blue: #40a9ff;
    --fb-active-blue: #096dd9;
}

/* Events Grid Container */
.fourblock-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

/* Event Card */
.fourblock-event-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    border: none;
    position: relative;
}

.fourblock-event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(135deg, transparent 0%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
}

.fourblock-event-card:hover {
    box-shadow: 0 12px 32px rgba(81, 102, 129, 0.2);
    transform: translateY(-8px);
}

.fourblock-event-card:hover::before {
    background: linear-gradient(135deg, var(--fb-light-blue) 0%, var(--fb-blue) 100%);
    opacity: 1;
}

/* Event Card Image */
.fourblock-event-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--fb-navy) 0%, var(--fb-blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.fourblock-event-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="40" fill="rgba(255,255,255,0.1)">📅</text></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 80px;
}

.fourblock-event-image.has-image {
    background: none;
}

.fourblock-event-image.has-image::before {
    display: none;
}

.fourblock-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Event Badge */
.fourblock-event-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--fb-red);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fourblock-event-badge.virtual {
    background: var(--fb-light-blue);
}

.fourblock-event-badge.in-person {
    background: var(--fb-blue);
}

/* Event Card Body */
.fourblock-event-body {
    padding: 20px;
}

.fourblock-event-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--fb-dark-navy);
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fourblock-event-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.fourblock-event-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.65);
}

.fourblock-event-meta-item svg {
    width: 16px;
    height: 16px;
    fill: var(--fb-navy);
    flex-shrink: 0;
}

.fourblock-event-description {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.65);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Event Card Footer */
.fourblock-event-footer {
    padding: 12px 20px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fourblock-event-spots {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.65);
}

.fourblock-event-spots.limited {
    color: var(--fb-red);
    font-weight: 600;
}

.fourblock-event-cta {
    background: linear-gradient(135deg, var(--fb-light-blue) 0%, var(--fb-blue) 100%);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
}

.fourblock-event-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
}

.fourblock-event-cta:active {
    transform: translateY(0);
}

/* View Toggle */
.fourblock-view-toggle {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
}

.fourblock-view-toggle-label {
    font-size: 15px;
    color: var(--fb-dark-navy);
    font-weight: 600;
}

.fourblock-view-toggle-buttons {
    display: flex;
    gap: 0;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 12px;
}

.fourblock-view-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 8px;
}

.fourblock-view-btn:hover {
    color: var(--fb-dark-navy);
    background: rgba(255, 255, 255, 0.5);
}

.fourblock-view-btn.active {
    background: #fff;
    color: var(--fb-dark-navy);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* List View */
.fourblock-events-list .fourblock-event-card {
    display: flex;
    flex-direction: row;
}

.fourblock-events-list .fourblock-event-image {
    width: 280px;
    height: auto;
    min-height: 200px;
    flex-shrink: 0;
}

.fourblock-events-list .fourblock-event-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.fourblock-events-list .fourblock-event-body {
    flex: 1;
}

/* Filters */
.fourblock-filters {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 24px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    width: 100%;
}

.fourblock-filters-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.fourblock-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.fourblock-filter-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--fb-dark-navy);
}

.fourblock-filter-select {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.fourblock-filter-select:hover {
    border-color: var(--fb-light-blue);
}

.fourblock-filter-select:focus {
    outline: none;
    border-color: var(--fb-light-blue);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* Empty State */
.fourblock-empty-state {
    text-align: center;
    padding: 80px 20px;
}

.fourblock-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.fourblock-empty-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--fb-dark-navy);
    margin-bottom: 8px;
}

.fourblock-empty-text {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.45);
}

/* Loading State */
.fourblock-loading {
    text-align: center;
    padding: 60px 20px;
}

.fourblock-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: var(--fb-light-blue);
    border-radius: 50%;
    animation: fourblock-spin 0.8s linear infinite;
}

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

/* Event Details View (Modal) */
.event-details-view {
    animation: fadeIn 0.3s ease;
}

.event-details-image {
    width: 100%;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.event-details-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-details-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--fb-dark-navy);
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.event-details-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 24px;
}

.event-details-badge.virtual {
    background: rgba(24, 144, 255, 0.1);
    color: var(--fb-light-blue);
}

.event-details-badge.in-person {
    background: rgba(29, 71, 138, 0.1);
    color: var(--fb-blue);
}

.event-details-meta {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
    padding: 24px;
    background: #fafafa;
    border-radius: 12px;
}

.event-details-meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: rgba(0, 0, 0, 0.85);
}

.event-details-meta-item svg {
    width: 20px;
    height: 20px;
    fill: var(--fb-navy);
    flex-shrink: 0;
}

.event-details-description {
    margin-bottom: 32px;
}

.event-details-description h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--fb-dark-navy);
    margin: 0 0 16px 0;
}

.event-details-description p {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(0, 0, 0, 0.75);
    margin: 0;
}

.event-details-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #f0f0f0;
}

.event-details-register-btn {
    background: linear-gradient(135deg, var(--fb-light-blue) 0%, var(--fb-blue) 100%);
    color: #fff;
    border: none;
    padding: 16px 48px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 16px rgba(24, 144, 255, 0.3);
    display: inline-block;
    width: 100%;
    text-align: center;
}

.event-details-register-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(24, 144, 255, 0.4);
}

.event-details-register-btn:active {
    transform: translateY(0);
}

.event-full-notice {
    color: var(--fb-red);
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    padding: 16px;
    background: rgba(158, 33, 36, 0.1);
    border-radius: 8px;
}

/* Event Registration View (Modal) */
.event-registration-view {
    animation: fadeIn 0.3s ease;
}

.event-registration-view h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--fb-dark-navy);
    margin: 0 0 8px 0;
}

.event-registration-date {
    font-size: 16px;
    color: rgba(0, 0, 0, 0.65);
    margin-bottom: 32px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .fourblock-events-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .fourblock-events-list .fourblock-event-card {
        flex-direction: column;
    }

    .fourblock-events-list .fourblock-event-image {
        width: 100%;
        height: 200px;
    }

    .fourblock-filters-row {
        flex-direction: column;
    }

    .fourblock-filter-group {
        width: 100%;
    }

    .fourblock-view-toggle {
        flex-direction: column;
        align-items: flex-start;
    }

    .event-details-title {
        font-size: 24px;
    }

    .event-details-register-btn {
        font-size: 16px;
        padding: 14px 32px;
    }

    .event-details-image {
        height: 200px;
    }
}

/* Calendar View Integration */
.fourblock-calendar-wrapper.has-toggle {
    position: relative;
}

.fourblock-calendar-toggle {
    position: absolute;
    top: -60px;
    right: 0;
    z-index: 10;
}

/* Month Header */
.fourblock-month-header {
    background: linear-gradient(135deg, var(--fb-navy) 0%, var(--fb-blue) 100%);
    color: #fff;
    padding: 48px 32px;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 8px 24px rgba(81, 102, 129, 0.15);
}

.fourblock-month-title {
    font-size: 42px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.fourblock-month-subtitle {
    font-size: 18px;
    opacity: 0.95;
    margin-top: 8px;
    font-weight: 300;
}

.fourblock-month-eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    margin: 0 0 12px 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    opacity: 0.85;
}

.fourblock-month-description {
    margin-top: 16px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    max-width: 640px;
}

.fourblock-month-inner {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.fourblock-month-copy {
    flex: 1 1 320px;
    max-width: 640px;
}

.fourblock-month-meta {
    flex: 1 1 260px;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 24px;
    min-width: 260px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.fourblock-month-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.fourblock-month-list {
    list-style: none;
    margin: 20px 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fourblock-month-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
}

.fourblock-month-list-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    margin-top: 2px;
}

.fourblock-month-list-icon::after {
    content: '✓';
}

.fourblock-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .fourblock-month-header {
        padding: 32px 24px;
    }

    .fourblock-month-title {
        font-size: 32px;
    }

    .fourblock-controls {
        margin-bottom: 24px;
    }

    .fourblock-month-meta {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .fourblock-controls {
        gap: 12px;
    }

    .fourblock-month-meta {
        padding: 20px;
    }

    .fourblock-month-list {
        gap: 12px;
    }

    .fourblock-month-list li {
        font-size: 13px;
    }
}

@media (min-width: 1024px) {
    .fourblock-controls {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 24px;
    }

    .fourblock-controls .fourblock-view-toggle {
        flex: 0 0 auto;
    }

    .fourblock-controls .fourblock-filters {
        flex: 1 1 auto;
    }
}
