* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b35;
    --secondary-color: #004e89;
    --dark-bg: #1a1a1a;
    --light-bg: #f5f5f5;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #ddd;
    --success-color: #28a745;
    --error-color: #dc3545;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.site-brand-text h1 {
    margin-bottom: 0.15rem;
    line-height: 1.1;
}

.site-brand-text p {
    margin: 0;
}

.site-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

main {
    padding: 2rem 0;
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-row {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.search-container {
    position: relative;
    width: 100%;
    margin: 0;
}

.date-filter-row {
    margin: 0.75rem auto 0;
    max-width: 1000px;
    display: flex;
    gap: 0.75rem;
    align-items: end;
    flex-wrap: wrap;
}

.date-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 180px;
    flex: 1;
}

.date-filter-group label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.date-filter-group input[type="date"] {
    padding: 0.6rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
}

.clear-dates-btn {
    border: none;
    background: var(--text-light);
    color: #fff;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
}

.clear-dates-btn:hover {
    background: var(--text-dark);
}

#citySearch,
#countrySearch,
#eventNameSearch {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    outline: none;
    transition: all 0.3s;
    background: #fff;
}

#citySearch:focus,
#countrySearch:focus,
#eventNameSearch:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-light);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.clear-btn:hover {
    background: var(--text-dark);
}

.search-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    z-index: 40;
    max-height: 220px;
    overflow-y: auto;
}

.search-suggestion-item {
    padding: 0.55rem 0.85rem;
    font-size: 0.95rem;
    cursor: pointer;
}

.search-suggestion-item:hover {
    background: #f3f7fb;
}

/* Map Section */
.map-section {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0.75rem;
    margin-bottom: 3rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    clear: both;
    position: relative;
    z-index: 1;
}

.map-container {
    width: 100%;
    aspect-ratio: 5 / 3;
    height: auto;
    min-height: 320px;
    background: #e0e0e0;
    position: relative;
}

/* Map container styles */
#map {
    width: 100%;
    height: 100%;
}

.custom-marker {
    background: transparent !important;
    border: none !important;
}

/* Location filter section */
.location-section {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.location-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.location-btn {
    background: var(--secondary-color);
    color: white;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.25s, transform 0.1s;
}

.location-btn:hover {
    background: #0360aa;
    transform: translateY(-1px);
}

.distance-control {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.distance-control label {
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
}

.distance-control input[type="range"] {
    width: 100%;
}

.location-status {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Demo user switcher */
.user-switcher {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 999px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.user-switcher-info {
    color: #f1f1f1;
}

.user-switcher-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.user-switcher-btn {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.user-switcher-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.user-switcher-btn-secondary {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.25);
}

/* Events Section */
.events-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--secondary-color);
}

.controls {
    display: flex;
    gap: 1rem;
}

.controls select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s;
}

.controls select:focus {
    border-color: var(--primary-color);
}

.events-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.event-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.event-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.event-content {
    padding: 1.5rem;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.event-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.event-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.event-details {
    margin-bottom: 1rem;
}

.event-detail {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.event-detail strong {
    margin-right: 0.5rem;
    color: var(--text-dark);
}

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

.no-events {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Submit Form */
.submit-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.submit-section h2 {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
}

.submit-btn {
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
}

.submit-btn:hover {
    background: #e55a2b;
}

.submit-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 5px;
    display: none;
}

.form-message.success {
    background: #d4edda;
    color: var(--success-color);
    border: 1px solid #c3e6cb;
    display: block;
}

.form-message.error {
    background: #f8d7da;
    color: var(--error-color);
    border: 1px solid #f5c6cb;
    display: block;
}

/* Auth modal */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.auth-modal-card {
    position: relative;
    width: min(460px, calc(100% - 24px));
    margin: 8vh auto 0;
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem 1.25rem 1rem;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.auth-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: 0;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-light);
}

.auth-form {
    display: grid;
    gap: 0.75rem;
}

.event-types-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
}

.event-types-group label {
    margin: 0;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sponsors-rows .sponsor-row input {
    min-width: 0;
}

.inline-link-btn {
    display: inline;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    color: var(--primary-color);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.inline-link-btn:hover {
    color: #e55a2b;
}

footer {
    background: var(--dark-bg);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .search-row {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .map-container {
        min-height: 260px;
    }
    
    .events-list {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls {
        width: 100%;
    }
    
    .controls select {
        flex: 1;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}
