/**
 * CyBehave Cookie Manager Styles
 * Matches the existing design system
 */

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

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

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

.cookie-banner-text h3 {
    font-size: 1.25rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-icon {
    color: #0991E3;
    flex-shrink: 0;
}

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

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

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

.btn-cookie-accept {
    background: #0991E3;
    color: white;
}

.btn-cookie-accept:hover {
    background: #0777c2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(9, 145, 227, 0.3);
}

.btn-cookie-reject {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btn-cookie-reject:hover {
    background: #e2e8f0;
    color: #475569;
}

.btn-cookie-customize {
    background: white;
    color: #0991E3;
    border: 2px solid #0991E3;
}

.btn-cookie-customize:hover {
    background: #eff6ff;
}

.btn-cookie-secondary {
    background: #f8fafc;
    color: #1e40af;
    border: 2px solid #1e40af;
}

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

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

.cookie-modal-visible {
    opacity: 1;
    visibility: visible;
}

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

.cookie-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cookie-modal-visible .cookie-modal-content {
    transform: scale(1);
}

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

.cookie-modal-header h2 {
    font-size: 1.75rem;
    color: #0f172a;
    margin: 0;
    font-weight: 700;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #64748b;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    line-height: 1;
}

.cookie-modal-close:hover {
    background: #f8fafc;
    color: #0f172a;
}

.cookie-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-modal-intro {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cookie-category {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    background: white;
}

.cookie-category:hover {
    border-color: #0991E3;
    box-shadow: 0 4px 12px rgba(9, 145, 227, 0.1);
}

.cookie-category-disabled {
    background: #f1f5f9;
    opacity: 0.7;
    border-color: #cbd5e1;
}

.cookie-category-disabled:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cookie-category-disabled h4,
.cookie-category-disabled p {
    color: #94a3b8;
}

.category-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 0.5rem;
    color: #0991E3;
}

.cookie-category-disabled .category-icon {
    color: #cbd5e1;
}

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

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

.cookie-category h4 {
    font-size: 1.1rem;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.cookie-category p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.cookie-privacy-note {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid #10b981;
    border-radius: 8px;
    color: #065f46;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-privacy-note svg {
    flex-shrink: 0;
    stroke: #065f46;
}

/* ==================== Cookie Toggle Switch ==================== */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
    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: #cbd5e1;
    transition: 0.3s;
    border-radius: 28px;
}

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

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #0991E3;
}

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

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

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

/* ==================== Cookie Modal Footer ==================== */
.cookie-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ==================== Cookie Settings Button ==================== */
.cookie-settings-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    border: 2px solid #0991E3;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(9, 145, 227, 0.3);
    transition: all 0.3s ease;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.cookie-settings-btn svg {
    stroke: #0991E3;
}

.cookie-settings-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 25px rgba(9, 145, 227, 0.4);
    background: #eff6ff;
}

.cookie-settings-btn:active {
    transform: scale(0.95);
}

/* ==================== Responsive Design ==================== */
@media (max-width: 968px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

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

    .btn-cookie {
        width: 100%;
    }

    .cookie-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .cookie-modal-header {
        padding: 1.5rem;
    }

    .cookie-modal-header h2 {
        font-size: 1.5rem;
    }

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

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

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

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

    .cookie-settings-btn {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
        font-size: 1.3rem;
    }
}

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

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

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

    .cookie-modal-header h2 {
        font-size: 1.3rem;
    }

    .cookie-category {
        padding: 1rem;
    }

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

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

/* ==================== Accessibility ==================== */
.cookie-toggle:focus-within .cookie-toggle-slider {
    box-shadow: 0 0 0 3px rgba(9, 145, 227, 0.3);
}

.btn-cookie:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(9, 145, 227, 0.3);
}

.cookie-modal-close:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(9, 145, 227, 0.3);
}

/* ==================== Print Styles ==================== */
@media print {
    .cookie-banner,
    .cookie-modal,
    .cookie-settings-btn {
        display: none !important;
    }
}