/**
 * Cookie Banner Styles
 * Place this file in: /wp-content/themes/understrap-child/cookiebanner/cookiebanner.css
 */

/* ==========================================================================
   Cookie Modal
   ========================================================================== */

.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.cookie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.cookie-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #ffffff;
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.cookie-modal.cookie-modal-visible .cookie-modal-content {
    transform: translate(-50%, -50%) scale(1);
}

.cookie-modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #faf7f5;
}

.cookie-modal-header h4 {
    margin: 0;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.5rem;
}

.cookie-modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: all 0.3s ease;
}

.cookie-modal-close:hover {
    background-color: #f8f9fa;
    color: #495057;
    transform: rotate(90deg);
}

.cookie-modal-body {
    padding: 30px;
    max-height: 400px;
    overflow-y: auto;
}

.cookie-modal-body p {
    margin-bottom: 25px;
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.6;
}

.cookie-category {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 0;
    background: #faf7f5;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    border-color: #000000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.cookie-category-info {
    flex: 1;
    padding-right: 20px;
}

.cookie-category-info h6 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.1rem;
}

.cookie-category-desc {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* ==========================================================================
   Toggle Switch
   ========================================================================== */

.cookie-toggle {
    position: relative;
    display: flex;
    align-items: center;
}

.cookie-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.toggle-label {
    display: block;
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle-label:hover {
    background-color: #bbb;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input[type="checkbox"]:checked + .toggle-label {
    background-color: #000000;
}

.cookie-toggle input[type="checkbox"]:checked + .toggle-label:hover {
    background-color: #333333;
}

.cookie-toggle input[type="checkbox"]:checked + .toggle-label .toggle-slider {
    transform: translateX(24px);
}

.cookie-toggle input[type="checkbox"]:disabled + .toggle-label {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #95a5a6;
}

.cookie-toggle input[type="checkbox"]:disabled + .toggle-label:hover {
    background-color: #95a5a6;
}

/* ==========================================================================
   Modal Footer
   ========================================================================== */

.cookie-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    background: #faf7f5;
}

.cookie-modal-footer .btn {
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.3s ease;
    text-decoration: none;
}

.cookie-modal-footer .btn-primary {
    background-color: #000000;
    border-color: #000000;
    color: #ffffff;
}

.cookie-modal-footer .btn-primary:hover {
    background-color: #333333;
    border-color: #333333;
    transform: translateY(-1px);
}

.cookie-modal-footer .btn-outline-secondary {
    background-color: #000000;
    border-color: #000000;
    color: #ffffff;
}

.cookie-modal-footer .btn-outline-secondary:hover {
    background-color: #333333;
    border-color: #333333;
    color: #ffffff;
    transform: translateY(-1px);
}

#cookie-save-preferences {
    background-color: #ffffff;
    border-color: #000000;
    color: #000000;
}

#cookie-save-preferences:hover {
    background-color: #f5f5f5;
    border-color: #000000;
    color: #000000;
}

/* ==========================================================================
   Body Lock
   ========================================================================== */

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

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 991.98px) {

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

    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 767.98px) {

    .cookie-modal-content {
        width: 95%;
        margin: 20px auto;
        max-height: calc(100vh - 40px);
    }

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

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

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

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

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

    .cookie-category {
        padding: 15px;
    }

    .cookie-category-header {
        flex-direction: column;
        gap: 15px;
    }

    .cookie-category-info {
        padding-right: 0;
    }

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