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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

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

/* Controls */
.controls {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

/* Parking Info Bereich */
.parking-info {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.parking-info h3 {
    margin-bottom: 20px;
    color: #495057;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
}

.info-card:hover {
    background: #e3f2fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.info-card.kurzparker {
    border-left-color: #2196f3;
}

.info-card.pendler {
    border-left-color: #4caf50;
}

.info-card.dauerparker {
    border-left-color: #ff9800;
}

.info-card.contact {
    border-left-color: #9c27b0;
}

.info-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-content {
    flex: 1;
}

.info-content h4 {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
}

.info-content p {
    margin: 0 0 8px 0;
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.4;
}

.price-info {
    margin-top: 8px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.7);
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.price-info strong {
    color: #d32f2f;
    font-size: 0.85rem;
}

.price-info small {
    font-size: 0.7rem;
    color: #666;
    display: block;
    margin-top: 2px;
}

/* SVE Link Styling */
.sve-link {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sve-link:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    color: white;
    text-decoration: none;
}

.sve-link:active {
    transform: translateY(0);
}

/* Info Notice Boxes */
.info-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    font-size: 0.85rem;
    color: #856404;
    margin-bottom: 15px;
}

.info-notice strong {
    color: #533202;
}

.info-notice.warning {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left-color: #dc3545;
    color: #721c24;
}

.info-notice.warning strong {
    color: #491217;
}

.info-notice.disclaimer {
    background: linear-gradient(135deg, #e1f5fe 0%, #b3e5fc 100%);
    border-left-color: #0288d1;
    color: #01579b;
    margin-top: 10px;
}

.info-notice.disclaimer strong {
    color: #004c8c;
}

/* Details-Bereich für erweiterte Infos */
.info-details {
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.info-details summary {
    padding: 12px 16px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.3s;
}

.info-details summary:hover {
    background: #e9ecef;
}

.info-details[open] summary {
    background: #e3f2fd;
    color: #1976d2;
}

.details-content {
    padding: 16px;
    font-size: 0.85rem;
}

.detail-section {
    margin-bottom: 16px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h5 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}

.detail-section ul {
    margin: 0;
    padding-left: 20px;
    color: #6c757d;
}

.detail-section li {
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.detail-section p {
    margin: 0;
    color: #6c757d;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Map */
#map {
    height: 70vh;
    min-height: 400px;
    max-height: 800px;
    width: 100%;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
}

/* Legend Container unter der Karte */
.legend-container {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.legend h3 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.2rem;
    text-align: center;
}

.legend-items {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 2px solid rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.parking-available {
    background: rgba(76, 175, 80, 0.7);
}

.parking-blocked {
    background: repeating-linear-gradient(
        45deg,
        rgba(244, 67, 54, 0.8),
        rgba(244, 67, 54, 0.8) 10px,
        rgba(255, 255, 255, 0.8) 10px,
        rgba(255, 255, 255, 0.8) 20px
    );
}

/* Details Panel */
.details-panel {
    padding: 20px;
    background: #f8f9fa;
    border-top: 2px solid #e9ecef;
}

.details-panel h3 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.3rem;
}

#parkingDetails {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    min-height: 100px;
}

.parking-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

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

.parking-detail-label {
    font-weight: 600;
    color: #495057;
}

.parking-detail-value {
    color: #007bff;
    font-weight: 500;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.status-available {
    background-color: #4caf50;
}

.status-blocked {
    background-color: #f44336;
}

/* Custom Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
    margin: 15px;
    font-family: inherit;
}

.popup-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.popup-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popup-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-info-label {
    font-weight: 500;
    color: #6c757d;
}

.popup-info-value {
    font-weight: 600;
    color: #007bff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 5px;
        border-radius: 8px;
    }
    
    .header {
        padding: 15px 10px;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .header p {
        font-size: 0.95rem;
    }
    
    .controls {
        padding: 10px;
    }
    
    .parking-info {
        padding: 12px;
    }
    
    .parking-info h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
        text-align: center;
    }
    
    .legend-container {
        padding: 8px 10px;
    }
    
    .legend h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .legend-items {
        gap: 10px;
        flex-direction: row;
        justify-content: center;
    }
    
    .legend-item {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-width: 140px;
        justify-content: center;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .info-card {
        padding: 10px;
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
    }
    
    .info-icon {
        font-size: 1.2rem;
        margin-top: 0;
    }
    
    .info-content h4 {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }
    
    .info-content p {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    
    .price-info {
        padding: 4px 6px;
        margin-top: 4px;
    }
    
    .price-info strong {
        font-size: 0.85rem;
    }
    
    .price-info small {
        font-size: 0.7rem;
    }
    
    .sve-link {
        font-size: 0.7rem;
        padding: 4px 8px;
        margin-top: 4px;
    }
    
    .info-notice {
        font-size: 0.8rem;
        padding: 8px 10px;
        margin-bottom: 8px;
    }
    
    .info-details summary {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .details-content {
        padding: 10px;
        font-size: 0.75rem;
    }
    
    #map {
        height: 55vh;
        min-height: 300px;
    }
    
    .details-panel {
        padding: 12px;
    }
    
    .details-panel h3 {
        font-size: 1.1rem;
        text-align: center;
    }
    
    #parkingDetails {
        padding: 12px;
    }
    
    .parking-detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 6px 0;
    }
    
    .parking-detail-label {
        font-size: 0.85rem;
    }
    
    .parking-detail-value {
        font-size: 0.85rem;
    }
    
    /* Footer Optimierung für Mobile */
    footer {
        padding: 12px 8px !important;
    }
    
    footer p {
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
    }
    
    footer a {
        display: inline-block;
        margin: 0 4px;
    }
}

/* iPhone/Mobile First Optimierungen */
@media (max-width: 480px) {
    body {
        background-color: #fff;
    }
    
    .container {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
    }
    
    .header {
        padding: 20px 15px;
        border-radius: 0;
    }
    
    .header h1 {
        font-size: 1.3rem;
        margin-bottom: 5px;
        line-height: 1.2;
    }
    
    .header p {
        font-size: 0.85rem;
        opacity: 0.95;
    }
    
    .controls {
        padding: 15px;
        background: #fff;
        border-bottom: 1px solid #e9ecef;
    }
    
    .parking-info {
        padding: 0;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }
    
    .parking-info h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
        text-align: center;
        color: #495057;
    }
    
    .info-grid {
        display: block;
        gap: 0;
    }
    
    .info-card {
        padding: 15px;
        margin-bottom: 10px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border-left: 4px solid;
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }
    
    .info-card.kurzparker {
        border-left-color: #2196f3;
    }
    
    .info-card.pendler {
        border-left-color: #4caf50;
    }
    
    .info-card.dauerparker {
        border-left-color: #ff9800;
    }
    
    .info-card.contact {
        border-left-color: #9c27b0;
    }
    
    .info-icon {
        font-size: 1.5rem;
        margin-top: 2px;
        flex-shrink: 0;
    }
    
    .info-content {
        flex: 1;
        text-align: left;
    }
    
    .info-content h4 {
        font-size: 0.95rem;
        margin-bottom: 5px;
        color: #333;
        font-weight: 600;
    }
    
    .info-content p {
        font-size: 0.8rem;
        margin-bottom: 8px;
        color: #666;
        line-height: 1.3;
    }
    
    .price-info {
        padding: 8px 10px;
        background: rgba(255,255,255,0.9);
        border: 1px solid rgba(0,0,0,0.1);
        border-radius: 6px;
        margin-top: 8px;
    }
    
    .price-info strong {
        font-size: 0.9rem;
        color: #d32f2f;
        display: block;
        margin-bottom: 2px;
    }
    
    .price-info small {
        font-size: 0.75rem;
        color: #666;
        line-height: 1.2;
    }
    
    .sve-link {
        font-size: 0.8rem;
        padding: 8px 12px;
        margin-top: 8px;
        border-radius: 6px;
        display: inline-block;
        min-width: 120px;
        text-align: center;
    }
    
    .info-notice {
        padding: 12px 15px;
        margin: 15px 0;
        border-radius: 8px;
        font-size: 0.8rem;
        line-height: 1.4;
    }
    
    .info-notice strong {
        display: inline;
    }
    
    .info-notice.warning {
        background: #fff5f5;
        border: 1px solid #feb2b2;
        color: #c53030;
    }
    
    .info-notice.disclaimer {
        background: #f0f9ff;
        border: 1px solid #bae6fd;
        color: #1e40af;
    }
    
    .info-details {
        margin-top: 15px;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .info-details summary {
        padding: 12px 15px;
        background: #f8f9fa;
        font-size: 0.85rem;
        font-weight: 600;
        text-align: center;
        border: none;
    }
    
    .details-content {
        padding: 15px;
        background: #fff;
        font-size: 0.8rem;
    }
    
    .detail-section {
        margin-bottom: 12px;
    }
    
    .detail-section h5 {
        font-size: 0.85rem;
        margin-bottom: 6px;
        color: #333;
        font-weight: 600;
    }
    
    .detail-section ul {
        padding-left: 18px;
        margin: 0;
    }
    
    .detail-section li {
        font-size: 0.75rem;
        margin-bottom: 3px;
        color: #666;
        line-height: 1.3;
    }
    
    .detail-section p {
        font-size: 0.75rem;
        color: #666;
        line-height: 1.3;
        margin: 0;
    }
    
    #map {
        height: 50vh;
        min-height: 300px;
        border-radius: 0;
        border: none;
    }
    
    .legend-container {
        padding: 15px;
        background: #f8f9fa;
        border-top: 1px solid #e9ecef;
    }
    
    .legend h3 {
        font-size: 1rem;
        margin-bottom: 10px;
        text-align: center;
        color: #495057;
    }
    
    .legend-items {
        display: flex;
        justify-content: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .legend-item {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 12px;
        background: white;
        border-radius: 20px;
        font-size: 0.8rem;
        font-weight: 500;
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
        min-width: 130px;
        justify-content: center;
    }
    
    .legend-color {
        width: 16px;
        height: 16px;
        border-radius: 2px;
        border: 1px solid rgba(0,0,0,0.2);
        flex-shrink: 0;
    }
    
    .details-panel {
        padding: 15px;
        background: #f8f9fa;
        border-top: 1px solid #e9ecef;
    }
    
    .details-panel h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
        text-align: center;
        color: #495057;
    }
    
    #parkingDetails {
        padding: 15px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
        min-height: 80px;
    }
    
    .parking-detail-item {
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .parking-detail-item:last-child {
        border-bottom: none;
    }
    
    .parking-detail-label {
        font-size: 0.8rem;
        font-weight: 600;
        color: #495057;
    }
    
    .parking-detail-value {
        font-size: 0.85rem;
        color: #007bff;
        font-weight: 500;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
        border-radius: 12px;
        align-self: flex-start;
    }
    
    /* Footer für iPhone */
    footer {
        padding: 15px !important;
        background: #f8f9fa !important;
        border-top: 1px solid #e9ecef !important;
        text-align: center !important;
    }
    
    footer p {
        font-size: 0.75rem !important;
        line-height: 1.4 !important;
        margin-bottom: 8px !important;
        color: #6c757d !important;
    }
    
    footer p:last-child {
        margin-bottom: 0 !important;
        font-size: 0.7rem !important;
        color: #999 !important;
        font-style: italic !important;
    }
    
    footer a {
        color: #007bff !important;
        text-decoration: none !important;
        margin: 0 8px !important;
    }
    
    /* Popup Optimierung für iPhone */
    .popup-title {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .popup-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        margin-bottom: 6px;
    }
    
    .popup-info-label {
        font-size: 0.75rem;
        color: #666;
    }
    
    .popup-info-value {
        font-size: 0.8rem;
        color: #333;
    }
}

/* Tablet Optimierungen */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        margin: 8px;
        border-radius: 8px;
    }
    
    .header {
        padding: 20px 15px;
    }
    
    .header h1 {
        font-size: 1.7rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .controls {
        padding: 15px;
    }
    
    .parking-info {
        padding: 15px;
    }
    
    .info-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .info-card {
        padding: 12px;
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 8px;
    }
    
    .legend-container {
        padding: 12px 15px;
    }
    
    .legend-items {
        gap: 15px;
    }
    
    .legend-item {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    #map {
        height: 60vh;
        min-height: 400px;
    }
}

/* Landscape-Modus für Mobile optimieren */
@media (max-width: 768px) and (orientation: landscape) {
    #map {
        height: 80vh;
        min-height: 250px;
    }
    
    .header {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.6rem;
        margin-bottom: 5px;
    }
    
    .controls {
        padding: 10px;
    }
    
    .details-panel {
        padding: 10px;
    }
}

/* Touch-Optimierungen */
@media (hover: none) and (pointer: coarse) {
    .legend-item {
        padding: 12px 15px;
        margin-bottom: 5px;
    }
    
    .parking-detail-item {
        padding: 12px 0;
    }
    
    /* Leaflet Controls größer machen für Touch */
    .leaflet-control-zoom a {
        width: 35px !important;
        height: 35px !important;
        line-height: 35px !important;
        font-size: 20px !important;
    }
}