/**
 * BauManager Cookie Consent Styles
 * GDPR/DSGVO Compliant
 */

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -10px 50px rgba(0,0,0,0.15);
    z-index: 99999;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 3px solid var(--primary, #ff6b35);
}

.cookie-banner.active {
    bottom: 0;
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 30px;
}

.cookie-banner-text {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.cookie-icon {
    font-size: 48px;
    line-height: 1;
}

.cookie-message h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a2e;
}

.cookie-message p {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.cookie-banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.cookie-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
    color: white;
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255,107,53,0.4);
}

.cookie-btn-reject {
    background: #f7f7f9;
    color: #1a1a2e;
    border: 2px solid #e9ecef;
}

.cookie-btn-reject:hover {
    border-color: #ff6b35;
    color: #ff6b35;
}

.cookie-btn-settings {
    background: transparent;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.cookie-btn-settings:hover {
    border-color: #1a1a2e;
    color: #1a1a2e;
}

.cookie-banner-links {
    display: flex;
    gap: 20px;
}

.cookie-banner-links a {
    color: #6c757d;
    font-size: 12px;
    text-decoration: none;
}

.cookie-banner-links a:hover {
    color: #ff6b35;
    text-decoration: underline;
}

/* Cookie Settings Modal */
.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    padding: 20px;
}

.cookie-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cookie-modal {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
}

.cookie-modal-overlay.active .cookie-modal {
    transform: scale(1) translateY(0);
}

.cookie-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

.cookie-modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.cookie-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f7f7f9;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-modal-close:hover {
    background: #ff6b35;
    color: white;
}

.cookie-modal-body {
    padding: 25px 30px;
    overflow-y: auto;
    flex: 1;
}

.cookie-modal-intro {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

/* Cookie Categories */
.cookie-category {
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.cookie-category-header {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.3s;
}

.cookie-category-header:hover {
    background: #f0f0f0;
}

.cookie-category-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cookie-category-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.cookie-category-icon.essential { background: rgba(6,214,160,0.15); }
.cookie-category-icon.functional { background: rgba(37,99,235,0.15); }
.cookie-category-icon.analytics { background: rgba(255,159,28,0.15); }
.cookie-category-icon.marketing { background: rgba(239,71,111,0.15); }

.cookie-category-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 4px 0;
}

.cookie-category-info p {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
    max-width: 280px;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-toggle-slider {
    width: 50px;
    height: 28px;
    background: #d1d5db;
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
    transform: translateX(22px);
}

.cookie-toggle.disabled .cookie-toggle-slider {
    background: #06d6a0;
    cursor: not-allowed;
}

.cookie-toggle-label {
    font-size: 11px;
    color: #06d6a0;
    font-weight: 600;
}

/* Cookie Details Table */
.cookie-category-details {
    padding: 0 20px 15px;
    display: none;
}

.cookie-category:hover .cookie-category-details {
    display: block;
}

.cookie-category-details table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
}

.cookie-category-details td {
    padding: 8px 10px;
    border-bottom: 1px solid #e9ecef;
    color: #6c757d;
}

.cookie-category-details td:first-child {
    font-weight: 600;
    color: #1a1a2e;
    font-family: 'Space Mono', monospace;
}

.cookie-category-details tr:last-child td {
    border-bottom: none;
}

/* Modal Footer */
.cookie-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8f9fa;
}

/* Minimized Button */
.cookie-minimized {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 55px;
    height: 55px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    z-index: 99998;
    transition: all 0.3s;
    opacity: 0;
    transform: scale(0);
    border: 2px solid #f0f0f0;
}

.cookie-minimized.active {
    opacity: 1;
    transform: scale(1);
}

.cookie-minimized:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 35px rgba(0,0,0,0.2);
    border-color: #ff6b35;
}

/* Toast Notification */
.cookie-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a2e;
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 999999;
    opacity: 0;
    transition: all 0.3s;
}

.cookie-toast.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cookie-toast i {
    color: #06d6a0;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-banner-content {
        padding: 20px;
    }
    
    .cookie-banner-text {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-banner-actions {
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-banner-links {
        justify-content: center;
    }
    
    .cookie-modal {
        margin: 10px;
        max-height: 90vh;
    }
    
    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding: 15px 20px;
    }
    
    .cookie-category-info p {
        max-width: 160px;
    }
    
    .cookie-minimized {
        bottom: 15px;
        left: 15px;
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .cookie-banner,
    .cookie-modal {
        /* Can add dark mode styles here */
    }
}

/* Phones: the banner never covers more than 60 % of the screen and scrolls inside (the page reserves its height, see cookie-consent.js) */
@media (max-width: 768px) {
    .cookie-banner { max-height: 60vh; max-height: 60dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom); }
    .cookie-banner-content { padding: 16px; }
}
