/* Community-led Events Page Specific Styles */

/* Event card specific styles to match the screenshot */
.event-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    overflow: hidden;
    position: relative;
    max-width: 100%;
    height: 100%;
}

.event-card-header {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Cover image at the top of the card */
.event-cover-image {
    width: 100%;
    height: 80px;
    background-size: cover;
    background-position: top left;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    padding: 16px;
}

/* Cover content area with title overlay */
.event-cover-content {
    background: none;
    padding: 0;
    position: relative;
    z-index: 2;
    flex: 1;
    margin-left: 16px;
    margin-right: 56px;
    display: flex;
    align-items: center;
}

.event-cover-content .event-title {
    margin: 0;
    font-size: 1.1em;
    font-weight: 700;
    line-height: 1.3;
    color: var(--isoc-blue);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.event-cover-content .event-title a {
    color: var(--isoc-blue);
    text-decoration: none;
    transition: all 0.2s;
}

.event-cover-content .event-title a:hover {
    color: var(--isoc-blue);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

/* Ensure text readability over cover image */
.event-card-header .event-content {
    background: white;
    position: relative;
    z-index: 2;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.event-card-header .event-date-badge {
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(2px);
    position: relative;
    z-index: 3;
    flex-shrink: 0;
}

.event-date-badge {
    background-color: #f8f9fa;
    padding: 8px 10px;
    text-align: center;
    min-width: 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #e9ecef;
    position: relative;
}

.event-date-badge::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #d1d9e6, transparent);
}

.event-month {
    font-size: 0.65em;
    font-weight: 500;
    font-weight: 500;
    color: #757575;
    letter-spacing: 0.3px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.event-day {
    font-size: 1.4em;
    font-weight: 600;
    color: #666;
    line-height: 1;
    margin-top: 2px;
}

.event-card-header {
    display: flex;
    flex: 1;
    gap: 0;
}

a.event-card-header {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.event-card-header:hover .event-title {
    color: var(--isoc-blue);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.event-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.event-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 16px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.event-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.event-type-badge {
    background-color: #e9ecef;
    color: #212529;
    border: 1px solid #dee2e6;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.65em;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Category badges with dark backgrounds */
.event-type-badge[style*="background-color: #555"],
.event-type-badge[style*="background-color:#555"] {
    color: #ffffff !important;
    border-color: #666;
}

/* Category badges with other dark backgrounds */
.event-type-badge[style*="background-color: #"] {
    filter: brightness(1.2);
}

/* Ensure white text for any badge with dark background */
.event-type-badge[style*="background"] {
    color: #ffffff;
}

.event-description {
    color: #555;
    font-size: 0.9em;
    line-height: 1.4;
    margin: 0;
    height: 5.6em;
    /* Fixed height for exactly 4 lines */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}

.event-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 6px;
}

.event-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.event-meta-item i {
    color: #757575;
    font-size: 0.85em;
    opacity: 0.8;
}

.event-organizer {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 4px;
}

.event-organizer i {
    color: #adb5bd;
    font-size: 0.85em;
    opacity: 0.8;
}

.event-register-btn {
    background-color: #008996;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    height: 25px;
    min-width: 25px;
    flex-shrink: 0;
}

.event-register-btn:hover {
    background-color: #006d7a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 137, 150, 0.3);
}

.event-register-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;
}

.event-register-btn:hover::before {
    left: 100%;
}

.event-calendar-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: white;
    border: none;
    color: #adb5bd;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    z-index: 10;
}

/* Override conflicting styles from main styles.css */
.event-calendar-btn.add-to-calendar {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    bottom: auto !important;
    width: auto !important;
    height: auto !important;
    opacity: 1 !important;
}

.event-calendar-btn:hover {
    background-color: rgba(36, 54, 110, 0.05);
    color: var(--isoc-blue);
    transform: scale(1.1);
}

.event-calendar-btn:hover::after {
    content: 'Add to calendar';
    position: absolute;
    right: 100%;
    margin-right: 8px;
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    white-space: nowrap;
    z-index: 10;
}

.event-calendar-btn i {
    font-size: 1em;
    display: block;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .event-card {
        flex-direction: column;
    }

    .event-card-header {
        flex-direction: column;
    }

    .event-cover-image {
        height: 70px;
        padding: 12px;
    }

    .event-cover-content {
        margin-left: 12px;
        margin-right: 48px;
        padding: 0;
    }

    .event-cover-content .event-title {
        font-size: 1em;
    }

    .event-date-badge {
        background: rgba(248, 249, 250, 0.95);
        backdrop-filter: blur(2px);
        flex-shrink: 0;
    }

    .event-month {
        font-size: 0.7em;
        opacity: 0.8;
    }

    .event-day {
        font-size: 1.2em;
        font-weight: 600;
        color: #666;
    }

    .event-content {
        padding: 16px;
        padding-bottom: 16px;
    }

    .event-title {
        font-size: 1.15em;
        font-weight: 700;
        margin-top: 4px;
    }

    /* Adjust calendar button position for mobile */
    .event-calendar-btn {
        top: 8px;
        right: 8px;
        min-width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .event-calendar-btn.add-to-calendar {
        top: 8px !important;
        right: 8px !important;
    }
}

/* Responsive 2-column grid for community-led events */
#community-events .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    align-items: stretch;
    max-width: 1200px;
    margin: 0 auto;
}

#community-events .card-grid .event-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    #community-events .card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 600px;
    }
}

/* Ultra-wide screens - maintain 2 columns but allow wider cards */
@media (min-width: 1400px) {
    #community-events .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
        max-width: 1400px;
    }
}

/* Filters section */
.filters-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin: 10px auto 30px auto;
    max-width: 1024px;
    box-sizing: border-box;
    display: none;
}

.filters-section.show {
    display: block;
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-col label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #0066aa;
    margin-bottom: 6px;
}

.filter-col label i {
    margin-right: 5px;
}

.event-filter {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95em;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.event-filter:focus {
    outline: 2px solid var(--isoc-blue);
    outline-offset: 2px;
    border-color: var(--isoc-blue);
}

.event-count {
    font-size: 0.9em;
    color: #777;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .filters-row {
        grid-template-columns: 1fr;
    }
}

/* Subscription buttons */
.subscription-controls {
    max-width: 1024px;
    margin: 0 auto 15px auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    position: relative;
}

.sub-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: white;
    color: var(--isoc-blue);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.sub-btn:hover {
    background-color: #f0f7ff;
    border-color: var(--isoc-blue);
    transform: translateY(-1px);
}

.sub-btn i {
    font-size: 1em;
}

/* Event table specific styles for cleaner UX */
.event-table td {
    padding: 16px 12px;
}

.event-name-cell {
    min-width: 250px;
}

.event-name {
    font-weight: 600;
    font-size: 1em;
    margin-bottom: 4px;
    line-height: 1.4;
}

.event-name a {
    color: var(--isoc-blue);
    text-decoration: none;
}

.event-name a:hover {
    text-decoration: underline;
}

.event-metadata {
    font-size: 0.85em;
    color: #777;
    margin-top: 4px;
}

.event-when-cell {
    min-width: 140px;
    white-space: nowrap;
}

.event-when-cell div:first-child {
    font-weight: 500;
    color: #333;
}

.event-time {
    font-size: 0.9em;
    color: #666;
    margin-top: 2px;
}

.event-where-cell {
    min-width: 150px;
    color: #555;
}

.event-action-cell {
    text-align: right;
    min-width: 100px;
}

.table-register-link {
    display: inline-block;
    background-color: white;
    color: var(--isoc-blue);
    border: 1px solid var(--isoc-blue);
    padding: 6px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s;
}

.table-register-link:hover {
    background-color: var(--isoc-blue);
    color: white;
}

/* Modal Dialog Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    overflow: hidden;
    position: relative;
}

.modal-close-outside {
    position: absolute;
    top: 16px;
    right: 16px;
    background: white;
    border: 1px solid #ddd;
    font-size: 1em;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-outside:hover {
    background-color: #f8f9fa;
    border-color: #999;
    color: var(--isoc-black);
}

.modal-body {
    padding: 0;
    height: 650px;
    overflow: hidden;
}

.modal-body iframe {
    border: none;
    width: 100%;
    height: 100%;
}

/* Mobile responsive for modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95vw;
        max-height: 95vh;
    }

    .modal-close-outside {
        top: 12px;
        right: 12px;
        padding: 6px;
        font-size: 0.9em;
        width: 28px;
        height: 28px;
    }

    .modal-body {
        height: 550px;
    }

    .subscription-controls {
        display: grid;
        grid-template-rows: auto auto;
        gap: 10px;
        justify-content: center;
        text-align: center;
    }

    .subscription-controls .sub-btn:nth-child(1),
    .subscription-controls .sub-btn:nth-child(2) {
        grid-row: 1;
        display: inline-flex;
    }

    .subscription-controls .sub-btn:nth-child(3),
    .subscription-controls .sub-btn:nth-child(4) {
        grid-row: 2;
        display: inline-flex;
    }

    .event-count {
        font-size: 0.85em;
    }
}

/* Fix action column header to match other headers */
.event-table th:last-child {
    background-color: var(--isoc-blue);
    color: white;
}

/* Month divider styles */
.month-divider {
    display: flex;
    align-items: center;
    margin: 24px 0 16px 0;
    padding: 0 16px;
    grid-column: 1 / -1;
}

.month-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
    opacity: 0.6;
}

.month-divider-label {
    padding: 0 16px;
    font-size: 0.9em;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    white-space: nowrap;
}

/* Responsive adjustments for month dividers */
@media (max-width: 768px) {
    .month-divider {
        margin: 20px 0 12px 0;
        padding: 0 8px;
    }

    .month-divider-label {
        font-size: 0.85em;
        padding: 0 12px;
    }
}

/* Changes to main css */

.section-content,
.section-header-container {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Mobile sidebar month navigation styles */
.nav-month-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 15px 0;
    width: 100%;
}

.nav-month-link {
    color: var(--isoc-light-gray) !important;
    text-decoration: none !important;
    padding: 10px 15px !important;
    margin: 3px 0 !important;
    border-radius: 4px !important;
    transition: background-color 0.2s ease !important;
    font-size: 0.9em !important;
    font-weight: 500 !important;
    opacity: 0.9 !important;
}

.nav-month-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    opacity: 1 !important;
}

/* Only show month links on mobile */
@media (min-width: 1025px) {
    .nav-month-divider,
    .nav-month-link {
        display: none !important;
    }
}

/* Past events section styles */
.past-events-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.past-events-section .section-header {
    margin-bottom: 20px;
    color: #666;
}

.past-events-section .section-header i {
    color: #999;
}

.past-events-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.past-event-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.past-event-card:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.past-event-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.past-event-link {
    text-decoration: none;
    color: inherit;
}

.past-event-link:hover .past-event-title {
    color: var(--isoc-blue);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.past-event-title {
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    color: #555;
    line-height: 1.3;
}

.past-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85em;
    color: #777;
}

.past-event-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.past-event-meta i {
    color: #999;
    font-size: 0.85em;
}

.past-event-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.past-event-type,
.past-event-category {
    background-color: #e9ecef;
    color: #666;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.past-event-organizer {
    font-size: 0.8em;
    color: #888;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.past-event-organizer i {
    color: #bbb;
    font-size: 0.85em;
}

/* Responsive adjustments for past events */
@media (max-width: 768px) {
    .past-events-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .past-event-card {
        padding: 14px;
    }
    
    .past-event-meta {
        gap: 10px;
    }
    
    .past-events-section {
        margin-top: 30px;
        padding-top: 20px;
    }
}