/* ============================================
   COOKIE CONSENT BANNER & MODAL STYLES
   ============================================ */

/* Cookie Banner - Fixed at bottom */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 99999;
    transform: translateY(100%);  /* Nascosto fuori schermo */
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Quando ha classe .show, diventa visibile */
.cookie-banner.show {
    transform: translateY(0);
    opacity: 1;
}

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

.cookie-text {
    flex: 1;
    min-width: 250px;
}

.cookie-text h3 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    color: #4ecdc4;
    font-weight: 700;
}

.cookie-text p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.9;
}

.cookie-text a {
    color: #4ecdc4;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.cookie-text a:hover {
    color: #44a08d;
}

/* Cookie Buttons */
.cookie-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.cookie-btn-decline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

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

.cookie-btn-settings {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

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

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

.cookie-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.cookie-modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

/* Modal Header */
.cookie-modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
}

.cookie-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    line-height: 1;
}

.cookie-close:hover {
    opacity: 1;
}

/* Modal Body */
.cookie-modal-body {
    padding: 25px;
    color: #333;
}

/* Cookie Categories */
.cookie-category {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

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

.cookie-category h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.cookie-category p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

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

.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.4s;
    border-radius: 26px;
}

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

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #4ecdc4;
}

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

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

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

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

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

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

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

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

    .cookie-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .cookie-text h3 {
        font-size: 1.1rem;
    }

    .cookie-text p {
        font-size: 0.85rem;
    }

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

    .cookie-btn {
        width: 100%;
        text-align: center;
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .cookie-modal {
        padding: 10px;
    }

    .cookie-modal-content {
        margin: 10px;
        max-height: 85vh;
    }

    .cookie-modal-header {
        padding: 15px 20px;
    }

    .cookie-modal-header h3 {
        font-size: 1.2rem;
    }

    .cookie-modal-body {
        padding: 20px;
    }

    .cookie-category {
        padding: 12px;
    }

    .cookie-category h4 {
        font-size: 1rem;
    }

    .cookie-category p {
        font-size: 0.85rem;
    }

    .cookie-modal-footer {
        padding: 15px 20px;
        flex-direction: column;
    }

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

@media (max-width: 480px) {
    .cookie-banner {
        padding: 12px;
    }

    .cookie-text h3 {
        font-size: 1rem;
    }

    .cookie-text p {
        font-size: 0.8rem;
    }

    .cookie-btn {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
}

/* ============================================
   ACCESSIBILITY & UTILITIES
   ============================================ */

.cookie-btn:focus,
.cookie-close:focus {
    outline: 2px solid #4ecdc4;
    outline-offset: 2px;
}

.cookie-toggle input:focus + .cookie-toggle-slider {
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.3);
}

body.cookie-modal-open {
    overflow: hidden;
}

@media print {
    .cookie-banner,
    .cookie-modal {
        display: none !important;
    }
     }