/**
 * AssurePath Cookie Consent Styles
 * Modern, accessible, GDPR-compliant design
 */

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(15, 22, 41, 0.98) 0%, rgba(21, 26, 58, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(147, 0, 255, 0.3);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(147, 0, 255, 0.1);
    padding: 1.5rem;
    z-index: 9999;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.cookie-consent-banner.show {
    transform: translateY(0);
    opacity: 1;
}

.cookie-consent-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cookie-consent-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

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

.cookie-consent-text h4 {
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.cookie-consent-text p {
    color: #B3B8C4;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
}

.cookie-consent-text a {
    color: #9300FF;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.cookie-consent-text a:hover {
    color: #B554FF;
    text-decoration: underline;
}

.cookie-consent-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Cookie Buttons */
.cookie-btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.cookie-btn-primary {
    background: linear-gradient(135deg, #9300FF 0%, #B554FF 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(147, 0, 255, 0.3);
}

.cookie-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(147, 0, 255, 0.4);
}

.cookie-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.cookie-btn-text {
    background: transparent;
    color: #B3B8C4;
    padding: 0.75rem 1rem;
}

.cookie-btn-text:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* Cookie Settings Modal */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cookie-settings-modal.show {
    display: flex;
}

.cookie-settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.cookie-settings-content {
    position: relative;
    background: #1a1f3a;
    border: 1px solid rgba(147, 0, 255, 0.4);
    border-radius: 20px;
    max-width: 650px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7), 0 0 50px rgba(147, 0, 255, 0.3);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-settings-header {
    position: sticky;
    top: 0;
    background: #1a1f3a;
    border-bottom: 1px solid rgba(147, 0, 255, 0.3);
    padding: 2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1;
}

.cookie-settings-header h3 {
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-settings-close {
    background: none;
    border: none;
    color: #9CA3AF;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.cookie-settings-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.cookie-settings-description {
    color: #a8afc4;
    font-size: 1rem;
    line-height: 1.7;
    padding: 0 2rem;
    margin: 1.5rem 0 2rem 0;
}

.cookie-categories {
    padding: 0 2rem 1.5rem;
}

.cookie-category {
    background: rgba(30, 35, 55, 0.6);
    border: 1px solid rgba(147, 0, 255, 0.2);
    border-radius: 14px;
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    transition: all 0.2s ease;
}

.cookie-category:hover {
    border-color: rgba(147, 0, 255, 0.4);
    background: rgba(30, 35, 55, 0.8);
    box-shadow: 0 4px 20px rgba(147, 0, 255, 0.1);
}

.cookie-category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-category-info {
    flex: 1;
}

.cookie-category-info h4 {
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.required-badge {
    background: rgba(147, 0, 255, 0.25);
    color: #c77dff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cookie-category-info p {
    color: #b8bfcf;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
}

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

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

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    border-radius: 28px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: white;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-slider {
    background: linear-gradient(135deg, #9300FF 0%, #B554FF 100%);
    border-color: #9300FF;
}

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

.cookie-toggle input:disabled + .cookie-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-toggle input:focus + .cookie-slider {
    box-shadow: 0 0 0 3px rgba(147, 0, 255, 0.2);
}

/* Settings Actions */
.cookie-settings-actions {
    position: sticky;
    bottom: 0;
    background: #1a1f3a;
    border-top: 1px solid rgba(147, 0, 255, 0.3);
    padding: 2rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

/* Toast Notification */
.cookie-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #0A0F2E 0%, #151A3A 100%);
    border: 1px solid rgba(147, 0, 255, 0.3);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: white;
    font-size: 0.9375rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(147, 0, 255, 0.2);
    z-index: 10001;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* 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-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

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

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

    .cookie-btn {
        width: 100%;
        text-align: center;
    }

    .cookie-settings-content {
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }

    .cookie-settings-header,
    .cookie-settings-description,
    .cookie-categories,
    .cookie-settings-actions {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .cookie-category {
        padding: 1rem;
    }

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

    .cookie-toggle {
        align-self: flex-start;
    }

    .cookie-toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-settings-modal,
    .cookie-toast,
    .cookie-btn,
    .cookie-slider,
    .cookie-slider:before {
        transition: none;
    }

    .cookie-settings-content {
        animation: none;
    }

    .cookie-settings-overlay {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-consent-banner {
        border-top-width: 2px;
    }

    .cookie-settings-content {
        border-width: 2px;
    }

    .cookie-category {
        border-width: 2px;
    }
}

/* Print styles */
@media print {
    .cookie-consent-banner,
    .cookie-settings-modal,
    .cookie-toast {
        display: none !important;
    }
}
