/*
Theme Name: Festivie
Description: Thème événementiel pour Festivie
Version: 1.0.0
Author: Festivie
*/



:root {
    --primary: #ff6b6b;
    --secondary: #4ecdc4;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --border: #e0e0e0;
}

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

html {
    scrollbar-gutter: stable;
}

html, body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fff;
    color: var(--text-dark);
}

button, input, select, textarea {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    padding-bottom: 90px;
}

.header {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 15px;
    height: 85px;
    transition: height 0.3s ease, padding 0.3s ease;
    overflow: visible !important;
}

.header.compact {
    height: 70px;
}

body.admin-bar .header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .header {
        top: 46px;
    }
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex: 0 0 auto;
    height: 100%;
    line-height: 1;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 40px;
    color: var(--text-dark);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
    line-height: 1;
    vertical-align: middle;
    padding: 0;
}

.logo:hover {
    opacity: 0.8;
}

.add-event-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #ff5252 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0 16px;
    height: 40px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-event-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.35);
}

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

.header-center {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    justify-content: center;
    height: 100%;
    overflow: visible !important;
    position: relative;
}

.header-right {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    height: 100%;
}

.hamburger-menu {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    color: var(--text-dark);
    transition: all 0.3s ease;
    z-index: 2000;
    position: relative;
    height: 100%;
    min-height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    vertical-align: middle;
}

.hamburger-menu.active {
    font-size: 28px;
    transform: rotate(90deg);
}

@media (min-width: 769px) {
    .hamburger-menu {
        display: none !important;
    }
    
    .mobile-menu-overlay {
        display: none !important;
    }
    
    .mobile-menu {
        display: none !important;
    }
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background: white;
    z-index: 1600;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text-dark);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.2s ease;
}

.mobile-menu-close:active {
    transform: scale(1.1);
}

.mobile-menu-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-menu-item {
    padding: 14px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s ease;
    display: block;
}

.mobile-menu-item:active {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .header {
        padding: 8px 16px;
        height: auto;
        flex-direction: column;
        gap: 8px;
    }
    
    .header-left {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex: 0 0 auto;
        height: 40px;
        width: 100%;
        position: relative;
    }
    
    .hamburger-menu {
        position: fixed;
        left: 16px;
        height: 40px;
        width: 40px;
        top: 15px;
        z-index: 2001;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
    }
    
    .logo {
        flex: 1;
        text-align: center;
    }
    
    .header-center {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        flex: 0 0 auto;
        max-width: calc(100% + 32px);
        margin: 0 -16px;
    }
    
    .header-right {
        display: flex;
        align-items: center;
        flex: 0 0 auto;
        height: auto;
    }
    
    .logo {
        font-size: 24px;
        font-weight: 700;
        white-space: nowrap;
        flex: 1;
        height: 100%;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        vertical-align: middle;
        padding: 0;
    }
    
    .add-event-btn {
        font-size: 12px;
        padding: 0 14px;
        height: 38px;
        border-radius: 19px;
        flex: 0 0 auto;
        display: none;
    }
    
    .hamburger-menu {
        display: flex;
        font-size: 24px;
        z-index: 2000;
        padding: 0;
        position: relative;
        height: 100%;
        min-height: 40px;
        width: 40px;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        line-height: 1;
        vertical-align: middle;
    }
    
    .search-group {
        display: flex;
        gap: 8px;
        align-items: center;
        flex: 0 0 auto;
        width: 100%;
        padding: 0 16px;
    }
    
    .search-input {
        font-size: 15px;
        height: 42px;
        border-radius: 21px;
        padding: 0 16px;
        flex: 1;
    }
    
    .search-btn {
        font-size: 18px;
        padding: 0 16px;
        margin-right: 0;
        height: 42px;
        flex: 0 0 auto;
    }
    
    .search-btn-mobile {
        display: none !important;
    }
    
    .city-geo-group {
        display: flex;
        gap: 9px;
        width: 100%;
        padding: 0 16px;
    }
    
    .city-dropdown {
        position: relative;
        flex: 1;
        max-width: 250px;
    }
    
    .city-input {
        font-size: 15px;
        height: 42px;
        border-radius: 21px;
        padding: 0 16px;
        width: 100%;
        border: 1px solid var(--border);
        background: white;
    }
    
    .city-dropdown-list {
        position: absolute;
        top: 100%;
        left: 0;
        background: white;
        border: 1px solid var(--border);
        border-top: none;
        border-radius: 0 0 21px 21px;
        max-height: 300px;
        overflow-y: auto;
        z-index: 10000;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        display: none;
        margin-top: 0;
        padding: 0;
        width: auto;
        min-width: 100%;
        max-width: none;
        white-space: nowrap;
    }
    
    .city-dropdown-list div {
        padding: 12px 16px;
        cursor: pointer;
        border-bottom: 1px solid var(--border);
        transition: background-color 0.2s ease;
        color: var(--text-dark);
        font-size: 14px;
        white-space: nowrap;
    }
    
    .city-dropdown-list div:first-child {
        padding-top: 8px;
    }
    
    .city-dropdown-list div:last-child {
        border-bottom: none;
        padding-bottom: 8px;
    }
    
    .city-dropdown-list div:hover {
        background-color: var(--primary);
        color: white;
    }
    
    .city-dropdown-list div:active {
        background-color: #ff5252;
    }
    
    .city-search-btn {
        border-radius: 21px;
        padding: 0 12px;
        height: 42px;
        font-size: 14px;
        flex: 0 0 auto;
    }
    
    .geo-btn {
        border-radius: 21px;
        padding: 0 16px;
        height: 42px;
        font-size: 14px;
        flex: 0 0 auto;
    }
}

main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

main.page-content {
    max-width: 800px;
    padding: 20px;
    margin-top: 0;
}

.page-content h1 {
    font-size: 22px;
    font-weight: 600;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
    margin-top: 20px;
}

.event-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 30px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.15);
}

.event-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--bg-light) 0%, #f0f0f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    overflow: hidden;
    position: relative;
}

.event-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: relative;
    z-index: 1;
}

.event-date-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff5252 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    text-align: center;
    line-height: 1.1;
}

.event-date-badge-day {
    display: block;
    font-size: 14px;
    font-weight: 800;
}

.event-date-badge-month {
    display: block;
    font-size: 10px;
    opacity: 0.95;
}

.event-content {
    padding: 15px;
}

.event-title-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.event-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    flex: 1;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.3;
    filter: grayscale(100%);
}

.favorite-btn:hover {
    transform: scale(1.15);
    opacity: 0.6;
}

.favorite-btn.active {
    opacity: 1;
    filter: grayscale(0%) drop-shadow(0 2px 4px rgba(255, 107, 107, 0.3));
}

.event-meta {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.6;
}

.event-meta > div {
    margin-bottom: 4px;
    font-size: 13px;
}

.event-description {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.event-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, #ff5252 100%);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: white;
    font-weight: 600;
}

.tag {
    display: inline-block;
    background: var(--bg-light);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-light);
}

.event-tags-detail {
    margin-bottom: 20px !important;
}

.event-tags-detail .tag {
    background: var(--primary);
    color: white;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
}

.event-detail {
    max-width: 800px;
    margin: -15px auto 0;
    padding: 20px;
}

.event-detail h1 {
    font-size: 32px;
    margin: 20px 0;
}

.event-detail-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 12px;
    margin-top: 30px;
}

.event-detail-meta {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 16px;
}

.event-detail-meta .event-meta-line {
    display: block !important;
    margin-bottom: 12px !important;
    margin-right: 0 !important;
    text-align: left;
    line-height: 1.5;
    word-break: break-word;
    padding: 0 !important;
}

.event-detail-meta .event-meta-line:last-child {
    margin-bottom: 0 !important;
}

.event-detail-meta .event-meta-header {
    display: flex !important;
    gap: 32px !important;
    align-items: center !important;
    margin-bottom: 12px !important;
    flex-wrap: nowrap !important;
}

.event-detail-meta .event-meta-header span {
    display: inline !important;
    margin-right: 0 !important;
    white-space: nowrap !important;
}

.separator {
    margin: 0 6px;
}

.maps-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline;
    white-space: nowrap;
    margin-left: 8px;
}

.maps-link:hover {
    text-decoration: underline;
}

.event-detail-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 30px;
}

.back-btn {
    display: inline-block;
    margin-bottom: 0px;
    margin-left: -20px;
    padding: 10px 15px;
    background: var(--bg-light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.back-btn:hover {
    background: var(--border);
}

.search-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input,
.city-input,
select {
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-family: inherit;
    height: 40px;
    line-height: 40px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

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

.search-input {
    flex: 0 0 auto;
    width: 280px;
}

.city-input {
    min-width: 140px;
}

.city-dropdown {
    position: relative;
    flex: 0 0 auto;
}

.city-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 20px 20px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    margin-top: 0;
    padding: 0;
    margin: 0;
    width: auto;
    min-width: 100%;
    max-width: none;
    white-space: nowrap;
}

.city-dropdown-list div {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
    color: var(--text-dark);
    font-size: 13px;
    white-space: nowrap;
}

.city-dropdown-list div:first-child {
    padding-top: 8px;
}

.city-dropdown-list div:last-child {
    border-bottom: none;
    padding-bottom: 8px;
}

.city-dropdown-list div:hover {
    background-color: var(--primary);
    color: white;
}

.city-dropdown-list div:active {
    background-color: #ff5252;
}

.city-geo-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
}

.city-search-btn {
    padding: 0;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
    flex-shrink: 0;
}

.city-search-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3);
}

.city-search-btn:active {
    transform: translateY(0);
}

.geo-btn {
    padding: 0;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
    flex-shrink: 0;
}

.geo-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3);
}

.geo-btn.located {
    background: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.geo-btn.located:hover {
    background: #059669;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.distance-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
}

.distance-filter-group label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-dark);
    margin: 0;
}

.distance-slider {
    width: 120px;
    height: 5px;
    cursor: pointer;
    accent-color: var(--primary);
}

.distance-labels {
    font-size: 12px;
    color: var(--text-dark);
    display: flex;
    gap: 0;
    padding: 6px 0 0 0;
    width: 120px;
    position: relative;
    justify-content: space-between;
}

.distance-label {
    flex: 0 0 auto;
    font-weight: 700;
    text-align: center;
    flex: 1;
}

.search-btn-mobile {
    padding: 0;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
    flex-shrink: 0;
}

.search-btn-mobile:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3);
}

.search-btn-mobile:active {
    transform: translateY(0);
}

.geo-btn:active {
    transform: translateY(0);
}

.search-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
}

.search-btn {
    padding: 0 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
    flex: 0 0 auto;
    margin-right: 20px;
}

.search-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3);
}

.search-btn:active {
    transform: translateY(0);
}

.reset-btn {
    padding: 8px 14px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
    height: 36px;
}

.reset-btn:hover {
    background: var(--border);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(224, 224, 224, 0.3);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 8px 0;
    min-height: 70px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.nav-item {
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    text-decoration: none;
    color: var(--text-light);
    font-size: 12px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    font-weight: 500;
    border-radius: 12px;
    margin: 0 8px;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 1.5px;
    transition: width 0.3s ease;
}

.nav-item.active {
    color: var(--primary);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.08) 0%, rgba(78, 205, 196, 0.05) 100%);
}

.nav-item.active::after {
    width: 40px;
}

.nav-item:hover:not(.active) {
    color: var(--primary);
    background: rgba(255, 107, 107, 0.04);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-icon {
    display: block;
    font-size: 24px;
    line-height: 1;
}

@media (max-width: 768px) {
    .bottom-nav {
        min-height: 60px;
        padding: 6px 0;
        gap: 0;
    }
    
    .nav-item {
        padding: 6px 8px;
        gap: 4px;
        font-size: 14px;
        margin: 0;
        border-radius: 8px;
    }
    
    .nav-item::after {
        bottom: -8px;
    }
    
    .nav-item.active::after {
        width: 32px;
    }
    
    .nav-icon {
        font-size: 28px;
    }
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-state > div:first-child {
    font-size: 48px;
    margin-bottom: 10px;
}

.event-meta-line {
    display: inline;
    margin-right: 50px;
    margin-bottom: 0;
}

.event-meta-line:nth-child(2)::after {
    content: '';
    display: block;
    margin-bottom: 8px;
}

.event-meta-line:nth-child(3),
.event-meta-line:nth-child(4) {
    display: inline;
}

.event-meta-line:nth-child(4)::after {
    content: '';
    display: block;
    margin-bottom: 8px;
}

.event-meta-line:nth-child(5) {
    display: block;
    margin-right: 0;
}

.date-filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.date-filter-btn {
    padding: 8px 16px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.2s;
}

.date-filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

@media (max-width: 768px) {
    main {
        padding: 16px;
        max-width: 100%;
    }

    .search-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 0 16px;
        margin-bottom: 10px;
    }

    .date-filter-buttons {
        gap: 8px;
        margin: 0 0 18px 0;
        padding: 0 16px;
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .date-filter-buttons::-webkit-scrollbar {
        display: none;
    }

    .date-filter-btn {
        padding: 7px 12px;
        font-size: 12px;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .events-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 18px;
    }
    
    .event-card {
        border-radius: 20px;
        flex-direction: column;
    }

    .event-image {
        height: 180px;
        width: 100%;
        font-size: 60px;
        border-radius: 20px 20px 0 0;
    }

    .event-content {
        padding: 18px;
    }

    .event-card .event-title {
        font-size: 17px;
    }

    .event-title {
        font-size: 21px;
        font-weight: 700;
        margin-bottom: 10px;
        line-height: 1.3;
    }

    .event-meta {
        font-size: 16px;
        margin-bottom: 10px;
        line-height: 1.4;
    }

    .event-meta > div {
        font-size: 16px;
    }

    .event-description {
        font-size: 16px;
        -webkit-line-clamp: 2;
        margin-bottom: 10px;
        line-height: 1.3;
    }

    .event-tags {
        gap: 6px;
    }

    .tag {
        font-size: 14px;
        padding: 6px 12px;
    }

    .event-detail {
        margin: -15px auto 0;
        padding: 15px;
    }

    .event-detail h1 {
        font-size: 20px;
        margin: 10px 0;
    }

    .event-detail-image {
        margin-top: 15px;
    }

    .event-date-badge {
        top: 8px;
        right: 8px;
        padding: 10px 14px;
        font-size: 14px;
    }

    .event-date-badge-day {
        font-size: 18px;
    }

    .event-date-badge-month {
        font-size: 12px;
    }

    .search-filters {
        flex-direction: column;
    }

    .event-detail-meta-responsive {
        font-family: inherit !important;
    }
    
    .event-detail-meta .event-meta-header {
        display: block !important;
        gap: 0 !important;
    }
    
    .event-detail-meta .event-meta-header span {
        display: block !important;
        margin-bottom: 12px !important;
        white-space: normal !important;
    }
    
    .event-detail-meta .event-meta-header span:last-child {
        margin-bottom: 0 !important;
    }
    
    .event-detail-meta .event-meta-line {
        display: block !important;
        margin-right: 0 !important;
        margin-bottom: 12px !important;
    }
    
    .event-detail-meta .event-meta-line:last-child {
        margin-bottom: 0 !important;
    }
    
    .event-meta-line {
        display: block !important;
        margin-right: 0 !important;
        margin-bottom: 12px !important;
    }
    
    .event-meta-line::after {
        content: '' !important;
        display: none !important;
    }
}

@media (max-width: 500px) {
    body {
        padding-bottom: 70px;
    }

    .header {
        padding: 8px 14px;
        gap: 8px;
    }

    .header-left {
        gap: 8px;
        justify-content: flex-start;
        width: 100%;
        position: relative;
        height: 40px;
    }
    
    .header-center {
        max-width: calc(100% + 28px);
        margin: 0 -14px;
    }
    
    .header-right {
    }

    .logo {
        font-size: 22px;
        font-weight: 700;
        flex: 1;
        text-align: center;
    }

    .add-event-btn {
        font-size: 12px;
        padding: 0 14px;
        height: 38px;
        border-radius: 19px;
        display: none;
    }
    
    .hamburger-menu {
        display: flex;
        font-size: 24px;
        position: fixed;
        left: 14px;
        top: 12px;
        z-index: 2001;
        padding: 0;
        height: 40px;
        width: 40px;
        align-items: center;
        justify-content: center;
    }

    .search-group {
        gap: 6px;
        width: 100%;
        padding: 0 14px;
        flex: 0 0 auto;
    }

    .search-input {
        font-size: 15px;
        padding: 0 14px;
        height: 42px;
        flex: 1;
    }

    .city-geo-group {
        width: 100%;
        padding: 0 14px;
        flex-wrap: wrap;
        flex: 0 0 auto;
        gap: 8px;
    }

    .city-dropdown {
        position: relative;
        flex: 0 1 260px;
        max-width: none;
        min-width: 0;
        order: 1;
    }
    
    .city-input {
        font-size: 14px;
        padding: 0 14px;
        height: 40px;
        width: 100%;
        border: 1px solid var(--border);
        background: white;
    }
    
    .city-dropdown-list {
        max-height: 280px;
        border-radius: 0 0 18px 18px;
        display: none;
    }
    
    .city-dropdown-list div {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .city-dropdown-list div:first-child {
        padding-top: 8px;
    }
    
    .city-dropdown-list div:last-child {
        padding-bottom: 8px;
    }

    .city-search-btn {
        display: flex;
        width: 36px;
        height: 32px;
        flex: 0 0 auto;
        order: 5;
        align-self: center;
        border-radius: 6px;
    }

    .geo-btn {
        font-size: 18px;
        padding: 0;
        width: 40px;
        height: 40px;
        flex: 0 0 auto;
        border-radius: 50%;
        order: 2;
    }

    .distance-filter-group {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0;
        padding: 0 0 18px 0;
        flex-direction: column;
        margin-top: 12px;
        margin-left: 65px;
        width: 180px;
        order: 4;
        position: relative;
    }

    .distance-filter-group label {
        font-size: 12px;
        align-self: flex-start;
        display: none;
    }

    .distance-slider {
        width: 180px;
        margin: 0;
        height: 5px;
        flex: 0 0 auto;
    }

    .distance-labels {
        width: 180px;
        gap: 0;
        justify-content: space-between;
        font-size: 11px;
        display: flex;
        flex-direction: row;
        padding: 4px 0 0 0;
        position: static;
        font-weight: 700;
        color: var(--text-dark);
    }

    .distance-label {
        flex: 1 1 33%;
        text-align: center;
        position: static;
    }
    
    .date-filter-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    main {
        padding: 14px;
        max-width: 100%;
    }

    .events-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .event-card {
        border-radius: 18px;
        flex-direction: column;
    }

    .event-image {
        height: 160px;
        width: 100%;
        font-size: 50px;
        border-radius: 18px 18px 0 0;
    }

    .event-content {
        padding: 16px;
    }

    .event-title {
        font-size: 20px;
        font-weight: 700;
        margin-bottom: 8px;
        line-height: 1.2;
    }

    .event-meta {
        font-size: 15px;
        margin-bottom: 8px;
        line-height: 1.3;
    }

    .event-meta > div {
        font-size: 15px;
    }

    .event-description {
        font-size: 15px;
        -webkit-line-clamp: 2;
        margin-bottom: 8px;
    }
    
    .tag {
        font-size: 14px;
        padding: 6px 12px;
    }

    .back-btn {
        margin-left: -10px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .nav-item {
        padding: 4px 6px;
        font-size: 9px;
    }

    .nav-icon {
        font-size: 16px;
    }
}

@media (max-width: 500px) {
    .city-search-btn {
        width: 50px;
        height: 40px;
    }

    .distance-slider {
        width: 180px;
        margin-top: 5px;
    }

    .distance-filter-group {
        padding: 0 0 0 0;
        margin-right: 15px;
    }

    .distance-labels {
        width: 180px;
        padding: 0 0 0 0;
        margin-top: 10px;
    }

    .distance-label {
        flex: 1 1 33%;
        text-align: center;
    }

    .distance-label:first-child {
        text-align: left;
    }

    .distance-label:last-child {
        text-align: right;
    }
}
