/**
 * P4 Warehouse Cloud WMS - Cookie Consent Styles
 *
 * GDPR-compliant cookie consent banner and settings modal styles
 */

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

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

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

.cookie-consent-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-consent-content {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    flex: 1;
    min-width: 300px;
}

.cookie-consent-icon {
    color: var(--p4-blue, #0A5FAD);
    flex-shrink: 0;
}

.cookie-consent-text {
    flex: 1;
}

.cookie-consent-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--p4-blue, #0A5FAD);
}

.cookie-consent-description {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 0;
    line-height: 1.5;
}

.cookie-consent-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Cookie Buttons */
.btn-cookie {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.btn-cookie:active {
    transform: translateY(0);
}

.btn-cookie-accept {
    background: var(--p4-blue, #0A5FAD);
    color: white;
}

.btn-cookie-accept:hover {
    background: #084a8a;
}

.btn-cookie-reject {
    background: #6c757d;
    color: white;
}

.btn-cookie-reject:hover {
    background: #5a6268;
}

.btn-cookie-customize {
    background: white;
    color: var(--p4-blue, #0A5FAD);
    border: 2px solid var(--p4-blue, #0A5FAD);
}

.btn-cookie-customize:hover {
    background: var(--p4-blue, #0A5FAD);
    color: white;
}

/* ============================================
   COOKIE SETTINGS MODAL
   ============================================ */

.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
}

.cookie-settings-modal.cookie-settings-visible {
    display: block;
}

.cookie-settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.cookie-settings-content {
    position: relative;
    max-width: 700px;
    margin: 2rem auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

/* Modal Header */
.cookie-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
}

.cookie-settings-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--p4-blue, #0A5FAD);
    margin: 0;
}

.cookie-settings-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.cookie-settings-close:hover {
    color: #343a40;
}

/* Modal Body */
.cookie-settings-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-settings-intro {
    color: #6c757d;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Cookie Category */
.cookie-category {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.cookie-category:last-child {
    margin-bottom: 0;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.cookie-category-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.cookie-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--p4-blue, #0A5FAD);
    margin: 0;
}

.cookie-category-badge {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.cookie-category-description {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.cookie-examples {
    font-size: 0.85rem;
    color: #868e96;
    margin-top: 0.5rem;
}

.cookie-examples strong {
    color: #495057;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    flex-shrink: 0;
}

.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: #ccc;
    transition: 0.3s;
    border-radius: 34px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: var(--p4-blue, #0A5FAD);
}

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

/* Disabled toggle */
.cookie-toggle-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-toggle-disabled .cookie-toggle-slider {
    cursor: not-allowed;
    background-color: #28a745;
}

/* Modal Footer */
.cookie-settings-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e9ecef;
    justify-content: flex-end;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 1rem;
    }

    .cookie-consent-container {
        flex-direction: column;
        gap: 1rem;
    }

    .cookie-consent-content {
        gap: 1rem;
        min-width: 100%;
    }

    .cookie-consent-icon {
        display: none;
    }

    .cookie-consent-title {
        font-size: 1.1rem;
    }

    .cookie-consent-description {
        font-size: 0.9rem;
    }

    .cookie-consent-actions {
        width: 100%;
        justify-content: stretch;
    }

    .btn-cookie {
        flex: 1;
        text-align: center;
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }

    /* Settings Modal */
    .cookie-settings-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .cookie-settings-header {
        padding: 1rem 1.5rem;
    }

    .cookie-settings-title {
        font-size: 1.25rem;
    }

    .cookie-settings-body {
        padding: 1.5rem;
    }

    .cookie-category {
        padding: 1rem;
    }

    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .cookie-category-title-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .cookie-settings-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }

    .cookie-settings-footer .btn-cookie {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cookie-consent-actions {
        flex-direction: column;
    }

    .btn-cookie {
        width: 100%;
    }
}

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

/* Focus styles for keyboard navigation */
.btn-cookie:focus,
.cookie-toggle:focus-within,
.cookie-settings-close:focus {
    outline: 3px solid var(--p4-orange, #FBAD48);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .btn-cookie,
    .cookie-toggle-slider,
    .cookie-toggle-slider:before,
    .cookie-settings-overlay,
    .cookie-settings-content {
        transition: none;
        animation: none;
    }
}
