/**
 * USIT WAT Consent Banner Styles
 * GDPR Cookie Consent Popup
 *
 * @package Usit_WAT
 * @since 3.9.0
 */

/* Banner Container */
.usit-consent-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Overlay */
.usit-consent-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

/* Modal */
.usit-consent-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
.usit-consent-header {
    padding: 24px 28px 16px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #124961 0%, #1a5a75 100%);
}

.usit-consent-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #fff;
}

/* Body */
.usit-consent-body {
    padding: 20px 28px;
    overflow-y: auto;
    flex: 1;
}

.usit-consent-description {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

/* Categories */
.usit-consent-categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.usit-consent-category {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    transition: border-color 0.2s ease;
}

.usit-consent-category:hover {
    border-color: #124961;
}

.usit-consent-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.usit-consent-category-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.usit-consent-always-active {
    font-size: 11px;
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.usit-consent-category-description {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #666;
    padding-left: 52px;
}

/* Toggle Switch */
.usit-consent-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

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

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

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

.usit-consent-toggle input:checked + .usit-consent-toggle-slider {
    background-color: #124961;
}

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

.usit-consent-toggle input:disabled + .usit-consent-toggle-slider {
    background-color: #28a745;
    cursor: not-allowed;
}

/* Privacy Link */
.usit-consent-privacy-link {
    margin: 20px 0 0;
    text-align: center;
}

.usit-consent-privacy-link a {
    color: #124961;
    text-decoration: none;
    font-size: 13px;
}

.usit-consent-privacy-link a:hover {
    text-decoration: underline;
}

/* Footer */
.usit-consent-footer {
    display: flex;
    gap: 10px;
    padding: 20px 28px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

/* Buttons */
.usit-consent-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.usit-consent-btn-primary {
    background: linear-gradient(135deg, #124961 0%, #1a5a75 100%);
    color: #fff;
}

.usit-consent-btn-primary:hover {
    background: linear-gradient(135deg, #0d3a4d 0%, #124961 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(18, 73, 97, 0.3);
}

.usit-consent-btn-secondary {
    background: #fff;
    color: #124961;
    border: 2px solid #124961;
}

.usit-consent-btn-secondary:hover {
    background: rgba(18, 73, 97, 0.05);
}

/* Settings Button (Cookie Icon) */
.usit-consent-settings-btn {
    position: fixed;
    bottom: 20px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #124961 0%, #1a5a75 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(18, 73, 97, 0.4);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.usit-consent-settings-btn-bottom-left {
    left: 20px;
    right: auto;
}

.usit-consent-settings-btn-bottom-right {
    right: 20px;
    left: auto;
}

.usit-consent-settings-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(18, 73, 97, 0.5);
}

.usit-consent-settings-btn svg {
    width: 22px;
    height: 22px;
}

/* Animation */
@keyframes usitConsentFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes usitConsentSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.usit-consent-banner {
    animation: usitConsentFadeIn 0.3s ease;
}

.usit-consent-modal {
    animation: usitConsentSlideIn 0.4s ease;
}

/* Responsive */
@media (max-width: 600px) {
    .usit-consent-modal {
        width: 95%;
        max-height: 85vh;
    }

    .usit-consent-header {
        padding: 20px;
    }

    .usit-consent-header h2 {
        font-size: 18px;
    }

    .usit-consent-body {
        padding: 16px 20px;
    }

    .usit-consent-description {
        font-size: 13px;
    }

    .usit-consent-category {
        padding: 12px;
    }

    .usit-consent-category-name {
        font-size: 14px;
    }

    .usit-consent-category-description {
        font-size: 12px;
        padding-left: 0;
        margin-top: 8px;
    }

    .usit-consent-footer {
        flex-wrap: wrap;
        padding: 16px 20px;
    }

    .usit-consent-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .usit-consent-btn-primary {
        order: -1;
        flex-basis: 100%;
        margin-bottom: 8px;
    }

    .usit-consent-settings-btn {
        bottom: 15px;
        left: 15px;
        width: 44px;
        height: 44px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .usit-consent-modal {
        background: #1e1e1e;
    }

    .usit-consent-header {
        border-bottom-color: #333;
    }

    .usit-consent-description {
        color: #bbb;
    }

    .usit-consent-category {
        background: #2a2a2a;
        border-color: #444;
    }

    .usit-consent-category-name {
        color: #fff;
    }

    .usit-consent-category-description {
        color: #999;
    }

    .usit-consent-footer {
        background: #252525;
        border-top-color: #333;
    }

    .usit-consent-btn-secondary {
        background: #2a2a2a;
        border-color: #124961;
        color: #7cb8d0;
    }
}
