/**
 * GDPR Compliance Styles for Riportachiavi.it
 * Cookie consent banner, privacy notices, and accessibility
 */

/* ================================
   Cookie Consent Banner
   ================================ */

.gdpr-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2c5aa0 0%, #357abd 100%);
    color: white;
    padding: 1.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    border-top: 3px solid #fff;
}

.gdpr-consent-banner.show {
    transform: translateY(0);
}

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

.gdpr-banner-text h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

.gdpr-banner-text p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    opacity: 0.95;
}

.gdpr-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

.gdpr-banner-actions .btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.gdpr-banner-actions .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.gdpr-banner-actions .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.gdpr-banner-actions .btn-light {
    background-color: white;
    color: #2c5aa0;
    border: none;
}

.gdpr-banner-actions .btn-light:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
}

.gdpr-banner-links {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
}

.gdpr-banner-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s ease;
}

.gdpr-banner-links a:hover {
    color: white;
    text-decoration: underline;
}

/* ================================
   Mobile Responsive
   ================================ */

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

    .gdpr-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .gdpr-banner-text h4 {
        font-size: 1.1rem;
    }

    .gdpr-banner-text p {
        font-size: 0.9rem;
    }

    .gdpr-banner-actions {
        justify-content: center;
        width: 100%;
    }

    .gdpr-banner-actions .btn {
        flex: 1;
        min-width: 80px;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .gdpr-banner-actions {
        flex-direction: column;
        width: 100%;
    }

    .gdpr-banner-actions .btn {
        width: 100%;
        margin-bottom: 0.3rem;
    }
}

/* ================================
   Privacy Page Enhancements
   ================================ */

.privacy-notice {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    position: relative;
}

.privacy-notice::before {
    content: "🔒";
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1.2rem;
}

.privacy-notice-content {
    margin-left: 2.5rem;
}

.privacy-notice h5 {
    color: #2c5aa0;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.privacy-notice p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

/* ================================
   Cookie Preferences Toggle Switches
   ================================ */

.cookie-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 0.5rem 0;
}

.cookie-toggle-info h6 {
    margin: 0 0 0.25rem 0;
    color: #2c5aa0;
    font-weight: 600;
}

.cookie-toggle-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .toggle-slider {
    background-color: #357abd;
}

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

input:disabled + .toggle-slider {
    background-color: #999;
    cursor: not-allowed;
}

input:disabled + .toggle-slider:before {
    background-color: #f0f0f0;
}

/* ================================
   Privacy Links in Footer
   ================================ */

.privacy-footer-links {
    background: rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.privacy-footer-links a {
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    margin: 0 1rem;
    transition: color 0.2s ease;
}

.privacy-footer-links a:hover {
    color: #357abd;
    text-decoration: underline;
}

/* ================================
   Accessibility Enhancements
   ================================ */

.gdpr-consent-banner:focus-within {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

.gdpr-banner-actions .btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.toggle-switch:focus-within {
    outline: 2px solid #357abd;
    outline-offset: 2px;
    border-radius: 24px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gdpr-consent-banner {
        background: #000;
        border-top: 3px solid #fff;
    }

    .gdpr-banner-actions .btn-light {
        background-color: #fff;
        color: #000;
        border: 2px solid #000;
    }

    .toggle-slider {
        border: 2px solid #000;
    }

    input:checked + .toggle-slider {
        background-color: #000;
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .gdpr-consent-banner {
        transition: none;
    }

    .toggle-slider,
    .toggle-slider:before,
    .gdpr-banner-actions .btn {
        transition: none;
    }
}

/* ================================
   Print Styles
   ================================ */

@media print {
    .gdpr-consent-banner {
        display: none !important;
    }

    .privacy-notice {
        border: 2px solid #000;
        background: transparent;
    }

    .toggle-switch {
        display: none;
    }

    .privacy-footer-links {
        background: transparent;
        border-top: 2px solid #000;
    }
}

/* ================================
   Status Messages
   ================================ */

.gdpr-status-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.gdpr-status-message.show {
    transform: translateX(0);
}

.gdpr-status-message.error {
    background: #dc3545;
}

.gdpr-status-message.warning {
    background: #ffc107;
    color: #000;
}

/* ================================
   Cookie Categories Visual Indicators
   ================================ */

.cookie-category-necessary::before {
    content: "🔒";
    margin-right: 0.5rem;
}

.cookie-category-analytics::before {
    content: "📊";
    margin-right: 0.5rem;
}

.cookie-category-functional::before {
    content: "⚙️";
    margin-right: 0.5rem;
}

.cookie-category-marketing::before {
    content: "🎯";
    margin-right: 0.5rem;
}

/* ================================
   Loading States
   ================================ */

.gdpr-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.gdpr-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #357abd;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: gdpr-spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes gdpr-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}