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

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --sidebar-bg: #1e293b;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
}

.admin-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo h2 {
    font-size: 20px;
    font-weight: 600;
}

.nav-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-item .icon {
    font-size: 18px;
}

.nav-item .badge {
    margin-left: auto;
    background-color: var(--danger-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.search-box {
    display: flex;
    gap: 8px;
    max-width: 400px;
}

.search-box input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.search-box button {
    padding: 10px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    border-radius: 12px;
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Filter Bar */
.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.filter-btn {
    padding: 8px 16px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.filter-btn:hover {
    background-color: var(--bg-color);
}

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

/* Content List */
.content-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.list-item {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.list-item-title {
    font-size: 18px;
    font-weight: 600;
}

.list-item-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-approved {
    background-color: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background-color: #fee2e2;
    color: #991b1b;
}

.list-item-content {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.list-item-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Forms */
.provider-form {
    background-color: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 800px;
}

.form-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

/* Search Automation */
.search-config {
    background-color: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.search-progress {
    background-color: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.search-results {
    margin-top: 24px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 32px;
    border-radius: 12px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

/* Activity List */
.activity-list {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
}

.activity-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
   MOBILE HEADER + HAMBURGER
   ============================================ */

.mobile-header {
    display: none; /* versteckt auf Desktop */
}

.sidebar-close-btn {
    display: none; /* versteckt auf Desktop */
}

.sidebar-overlay {
    display: none; /* versteckt auf Desktop */
}

/* ============================================
   RESPONSIVE: Tablet (≤1024px)
   ============================================ */
@media (max-width: 1024px) {
    /* Sidebar wird zum Slide-in-Menü */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 270px;
        z-index: 1001;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    /* Overlay hinter Sidebar */
    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    /* Close-Button im Sidebar-Logo */
    .sidebar-close-btn {
        display: block;
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: rgba(255, 255, 255, 0.7);
        font-size: 20px;
        cursor: pointer;
        padding: 4px 8px;
        line-height: 1;
    }

    .sidebar-close-btn:hover {
        color: white;
    }

    .logo {
        position: relative;
    }

    /* Mobile Header sichtbar */
    .mobile-header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 0 20px 0;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 20px;
    }

    .hamburger-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        border-radius: 8px;
        transition: background 0.15s;
    }

    .hamburger-btn:hover {
        background: var(--bg-color);
    }

    .hamburger-btn span {
        display: block;
        width: 22px;
        height: 2.5px;
        background: var(--text-primary);
        border-radius: 2px;
        transition: all 0.2s;
    }

    .mobile-title {
        font-size: 18px;
        font-weight: 600;
    }

    /* Main Content nimmt volle Breite */
    .main-content {
        padding: 20px;
        width: 100%;
    }

    /* Stats Grid: 2 Spalten auf Tablet */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        font-size: 28px;
        width: 48px;
        height: 48px;
    }

    /* Formulare anpassen */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Modal breiter */
    .modal-content {
        margin: 16px;
        max-width: calc(100vw - 32px);
        padding: 20px;
    }

    /* Karte Höhe anpassen */
    #map-container {
        height: calc(100vh - 280px) !important;
        min-height: 350px !important;
    }
}

/* ============================================
   RESPONSIVE: Smartphone (≤640px)
   ============================================ */
@media (max-width: 640px) {
    .main-content {
        padding: 14px;
    }

    .mobile-header {
        padding: 0 0 14px 0;
        margin-bottom: 14px;
    }

    /* Überschriften kleiner */
    .page h1 {
        font-size: 22px;
    }

    .page h2 {
        font-size: 17px;
    }

    .subtitle {
        font-size: 13px;
    }

    /* Stats Grid: 1 Spalte */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
        gap: 12px;
    }

    .stat-icon {
        font-size: 24px;
        width: 42px;
        height: 42px;
    }

    .stat-value {
        font-size: 22px;
    }

    /* Filter-Buttons scrollbar */
    .filters,
    .filter-bar {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        flex-wrap: nowrap;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Suchleiste stapeln */
    .search-bar {
        flex-direction: column;
    }

    .search-bar input,
    .search-bar button {
        width: 100%;
    }

    /* Buttons kleiner */
    .btn-primary,
    .btn-secondary {
        padding: 10px 16px;
        font-size: 13px;
    }

    /* Listen-Items */
    .list-item {
        padding: 14px;
    }

    .list-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .list-item-title {
        font-size: 16px;
    }

    .list-item-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Activity Liste */
    .activity-list {
        padding: 12px;
    }

    .activity-item {
        padding: 12px 0;
    }

    /* Scraping-Ergebnisse: Header stapeln */
    #scraping-results-section > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    #scraping-results-section > div:first-child > div {
        flex-wrap: wrap !important;
    }

    /* Tabellen scrollbar */
    #scraping-results-section table {
        font-size: 12px;
    }

    /* Suchformular auf Suche-Seite */
    #search-automation-page .form-row {
        grid-template-columns: 1fr;
    }

    /* Update-Suche: Buttons stapeln */
    #enrich-results-section > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    /* Karten-Suche */
    #map-search-input {
        min-width: unset !important;
        width: 100% !important;
    }

    #map-filters > div:first-child {
        flex-direction: column !important;
    }

    #map-container {
        height: calc(100vh - 340px) !important;
        min-height: 300px !important;
    }

    /* Kategorie-Pills scrollen */
    #map-category-filters {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    /* Modal Vollbild-nah */
    .modal-content {
        margin: 8px;
        max-width: calc(100vw - 16px);
        max-height: 90vh;
        padding: 16px;
    }

    .close {
        right: 12px;
        top: 12px;
        font-size: 24px;
    }

    /* Review-Cards */
    .review-card {
        padding: 12px;
    }

    /* Bewertungen-Seite Suchleiste */
    #reviews-page > div {
        flex-direction: column !important;
    }

    /* Leaflet Popups schmaler */
    .leaflet-popup-content {
        min-width: 200px;
        max-width: 280px;
    }

    /* Provider-Seite Buttons */
    #providers-page > div:first-of-type {
        flex-wrap: wrap;
    }
}

/* ============================================
   KARTEN-SEITE (Map Page)
   ============================================ */

#map-container {
    z-index: 1;
}

/* Kategorie-Pill-Buttons */
.map-category-btn {
    padding: 5px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    background: white;
    color: #374151;
    transition: all 0.15s;
    white-space: nowrap;
}

.map-category-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.map-category-btn.active {
    color: white;
    border-color: transparent;
}

/* Leaflet Popup Anpassungen */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
}

.leaflet-popup-content {
    margin: 12px 16px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 13px !important;
    min-width: 260px;
    max-width: 340px;
    line-height: 1.5;
}

.map-popup-category {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}

.map-popup-row {
    margin: 4px 0;
    color: #4b5563;
    line-height: 1.4;
    font-size: 12px;
}

.map-popup-row a {
    color: #0ea5e9;
    text-decoration: none;
}

.map-popup-row a:hover {
    text-decoration: underline;
}

.map-popup-actions {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 6px;
}

/* MarkerCluster Farben */
.marker-cluster-small {
    background-color: rgba(59, 130, 246, 0.25) !important;
}
.marker-cluster-small div {
    background-color: rgba(59, 130, 246, 0.7) !important;
    color: white !important;
    font-weight: 600 !important;
}

.marker-cluster-medium {
    background-color: rgba(245, 158, 11, 0.25) !important;
}
.marker-cluster-medium div {
    background-color: rgba(245, 158, 11, 0.7) !important;
    color: white !important;
    font-weight: 600 !important;
}

.marker-cluster-large {
    background-color: rgba(239, 68, 68, 0.25) !important;
}
.marker-cluster-large div {
    background-color: rgba(239, 68, 68, 0.7) !important;
    color: white !important;
    font-weight: 600 !important;
}

/* ============================================
   Review-Cards (Bewertungen-Seite)
   ============================================ */
.review-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.review-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.review-delete-btn {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: background 0.15s;
}
.review-delete-btn:hover {
    background: #fecaca;
}

/* ============================================
   Toggle Switch (Shop-Verwaltung)
   ============================================ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    border-radius: 24px;
    transition: 0.2s;
}
.toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
    background-color: #10b981;
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}
