* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #f7f9fa;
    color: #1a1a1a;
}

header {
    background-color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid #e1e8ed;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

h1 {
    font-size: 1.4rem;
    color: #d32f2f;
}

header p {
    font-size: 0.85rem;
    color: #657786;
    margin-top: 2px;
}

.btn-submit {
    background-color: #d32f2f;
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-submit:hover {
    background-color: #b71c1c;
}

.btn-contact {
    background-color: #0088cc;
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-contact:hover {
    background-color: #006699;
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#sidebar {
    width: 380px;
    background: white;
    border-right: 1px solid #e1e8ed;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0,0,0,0.02);
    z-index: 999;
}

.filter-section {
    padding: 20px;
    border-bottom: 1px solid #e1e8ed;
}

.filter-section h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #333;
}

.control-group {
    margin-bottom: 15px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #4b5563;
}

.control-group input[type="text"],
.control-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
}

.control-group input:focus,
.control-group select:focus {
    border-color: #d32f2f;
}

.toggle-group {
    display: flex;
    align-items: center;
    background: #fff5f5;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #fed7d7;
}

.switch-container {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    margin-right: 10px;
}

.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #d32f2f;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.label-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #c53030;
}

.stats-section {
    padding: 10px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e1e8ed;
    font-size: 0.85rem;
    color: #64748b;
}

.list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 20px;
}

.protest-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}

.protest-card:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.protest-card h4 {
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 4px;
}

.protest-card .date-time {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 6px;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
}

#map {
    flex: 1;
    height: 100%;
}

/* Custom styles for Leaflet Popups */
.popup-content h3 {
    color: #d32f2f;
    margin-bottom: 5px;
    font-size: 1rem;
}
.popup-content p {
    margin: 3px 0;
    font-size: 0.85rem;
}
.popup-badge {
    display: inline-block;
    background: #e53e3e;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.2rem;
    line-height: 1;
    width: 40px;
    height: 40px;
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
}

@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 10px;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1 1 100%;
    }

    .header-titles h1 {
        font-size: 1.2rem;
    }

    .header-titles p {
        font-size: 0.78rem;
    }

    .header-right {
        display: flex;
        gap: 8px;
        flex: 1 1 100%;
    }

    .header-right a {
        flex: 1;
        text-align: center;
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    .sidebar-toggle {
        display: block;
    }

    main {
        position: relative;
    }

    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 85%;
        max-width: 340px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
    }

    body.sidebar-open #sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    #map {
        width: 100%;
    }
}
