/* Upcoming Events Premium Styles - V4 (Responsive Perfection) */

:root {
    --primary-color: #800080;
    /* Purple */
    --accent-color: #ff5722;
    /* Orange/Red */
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

.upcoming-events-wrapper {
    background-color: var(--bg-light);
    font-family: 'Poppins', sans-serif;
    padding-bottom: 80px;
}

/* Hero Section */
.events-hero {
    background: linear-gradient(135deg, #2c3e50 0%, #800080 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
}

.events-hero-content {
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

.events-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.events-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Filter Bar Premium - V4 */
.events-filter-bar {
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: #ffffff;
    padding: 20px 30px;
    border-radius: 50px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    max-width: 1000px;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
    margin-top: -45px;
    position: relative;
    z-index: 10;
}

.filter-group {
    flex: 1;
    min-width: 200px;
    position: relative;
}

/* Custom Select Styling */
.filter-select {
    width: 100%;
    padding: 14px 40px;
    border-radius: 30px;
    border: 1px solid #e0e0e0;
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: var(--transition);
    cursor: pointer;
    background-color: #fcfcfc;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 12px auto;
    text-align: center;
    text-align-last: center;
}

.filter-select:hover {
    border-color: #ccc;
    background-color: #fff;
}

.filter-select:focus {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(128, 0, 128, 0.1);
}

.filter-select option {
    text-align: center;
}

.btn-reset {
    padding: 14px 35px;
    border: 1px solid #333;
    background: #333;
    color: #fff;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
    text-transform: uppercase;
    font-size: 0.9rem;
    cursor: pointer;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.btn-reset:hover {
    background: #000;
    border-color: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Events List Container */
.events-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 15px;
    /* Add padding for small screens */
}

/* Event List Card */
.event-card-list {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: stretch;
    transition: var(--transition);
    border: 1px solid #eee;
    overflow: hidden;
    min-height: 140px;
}

.event-card-list:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

/* Date Section */
.event-date-section {
    width: 120px;
    background-color: #fce4ec;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-right: 1px solid #ffeef5;
    position: relative;
    z-index: 1;
}

.date-box {
    text-align: center;
    color: #e91e63;
    width: 100%;
}

.date-box .day {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    color: #e91e63;
}

.date-box .month {
    display: block;
    font-size: 1rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Main Info */
.event-main-info {
    flex-grow: 1;
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.event-category-badge {
    background-color: #fff3e0;
    color: #f57c00;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
    align-self: flex-start;
}

.event-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.3;
}

.event-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.meta-item {
    display: flex;
    align-items: center;
}

.meta-item i {
    color: var(--primary-color);
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

/* Image & Action Section */
.event-action-section {
    width: 280px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-left: 1px solid #eee;
}

.event-thumb-small {
    width: 100px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.event-thumb-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-grow: 1;
}

.btn-register-now {
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.btn-register-now:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-register-now i {
    margin-left: 6px;
}

.event-status-text {
    font-size: 0.8rem;
    font-weight: 500;
}

.status-open {
    color: #28a745;
}

.status-filling {
    color: #ffc107;
    font-weight: 600;
}


/* =========================================
   RESPONSIVE STYLES
   ========================================= */

/* Tablet (Portrait & Landscape from 768px to 1024px) */
@media (max-width: 1024px) {
    .events-hero h1 {
        font-size: 2.5rem;
    }

    /* Filter Bar - Allow wrapping but keep distinct shape */
    .events-filter-bar {
        padding: 20px;
        flex-wrap: wrap;
        /* Allow wrapping */
        justify-content: center;
        /* Center content when wrapped */
        border-radius: 30px;
        margin-top: -30px;
    }

    .filter-group {
        min-width: 45%;
        /* 2 items per row max */
        flex: 1 1 40%;
    }

    .btn-reset {
        flex: 1 1 100%;
        /* Reset button takes full width of its row or floats */
        max-width: 200px;
        /* But limit width so it doesn't look weird */
    }

    /* Event Cards - Tighter spacing but still horizontal if possible */
    .event-card-list {
        flex-wrap: wrap;
        /* Allow parts to stack */
    }

    .event-main-info {
        padding: 15px;
        flex-basis: 60%;
        /* Take up most space */
    }

    .event-action-section {
        width: 100%;
        /* Push actions below on narrower tablets */
        border-left: none;
        border-top: 1px solid #eee;
        justify-content: flex-end;
        /* Align buttons to right */
        background-color: #fafafa;
    }
}

/* Mobile (Up to 767px) */
@media (max-width: 767px) {
    .events-hero {
        padding: 60px 0;
    }

    .events-hero h1 {
        font-size: 1.8rem;
    }

    /* Filter Bar - Stack Vertically */
    .events-filter-bar {
        flex-direction: column;
        border-radius: 20px;
        padding: 20px;
        margin-top: -30px;
        align-items: stretch;
        /* Full width items */
        gap: 12px;
    }

    .filter-group {
        width: 100%;
        min-width: auto;
    }

    .btn-reset {
        width: 100%;
        text-align: center;
        max-width: none;
    }

    /* Event Cards - Full Stack */
    .event-card-list {
        flex-direction: column;
    }

    /* Date Section */
    .event-date-section {
        width: 100%;
        height: auto;
        padding: 10px 0;
        flex-direction: row;
        gap: 10px;
        border-right: none;
        border-bottom: 1px solid #ffeef5;
    }

    .date-box .day {
        font-size: 1.4rem;
        display: inline-block;
        margin-right: 5px;
    }

    .date-box .month {
        font-size: 1rem;
        display: inline-block;
    }

    /* Content */
    .event-main-info {
        width: 100%;
        padding: 20px;
        border-bottom: 1px solid #eee;
    }

    .event-title {
        font-size: 1.1rem;
    }

    /* Actions */
    .event-action-section {
        width: 100%;
        border-left: none;
        justify-content: space-between;
        /* Space out img and buttons */
        background-color: #fff;
    }

    .event-thumb-small {
        width: 80px;
        height: 60px;
    }

    .action-buttons {
        align-items: flex-end;
    }
}