/**
 * DSGVO Cookie Consent Banner Styles
 * Professionelles, barrierefreies Design
 */

/* Cookie Banner Overlay */
#cookie-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, 
        hsl(220, 30%, 15%) 0%, 
        hsl(220, 35%, 18%) 100%);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    z-index: 999999;
    padding: 1.25rem; /* Reduziert von 2rem */
    border-top: 3px solid hsl(38, 92%, 50%);
    transition: bottom 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-height: 80vh; /* Reduziert von 90vh */
    overflow-y: auto;
}

#cookie-banner.show {
    bottom: 0;
}

/* Banner Container */
.cookie-container {
    max-width: 1000px; /* Reduziert von 1200px */
    margin: 0 auto;
    color: hsl(0, 0%, 95%);
}

/* Cookie Header */
.cookie-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem; /* Reduziert von 1.5rem */
}

.cookie-header > div {
    flex: 1;
}

.cookie-header h2 {
    color: hsl(38, 92%, 50%);
    font-size: 1.4rem; /* Reduziert von 1.75rem */
    margin: 0 0 0.25rem 0;
    font-weight: 700;
}

/* KEYBOARD HINT - Kompakter */
.keyboard-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, 
        hsl(38, 92%, 50%) 0%, 
        hsl(38, 92%, 45%) 100%);
    padding: 0.4rem 0.8rem; /* Reduziert */
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.4);
    animation: keyboardPulse 2s infinite;
    margin-top: 0.25rem;
    display: inline-flex;
    max-width: fit-content;
}

@keyframes keyboardPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(234, 179, 8, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(234, 179, 8, 0.6);
    }
}

.keyboard-key {
    background: hsl(220, 30%, 15%);
    color: hsl(38, 92%, 50%);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid hsl(220, 30%, 25%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-family: 'Courier New', monospace;
}

.keyboard-text {
    color: hsl(220, 30%, 15%);
    font-weight: 700;
    font-size: 0.95rem;
}

.cookie-icon {
    font-size: 2.5rem;
    animation: cookieBounce 2s infinite;
}

@keyframes cookieBounce {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-10deg) scale(1.1); }
    75% { transform: rotate(10deg) scale(1.1); }
}

/* Cookie Content */
.cookie-content {
    line-height: 1.7;
    font-size: 0.95rem;
    color: hsl(0, 0%, 85%);
}

.cookie-content p {
    margin-bottom: 1rem;
}

.cookie-content a {
    color: hsl(38, 92%, 50%);
    text-decoration: underline;
    transition: color 0.2s;
}

.cookie-content a:hover {
    color: hsl(38, 92%, 60%);
}

/* Cookie Details View (erweiterte Einstellungen) */
#cookie-details-view {
    display: none;
    margin-top: 1.5rem;
    background: hsl(220, 30%, 12%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid hsl(220, 30%, 25%);
}

.cookie-category {
    padding: 1rem;
    margin-bottom: 1rem;
    background: hsl(220, 30%, 18%);
    border-radius: 8px;
    border-left: 4px solid hsl(38, 92%, 50%);
}

.cookie-category:last-child {
    margin-bottom: 0;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cookie-category-header h3 {
    color: hsl(38, 92%, 50%);
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
}

.cookie-category-description {
    font-size: 0.85rem;
    color: hsl(0, 0%, 75%);
    line-height: 1.5;
}

/* Custom Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: hsl(0, 0%, 30%);
    transition: 0.3s;
    border-radius: 26px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: hsl(38, 92%, 50%);
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-toggle-always-on {
    display: inline-block;
    padding: 4px 12px;
    background: hsl(38, 92%, 50%);
    color: hsl(220, 30%, 15%);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Cookie Buttons */
.cookie-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 0.9rem 1.8rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.cookie-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cookie-btn:hover::before {
    width: 300px;
    height: 300px;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, hsl(38, 92%, 50%), hsl(38, 92%, 45%));
    color: hsl(220, 30%, 15%);
    flex: 1;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.3);
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(234, 179, 8, 0.4);
}

.cookie-btn-reject {
    background: transparent;
    color: hsl(0, 0%, 85%);
    border: 2px solid hsl(0, 0%, 40%);
    flex: 1;
    min-width: 150px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cookie-btn-reject:hover {
    border-color: hsl(0, 0%, 60%);
    background: hsl(220, 30%, 20%);
}

/* FOCUSED STATE - Sehr auffällig für Enter-Taste */
.cookie-btn-focused,
.cookie-btn-reject:focus {
    background: linear-gradient(135deg, 
        hsl(142, 76%, 36%) 0%, 
        hsl(142, 76%, 32%) 100%) !important;
    color: white !important;
    border-color: hsl(142, 76%, 50%) !important;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.3),
                0 4px 20px rgba(34, 197, 94, 0.5) !important;
    transform: scale(1.05);
    animation: focusGlow 1.5s infinite;
}

@keyframes focusGlow {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.3),
                    0 4px 20px rgba(34, 197, 94, 0.5);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.5),
                    0 6px 30px rgba(34, 197, 94, 0.7);
    }
}

/* Keyboard Badge im Button */
.keyboard-badge {
    background: hsl(220, 30%, 15%);
    color: hsl(142, 76%, 50%);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    border: 1px solid hsl(142, 76%, 40%);
    animation: badgePulse 1.5s infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        background: hsl(220, 30%, 15%);
    }
    50% {
        transform: scale(1.1);
        background: hsl(220, 30%, 20%);
    }
}

.btn-icon {
    font-size: 1.1rem;
}

.btn-text {
    font-weight: 600;
}

.cookie-btn-settings {
    background: transparent;
    color: hsl(38, 92%, 50%);
    border: 2px solid hsl(38, 92%, 50%);
    padding: 0.9rem 1.5rem;
}

.cookie-btn-settings:hover {
    background: hsl(38, 92%, 50%);
    color: hsl(220, 30%, 15%);
}

.cookie-btn-save {
    background: linear-gradient(135deg, hsl(215, 75%, 45%), hsl(215, 75%, 40%));
    color: white;
    flex: 1;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.cookie-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    #cookie-banner {
        padding: 1.5rem 1rem;
    }
    
    .cookie-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .cookie-header h2 {
        font-size: 1.2rem; /* Noch kleiner auf Mobile */
    }
    
    .cookie-icon {
        font-size: 1.8rem;
    }
    
    #cookie-banner {
        padding: 1rem; /* Minimales Padding */
        max-height: 75vh;
    }

    .cookie-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .keyboard-hint {
        width: 100%;
        justify-content: center;
        padding: 0.4rem;
        margin-top: 0.25rem;
    }
    
    .keyboard-text {
        font-size: 0.8rem;
    }
    
    .cookie-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cookie-btn {
        width: 100%;
        min-width: unset;
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    #cookie-details-view {
        padding: 0.75rem;
    }
}

/* Cookie Settings Link im Footer */
#open-cookie-settings {
    cursor: pointer;
    color: hsl(38, 92%, 50%);
    text-decoration: underline;
    transition: color 0.2s;
}

#open-cookie-settings:hover {
    color: hsl(38, 92%, 60%);
}

/* Accessibility */
.cookie-btn:focus,
.cookie-toggle input:focus + .cookie-toggle-slider {
    outline: 3px solid hsl(38, 92%, 50%);
    outline-offset: 2px;
}

/* Smooth Scrollbar für Cookie Banner */
#cookie-banner::-webkit-scrollbar {
    width: 8px;
}

#cookie-banner::-webkit-scrollbar-track {
    background: hsl(220, 30%, 15%);
}

#cookie-banner::-webkit-scrollbar-thumb {
    background: hsl(38, 92%, 50%);
    border-radius: 4px;
}

#cookie-banner::-webkit-scrollbar-thumb:hover {
    background: hsl(38, 92%, 60%);
}
