/* Overlay zur Blockierung */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 999;
    display: block;
    backdrop-filter: blur(5px);
}

/* Cookie Banner Styling */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 47, 108, 0.95);
    color: #fff;
    padding: 20px;
    z-index: 1000;
    display: none;
    text-align: center;
    box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    max-height: 90vh; /* Maximal 90% der Viewport-Höhe */
    overflow-y: auto; /* Scrollbar wenn nötig */
    font-family: Arial, sans-serif;
}

.cookie-banner p {
    margin: 0 0 15px 0;
    font-size: 14px;
    line-height: 1.5;
}

.cookie-banner form {
    margin-top: 10px;
}

.cookie-banner label {
    display: inline-block;
    margin: 5px 10px;
    font-size: 14px;
    vertical-align: middle;
}

.cookie-controls {
    margin-top: 15px;
}

.cookie-controls button {
    background-color: #66a2e0;
    color: #fff;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    border-radius: 10px;
    font-size: 14px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.cookie-controls button:hover {
    background-color: #0078D7;
    transform: scale(1.05);
}

.cookie-controls button:active {
    transform: scale(0.98);
}

/* Cookie Icon */
.cookie-icon {
    position: fixed;
    bottom: 20px;
    left: 20px;
    color: #0078D7;
    font-size: 40px;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.2s ease, color 0.2s ease;
}

.cookie-icon:hover {
    transform: scale(1.2);
    color: #005BBF;
}

/* Mobile Optimierungen */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 15px;
        max-height: 80vh; /* Weniger Höhe auf Mobile */
        font-size: 13px;
    }
    
    .cookie-banner p {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .cookie-banner label {
        display: block; /* Labels untereinander auf Mobile */
        margin: 8px 0;
        font-size: 13px;
    }
    
    .cookie-controls {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    
    .cookie-controls button {
        width: 100%;
        padding: 12px 20px;
        margin: 0;
        font-size: 14px;
    }
    
    .cookie-icon {
        bottom: 15px;
        left: 15px;
        font-size: 35px;
    }
}

/* Sehr kleine Bildschirme */
@media (max-width: 380px) {
    .cookie-banner {
        padding: 10px;
        max-height: 75vh;
    }
    
    .cookie-banner p {
        font-size: 12px;
    }
    
    .cookie-banner label {
        font-size: 12px;
    }
    
    .cookie-controls button {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* Landscape Mode auf Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .cookie-banner {
        max-height: 70vh;
        padding: 10px 15px;
    }
    
    .cookie-controls {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .cookie-controls button {
        width: auto;
        flex: 1;
        min-width: 120px;
        padding: 8px 15px;
    }
}

/* Scrollbar Styling für Cookie Banner */
.cookie-banner::-webkit-scrollbar {
    width: 6px;
}

.cookie-banner::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.cookie-banner::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.cookie-banner::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* iOS Safe Area Support */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .cookie-banner {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* Accessibility - Focus Styles */
.cookie-controls button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.cookie-banner input[type="checkbox"]:focus {
    outline: 2px solid #66a2e0;
    outline-offset: 2px;
}