/* assets/css/events.css */
/* --- Modern CSS Variables --- */
:root {
    --primary: #008753;
    --primary-dark: #0066cc;
    --primary-light: #4da6ff;
    --secondary: #00bfff;
    --accent: #ff6b6b;
    --success: #28a745;
    --text-dark: #2D3748;
    --text-light: #718096;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

/* --- Events Styling --- */
body {
    background: 
        radial-gradient(circle at 20% 80%, rgba(250, 239, 239, 0.959) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(238, 229, 229, 0.979) 0%, #e8ebf1f8 50%),
        radial-gradient(circle at 40% 40%, rgb(224, 218, 218) 0%, transparent 50%);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Fix mobile spacing for bottom nav */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px !important;
    }
    
    body.logged-in footer,
    body.logged-in .site-footer {
        display: none !important;
    }
    
    .main-content-wrapper {
        padding-bottom: 2rem !important;
    }
    
    /* Ensure last item is not covered */
    #events-grid {
        margin-bottom: 1.5rem;
    }
}

.main-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
    flex-grow: 1;
}

/* --- Header Section --- */
.events-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 1.5rem 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

.events-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.header-text h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.5rem 0;
}

.header-text .subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin: 0;
}

/* Location Auto Filter Message */
.location-auto-filter {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(0, 135, 83, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    max-width: 500px;
}

.location-auto-filter p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.location-auto-filter small {
    font-size: 0.8rem;
    color: var(--text-light);
    display: block;
}

.location-auto-filter .btn-secondary {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

.desktop-view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-light);
    padding: 0.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.view-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.view-btn.active {
    background: var(--bg-white);
    color: var(--text-dark);
    box-shadow: var(--shadow-sm);
}

.view-btn:hover:not(.active) {
    background: rgba(0, 135, 83, 0.1);
}

.view-icon {
    font-size: 1.1rem;
}

.view-label {
    font-size: 0.9rem;
}

.events-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* --- Action Buttons --- */
.create-event-btn, .my-events-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

.create-event-btn {
    background: var(--gradient-primary);
    color: white;
}

.create-event-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.my-events-btn {
    background: rgba(30, 144, 255, 0.1);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.my-events-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* --- Location Filter Bar (Top) --- */
.location-filter-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 135, 83, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(0, 135, 83, 0.2);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.location-filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 300px;
}

.location-filter-group label {
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

.location-filter-select {
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    flex: 1;
    background: white;
    cursor: pointer;
    min-width: 200px;
}

.location-filter-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 135, 83, 0.1);
}

.location-filter-select:disabled {
    background-color: var(--bg-light);
    cursor: not-allowed;
    opacity: 0.7;
}

.location-filter-note {
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
}

.location-filter-note a {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}

.clear-location-btn {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 2px solid #fecaca;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.clear-location-btn:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

/* --- Mobile Header Controls --- */
.mobile-header-controls {
    display: none;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.mobile-view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-light);
    padding: 0.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    align-self: flex-start;
}

.mobile-search {
    width: 100%;
}

.mobile-search input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.mobile-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.1);
    outline: none;
}

/* --- Events Container --- */
.events-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

/* --- Sidebar Styling --- */
.events-sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: fit-content;
    position: sticky;
    top: 120px;
}

.sidebar-search {
    margin-bottom: 1.5rem;
}

.sidebar-search input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.sidebar-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.1);
    outline: none;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-icon {
    font-size: 1.2rem;
}

.sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 0.25rem;
}

.sidebar-item:hover {
    background: rgba(0, 135, 83, 0.1);
    color: var(--text-dark);
}

.sidebar-item.active {
    background: var(--primary);
    color: white;
    font-weight: 500;
}

.sidebar-item .item-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.item-text {
    flex: 1;
    font-size: 0.95rem;
}

/* Sort Options in Sidebar */
.sort-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sort-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-option:hover {
    background: rgba(0, 135, 83, 0.05);
}

.sort-option input[type="radio"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.sort-option span {
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* Event Type Filter */
.event-type-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.event-type-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.event-type-option:hover {
    background: rgba(0, 135, 83, 0.05);
}

.event-type-option input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.event-type-option span {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.apply-filters-btn {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: var(--shadow-md);
}

.apply-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* --- Main Content Area --- */
.events-content {
    min-width: 0; /* Prevent grid blowout */
}

/* --- Mobile Category Icons (Show all) --- */
.mobile-category-icons {
    display: none;
    margin-bottom: 1.5rem;
}

.category-icons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.icon-category {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.25rem;
    border-radius: 10px;
    background: var(--bg-white);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    text-align: center;
    position: relative;
    min-height: 70px;
}

.icon-category:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.icon-category.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.icon-category.event-item-icon {
    background: linear-gradient(135deg, #008753, #00bfff);
    color: white;
    border-color: #008753;
}

.icon-category.event-item-icon.locked {
    background: linear-gradient(135deg, #666, #999);
    color: white;
    border-color: #666;
}

.lock-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-category .icon {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.icon-category .label {
    font-size: 0.7rem;
    line-height: 1.1;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.2em;
}

/* --- Quick Filter Chips --- */
.filter-chips {
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.filter-chip {
    padding: 0.4rem 0.8rem;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 18px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-chip:hover {
    background: rgba(0, 135, 83, 0.1);
    border-color: var(--primary);
}

.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* --- Desktop Sort Controls --- */
.desktop-sort-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.sort-by {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-by label {
    font-weight: 500;
    color: var(--text-dark);
}

.sort-by select {
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    min-width: 180px;
}

.sort-by select:focus {
    border-color: var(--primary);
    outline: none;
}

.results-count {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

/* --- Events Grid --- */
#events-grid {
    display: grid;
    gap: 1.5rem;
}

/* Grid View - 3 items per row on desktop, 2 on mobile */
.grid-view {
    grid-template-columns: repeat(3, 1fr);
}

/* List View */
.list-view {
    grid-template-columns: 1fr;
}

/* Desktop List View */
@media (min-width: 1025px) {
    .list-view .event-card {
        flex-direction: row;
        min-height: 200px;
    }
    
    .list-view .event-image {
        width: 220px;
        height: 200px;
        flex-shrink: 0;
    }
    
    .list-view .event-content {
        flex: 1;
        padding: 1.5rem;
        display: flex;
        flex-direction: column;
    }
    
    .list-view .event-title {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .list-view .event-date {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .list-view .event-description {
        -webkit-line-clamp: 2;
        flex-grow: 1;
    }
    
    .list-view .event-meta {
        flex-direction: row;
        justify-content: space-between;
        gap: 1rem;
        margin-top: auto;
        padding-top: 1rem;
    }
}

/* Mobile List View (Compact) */
@media (max-width: 1024px) {
    .list-view .event-card {
        flex-direction: column;
        min-height: auto;
    }
    
    .list-view .event-image {
        width: 100%;
        height: 180px;
    }
    
    .list-view .event-content {
        padding: 1rem;
    }
    
    .list-view .event-card-header {
        padding: 1rem;
    }
    
    .list-view .event-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .list-view .event-date {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .list-view .event-description {
        -webkit-line-clamp: 2;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .list-view .event-meta {
        flex-direction: row;
        justify-content: space-between;
        gap: 0.5rem;
        padding-top: 0.5rem;
        font-size: 0.85rem;
    }
}

/* --- Event Cards --- */
.event-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

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

.event-card-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.organizer-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.organizer-info h5 {
    font-weight: 700;
    margin: 0;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.organizer-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-light);
}

.event-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.event-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-date {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.event-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--success);
    margin-bottom: 0.75rem;
}

.event-description {
    color: var(--text-light);
    margin-bottom: 0.75rem;
    line-height: 1.5;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9rem;
}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

.event-location, .event-category {
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-location::before {
    content: "📍";
}

.event-category::before {
    content: "🏷️";
}

.event-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.event-card:hover .event-image img {
    transform: scale(1.05);
}

/* Event Status Badges */
.event-card-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 135, 83, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
    backdrop-filter: blur(4px);
}

.owner-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(111, 66, 193, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
    backdrop-filter: blur(4px);
}

.ticket-availability {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

.ticket-sold-out {
    font-size: 0.8rem;
    color: #dc3545;
    margin-top: 5px;
}

/* --- Loading State --- */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    grid-column: 1 / -1;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.loading-state p {
    color: var(--text-light);
    font-size: 1rem;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.empty-state p {
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1rem;
}

.empty-state-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.empty-state-actions .btn-primary,
.empty-state-actions .btn-secondary {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

/* --- Load More Button --- */
.load-more-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 2rem auto 0;
    max-width: 300px;
    box-shadow: var(--shadow-md);
    grid-column: 1 / -1;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .events-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .events-sidebar {
        display: none;
    }
    
    .mobile-header-controls,
    .mobile-category-icons,
    .filter-chips {
        display: flex;
    }
    
    .desktop-sort-controls {
        display: none;
    }
    
    .events-header-top {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }
    
    .desktop-view-toggle {
        display: none;
    }
    
    .location-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .location-filter-group {
        flex-direction: column;
        align-items: flex-start;
        min-width: auto;
    }
    
    .location-filter-select {
        width: 100%;
    }
    
    .clear-location-btn {
        align-self: flex-start;
    }
    
    /* Grid view - 2 items per row on tablet/mobile */
    .grid-view {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Mobile category grid */
    .category-icons-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .main-content-wrapper {
        padding: 1rem;
    }
    
    .events-header {
        padding: 1rem;
    }
    
    .header-text h1 {
        font-size: 2rem;
    }
    
    .events-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .events-actions .create-event-btn,
    .events-actions .my-events-btn {
        width: 100%;
        justify-content: center;
    }
    
    .category-icons-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.4rem;
    }
    
    .icon-category {
        min-height: 65px;
    }
    
    .icon-category .icon {
        font-size: 1.1rem;
    }
    
    .icon-category .label {
        font-size: 0.65rem;
    }
    
    .filter-chips {
        overflow-x: auto;
        padding-bottom: 0.5rem;
        flex-wrap: nowrap;
    }
    
    .filter-chip {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .main-content-wrapper {
        padding: 0.5rem;
    }
    
    .events-header {
        padding: 1rem 0.75rem;
        border-radius: 12px;
    }
    
    .header-text h1 {
        font-size: 1.75rem;
    }
    
    .category-icons-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Grid view - 1 item per row on very small mobile */
    @media (max-width: 360px) {
        .grid-view {
            grid-template-columns: 1fr;
        }
        
        .category-icons-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }
    
    .empty-state-actions {
        flex-direction: column;
    }
    
    .empty-state-actions button,
    .empty-state-actions a {
        width: 100%;
    }
}

/* --- Focus States for Accessibility --- */
.event-card:focus,
.create-event-btn:focus,
.my-events-btn:focus,
.view-btn:focus,
.sidebar-item:focus,
.filter-chip:focus,
.load-more-btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* --- Modal Styling (from events.php) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 1rem;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--text-light);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    color: var(--text-dark);
    background: rgba(0, 0, 0, 0.05);
}

/* Ticket Tier Styling */
.btn-add-tier {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-add-tier:hover {
    background: #218838;
}

.ticket-tier {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.tier-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tier-field-full {
    grid-column: 1 / -1;
}

.btn-remove-tier {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-remove-tier:hover {
    background: #c82333;
}

/* Payment Setup Modal */
.payment-setup-modal .modal-content {
    max-width: 500px;
}

.payment-setup-content {
    text-align: center;
    padding: 20px;
}

.payment-setup-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.payment-setup-buttons {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-payment-setup {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background-color 0.2s;
}

.btn-payment-primary {
    background-color: #28a745;
    color: white;
}

.btn-payment-primary:hover {
    background-color: #218838;
}

.btn-payment-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-payment-secondary:hover {
    background-color: #5a6268;
}

/* Loading button */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Active Filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.active-filters .filter-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 135, 83, 0.1);
    border-color: var(--primary);
}

.remove-chip {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-chip:hover {
    color: #dc2626;
}

/* Image Preview */
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-preview-item:hover .remove-image-btn {
    opacity: 1;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    border: none;
}