/**
 * Cookie Consent Banner Styles
 *
 * @package Cookie_Consent_Banner
 */

/* Reset and base styles */
.ccb-banner,
.ccb-banner *,
.ccb-modal,
.ccb-modal * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Banner overlay - fullscreen modal */
.ccb-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ccb-banner.ccb-visible {
    opacity: 1;
    visibility: visible;
}

/* Banner container */
.ccb-banner-container {
    background-color: var(--ccb-bg-color, #ffffff);
    color: var(--ccb-text-color, #1f2937);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 520px;
    width: 90%;
    padding: 32px;
    animation: ccb-slide-up 0.4s ease;
}

@keyframes ccb-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cookie icon */
.ccb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background-color: var(--ccb-primary-color, #22c55e);
    border-radius: 50%;
    margin: 0 auto 20px;
}

.ccb-icon svg {
    width: 28px;
    height: 28px;
    color: #ffffff;
}

/* Title */
.ccb-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    color: var(--ccb-text-color, #1f2937);
    line-height: 1.3;
}

/* Description */
.ccb-description {
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
    color: var(--ccb-text-color-secondary, #6b7280);
    margin-bottom: 24px;
}

/* Buttons container */
.ccb-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Button base styles */
.ccb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1;
}

/* Accept All - Primary button (most prominent) */
.ccb-btn-accept {
    background-color: var(--ccb-primary-color, #22c55e);
    color: #ffffff;
    box-shadow: 0 4px 14px -3px var(--ccb-primary-color, rgba(34, 197, 94, 0.5));
}

.ccb-btn-accept:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -3px var(--ccb-primary-color, rgba(34, 197, 94, 0.6));
}

/* Reject All - Secondary button */
.ccb-btn-reject {
    background-color: transparent;
    color: var(--ccb-text-color, #1f2937);
    border: 2px solid #e5e7eb;
}

.ccb-btn-reject:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

/* Customize button - Text link style */
.ccb-btn-customize {
    background-color: transparent;
    color: var(--ccb-text-color-secondary, #6b7280);
    padding: 10px 24px;
    font-weight: 500;
}

.ccb-btn-customize:hover {
    color: var(--ccb-text-color, #1f2937);
    text-decoration: underline;
}

/* Links */
.ccb-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.ccb-links a {
    font-size: 13px;
    color: var(--ccb-text-color-secondary, #6b7280);
    text-decoration: none;
    transition: color 0.2s ease;
}

.ccb-links a:hover {
    color: var(--ccb-primary-color, #22c55e);
    text-decoration: underline;
}

/* Customize Modal */
.ccb-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.ccb-modal-container {
    background-color: var(--ccb-bg-color, #ffffff);
    color: var(--ccb-text-color, #1f2937);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 560px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: ccb-slide-up 0.4s ease;
}

.ccb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.ccb-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ccb-text-color, #1f2937);
}

.ccb-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background-color: transparent;
    color: var(--ccb-text-color-secondary, #6b7280);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ccb-modal-close:hover {
    background-color: #f3f4f6;
}

.ccb-modal-close svg {
    width: 20px;
    height: 20px;
}

.ccb-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Category items */
.ccb-category {
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.ccb-category:last-child {
    border-bottom: none;
}

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

.ccb-category-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ccb-text-color, #1f2937);
}

.ccb-category-description {
    font-size: 13px;
    line-height: 1.5;
    color: var(--ccb-text-color-secondary, #6b7280);
}

/* Toggle switch */
.ccb-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

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

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

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

.ccb-toggle input:checked + .ccb-toggle-slider {
    background-color: var(--ccb-primary-color, #22c55e);
}

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

.ccb-toggle input:disabled + .ccb-toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Required badge */
.ccb-badge-required {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    background-color: #e5e7eb;
    color: #6b7280;
    border-radius: 4px;
    margin-left: 8px;
}

/* Modal footer */
.ccb-modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.ccb-modal-footer .ccb-btn {
    flex: 1;
}

/* Body scroll lock when banner is active */
body.ccb-banner-active {
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .ccb-banner-container {
        padding: 24px;
        border-radius: 12px;
    }

    .ccb-title {
        font-size: 20px;
    }

    .ccb-description {
        font-size: 14px;
    }

    .ccb-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .ccb-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .ccb-modal-body {
        padding: 16px;
    }

    .ccb-modal-footer {
        flex-direction: column;
    }
}

/* Dark theme */
.ccb-theme-dark .ccb-banner-container,
.ccb-theme-dark .ccb-modal-container {
    background-color: #1f2937;
    color: #f9fafb;
}

.ccb-theme-dark .ccb-title,
.ccb-theme-dark .ccb-modal-title,
.ccb-theme-dark .ccb-category-name {
    color: #f9fafb;
}

.ccb-theme-dark .ccb-description,
.ccb-theme-dark .ccb-category-description {
    color: #9ca3af;
}

.ccb-theme-dark .ccb-btn-reject {
    color: #f9fafb;
    border-color: #374151;
}

.ccb-theme-dark .ccb-btn-reject:hover {
    background-color: #374151;
    border-color: #4b5563;
}

.ccb-theme-dark .ccb-btn-customize {
    color: #9ca3af;
}

.ccb-theme-dark .ccb-btn-customize:hover {
    color: #f9fafb;
}

.ccb-theme-dark .ccb-links {
    border-top-color: #374151;
}

.ccb-theme-dark .ccb-links a {
    color: #9ca3af;
}

.ccb-theme-dark .ccb-modal-header,
.ccb-theme-dark .ccb-category {
    border-color: #374151;
}

.ccb-theme-dark .ccb-modal-footer {
    background-color: #111827;
    border-color: #374151;
}

.ccb-theme-dark .ccb-modal-close {
    color: #9ca3af;
}

.ccb-theme-dark .ccb-modal-close:hover {
    background-color: #374151;
}

.ccb-theme-dark .ccb-toggle-slider {
    background-color: #4b5563;
}

.ccb-theme-dark .ccb-badge-required {
    background-color: #374151;
    color: #9ca3af;
}
