/**
 * Cookie Banner Styles for MaiSistent
 * Diseño responsive y moderno
 */

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

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

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

.cookie-banner-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: #075E54;
}

.cookie-banner-text p {
    margin: 0 0 0.5rem 0;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

.cookie-policy-link {
    color: #25D366;
    text-decoration: underline;
    font-size: 0.9rem;
    font-weight: 600;
}

.cookie-policy-link:hover {
    color: #128C7E;
}

.cookie-banner-buttons {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

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

.cookie-btn-primary {
    background: #25D366;
    color: white;
}

.cookie-btn-primary:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.cookie-btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.cookie-btn-secondary:hover {
    background: #d0d0d0;
}

.cookie-btn-outline {
    background: transparent;
    color: #25D366;
    border: 2px solid #25D366;
}

.cookie-btn-outline:hover {
    background: #25D366;
    color: white;
}

.cookie-btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

/* ===== Cookie Settings Panel ===== */
.cookie-settings {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-settings.show {
    opacity: 1;
}

.cookie-settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.cookie-settings-panel {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cookie-settings.show .cookie-settings-panel {
    transform: scale(1);
}

.cookie-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.cookie-settings-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #075E54;
}

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

.cookie-close-btn:hover {
    color: #333;
}

.cookie-settings-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-settings-intro {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.cookie-settings-footer {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-policy-link-small {
    text-align: center;
    color: #25D366;
    font-size: 0.9rem;
    text-decoration: underline;
}

/* ===== Cookie Category ===== */
.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

.cookie-category:hover {
    border-color: #25D366;
}

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

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

.cookie-category-info h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #075E54;
}

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

/* ===== Cookie Badges ===== */
.cookie-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.cookie-required {
    background: #4caf50;
    color: white;
}

.cookie-optional {
    background: #2196f3;
    color: white;
}

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

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

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

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

.cookie-switch input:checked + .cookie-slider {
    background-color: #25D366;
}

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

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

/* ===== Floating Settings Button ===== */
.cookie-settings-floating {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #25D366;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 9998;
    opacity: 0;
    transform: scale(0);
}

.cookie-settings-floating.show {
    opacity: 1;
    transform: scale(1);
}

.cookie-settings-floating:hover {
    background: #128C7E;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.cookie-settings-floating svg {
    animation: rotate 8s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        gap: 1rem;
    }

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

    .cookie-btn {
        width: 100%;
    }

    .cookie-settings-panel {
        width: 95%;
        max-height: 90vh;
    }

    .cookie-settings-header,
    .cookie-settings-body,
    .cookie-settings-footer {
        padding: 1rem;
    }

    .cookie-category-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .cookie-settings-floating {
        bottom: 80px; /* Evitar conflicto con WhatsApp floating button */
    }
}

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

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

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

    .cookie-btn {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }

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

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

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-settings,
    .cookie-settings-panel,
    .cookie-btn,
    .cookie-slider,
    .cookie-settings-floating {
        transition: none;
    }

    .cookie-settings-floating svg {
        animation: none;
    }
}

/* Focus states for accessibility */
.cookie-btn:focus,
.cookie-close-btn:focus,
.cookie-settings-floating:focus {
    outline: 3px solid #25D366;
    outline-offset: 2px;
}

.cookie-switch input:focus + .cookie-slider {
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.3);
}

