/**
 * Flomenco Consent Banner Styles
 * WCAG AA compliant, mobile-responsive cookie consent UI
 */

/* ============================================
   CONSENT BANNER
   ============================================ */

#flomenco-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #1a1a2e;
    color: #ffffff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#flomenco-consent-banner.consent-banner-visible {
    transform: translateY(0);
}

.consent-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.consent-banner-text {
    flex: 1;
    min-width: 0;
}

.consent-banner-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #e0e0e0;
}

.consent-banner-text p:first-child {
    margin-bottom: 4px;
}

.consent-banner-text strong {
    color: #ffffff;
    font-weight: 600;
}

.consent-banner-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* ============================================
   BUTTONS
   ============================================ */

.consent-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.consent-btn:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.consent-btn:focus:not(:focus-visible) {
    outline: none;
}

.consent-btn:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.consent-btn-primary {
    background: #8b5cf6;
    color: #ffffff;
}

.consent-btn-primary:hover {
    background: #7c3aed;
}

.consent-btn-primary:active {
    background: #6d28d9;
}

.consent-btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.consent-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.consent-btn-secondary:active {
    background: rgba(255, 255, 255, 0.15);
}

/* ============================================
   PREFERENCES MODAL
   ============================================ */

#flomenco-consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#flomenco-consent-modal.consent-modal-visible {
    opacity: 1;
    visibility: visible;
}

.consent-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.consent-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#flomenco-consent-modal.consent-modal-visible .consent-modal-content {
    transform: scale(1);
}

.consent-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
}

.consent-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.consent-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.consent-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.consent-modal-close:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.consent-modal-body {
    padding: 24px;
}

.consent-category {
    padding: 16px 0;
    border-bottom: 1px solid #e5e5e5;
}

.consent-category:last-child {
    border-bottom: none;
}

.consent-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.consent-category-header label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: #1a1a2e;
}

.consent-category-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8b5cf6;
    cursor: pointer;
}

.consent-category-header input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.consent-badge {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 4px;
}

.consent-category p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #666;
}

.consent-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e5e5e5;
    justify-content: flex-end;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 768px) {
    .consent-banner-content {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px;
        gap: 16px;
    }

    .consent-banner-text {
        text-align: center;
    }

    .consent-banner-actions {
        flex-direction: column;
        width: 100%;
    }

    .consent-btn {
        width: 100%;
        padding: 12px 20px;
    }

    .consent-modal-content {
        max-height: 85vh;
    }

    .consent-modal-header,
    .consent-modal-body,
    .consent-modal-footer {
        padding: 16px 20px;
    }

    .consent-modal-footer {
        flex-direction: column;
    }

    .consent-modal-footer .consent-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .consent-banner-text p {
        font-size: 13px;
    }

    .consent-modal-header h2 {
        font-size: 16px;
    }

    .consent-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    #flomenco-consent-banner,
    #flomenco-consent-modal,
    .consent-modal-content,
    .consent-btn {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #flomenco-consent-banner {
        border-top: 2px solid #ffffff;
    }

    .consent-btn-secondary {
        border-width: 2px;
    }

    .consent-modal-content {
        border: 2px solid #1a1a2e;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    #flomenco-consent-banner,
    #flomenco-consent-modal {
        display: none !important;
    }
}
