/* drivesphere.ch - Custom Styles */

/* Base Variables */
:root {
    --primary: #1e40af;
    --secondary: #64748b;
    --accent: #f59e0b;
    --background: #fafafa;
    --surface: #ffffff;
    --text: #333333;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

/* Dark Mode Variables */
.dark {
    --background: #1f2937;
    --surface: #374151;
    --text: #f9fafb;
    --text-light: #d1d5db;
    --border: #4b5563;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--background);
    margin: 0;
    padding: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1e3a8a;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

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

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

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

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

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

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background-color: var(--surface);
    color: var(--text);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    background-color: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Cards */
.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.card-subtitle {
    color: var(--text-light);
    margin-bottom: 0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.badge-secondary {
    background-color: rgba(100, 116, 139, 0.1);
    color: var(--secondary);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

/* Loading */
.loading {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

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

/* Map Styles */
.map-container {
    height: 400px;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border);
}

.map-popup {
    min-width: 200px;
}

.map-popup h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--text);
}

.map-popup p {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

.map-popup .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #1f2937;
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner .btn {
    margin-left: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .map-container {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .cookie-banner {
        padding: 0.75rem;
    }
    
    .cookie-banner .btn {
        display: block;
        width: 100%;
        margin: 0.25rem 0;
    }
    
    /* Mobile: Suchergebnisbox um weitere 15% kleiner machen */
    .grid.grid-cols-1.lg\\:grid-cols-2 .bg-surface.rounded-lg.shadow-lg.border.border-border:first-child {
        max-height: 217px; /* 15% weniger als 255px */
    }
    
    .max-h-\\[600px\\] {
        max-height: 217px !important; /* 15% weniger als 255px */
    }
    
    /* Provider-Einträge in mobiler Ansicht kompakter machen */
    .max-h-\\[600px\\] .p-4 {
        padding: 0.75rem !important; /* Weniger Padding */
    }
    
    .max-h-\\[600px\\] .text-lg {
        font-size: 1rem !important; /* Kleinere Schrift */
    }
    
    .max-h-\\[600px\\] .text-sm {
        font-size: 0.75rem !important; /* Noch kleinere Schrift */
    }
    
    /* Mobile: Kartenansicht um 25% kleiner machen */
    .h-\\[600px\\] {
        height: 450px !important; /* 25% weniger als 600px */
    }
    
    /* Mobile: Beliebte Dienstkategorien um 30% kleiner - nur Service Categories Sektion */
    .py-16:not(.bg-gray-50) .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3.gap-8 .bg-surface.rounded-lg.shadow-sm.border.border-border.p-6 {
        padding: 1rem !important; /* 30% weniger Padding (von 1.5rem auf 1rem) */
        margin-bottom: 1rem !important; /* Kompakter */
    }
    
    .py-16:not(.bg-gray-50) .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3.gap-8 .text-3xl {
        font-size: 1.5rem !important; /* 30% kleiner (von 3xl auf xl) */
        margin-bottom: 0.75rem !important; /* Weniger Abstand */
    }
    
    .py-16:not(.bg-gray-50) .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3.gap-8 .text-xl {
        font-size: 1rem !important; /* 30% kleiner (von xl auf base) */
        margin-bottom: 0.5rem !important; /* Weniger Abstand */
    }
    
    .py-16:not(.bg-gray-50) .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3.gap-8 .text-text-light {
        font-size: 0.875rem !important; /* Kleinere Beschreibung */
        line-height: 1.2 !important; /* Kompakter */
    }
}

/* Print Styles */
@media print {
    .cookie-banner,
    .map-container {
        display: none;
    }
    
    .card {
        border: 1px solid #ccc;
        box-shadow: none;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.form-input:focus,
.form-select:focus,
.btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --text: #000000;
        --text-light: #333333;
        --border: #000000;
    }
    
    .dark {
        --text: #ffffff;
        --text-light: #cccccc;
        --border: #ffffff;
    }
}

/* Custom Tailwind-like Classes for Theme Variables */
.bg-background {
    background-color: var(--background);
}

.bg-surface {
    background-color: var(--surface);
}

.text-text {
    color: var(--text);
}

.text-text-light {
    color: var(--text-light);
}

.border-border {
    border-color: var(--border);
}

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

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

.bg-primary-dark {
    background-color: #1e3a8a;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
