/**
 * VEXPO CMS - Cookie Consent Manager
 * Skeleton CSS Variables - GDPR Compliant Styles
 */

/* ===== VARIABLES ===== */
:root {
    --vex-cookie-primary: var(--primary);
    --vex-cookie-primary-hover: var(--primary-dark);
    --vex-cookie-secondary: var(--text-muted);
    --vex-cookie-dark: var(--text-primary);
    --vex-cookie-light: var(--gray-50);
    --vex-cookie-border: var(--gray-200);
    --vex-cookie-text: var(--text-primary);
    --vex-cookie-text-muted: var(--text-muted);
    --vex-cookie-radius: 12px;
    --vex-cookie-shadow: var(--shadow-lg);
}

/* ===== OVERLAY ===== */
.vex-cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.vex-cookie-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== BANNER ===== */
.vex-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--vex-cookie-border);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    z-index: 999999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.vex-cookie-banner.active {
    transform: translateY(0);
}

.vex-cookie-banner-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.vex-cookie-content {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 300px;
}

.vex-cookie-icon {
    font-size: 40px;
    line-height: 1;
    flex-shrink: 0;
}

.vex-cookie-text h4 {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--vex-cookie-dark);
}

.vex-cookie-text p {
    margin: 0;
    font-size: 14px;
    color: var(--vex-cookie-text);
    line-height: 1.5;
}

.vex-cookie-text a {
    color: var(--vex-cookie-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.vex-cookie-text a:hover {
    color: var(--vex-cookie-primary-hover);
    text-decoration: underline;
}

.vex-cookie-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.vex-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    font-family: inherit;
}

.vex-btn-primary {
    background: var(--vex-primary);
    color: var(--white);
}

.vex-btn-primary:hover {
    background: var(--vex-cookie-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-primary);
}

.vex-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vex-btn-secondary {
    background: var(--vex-cookie-dark);
    color: var(--white);
}

.vex-btn-secondary:hover {
    background: var(--text-dark);
    box-shadow: var(--shadow-md);
}

.vex-btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vex-btn-outline {
    background: transparent;
    color: var(--vex-cookie-text);
    border: 1px solid var(--vex-cookie-border);
}

.vex-btn-outline:hover {
    background: var(--vex-cookie-light);
    border-color: var(--vex-cookie-primary);
    color: var(--vex-cookie-primary);
}

/* ===== MODAL ===== */
.vex-cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
}

.vex-cookie-modal.active {
    opacity: 1;
    visibility: visible;
}

.vex-cookie-modal-box {
    background: var(--white);
    border-radius: var(--vex-cookie-radius);
    box-shadow: var(--vex-cookie-shadow);
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.vex-cookie-modal.active .vex-cookie-modal-box {
    transform: scale(1) translateY(0);
}

.vex-cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--vex-cookie-border);
    flex-shrink: 0;
}

.vex-cookie-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--vex-cookie-dark);
}

.vex-cookie-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--vex-cookie-light);
    border-radius: 50%;
    font-size: 20px;
    color: var(--vex-cookie-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vex-cookie-modal-close:hover {
    background: var(--vex-cookie-border);
    color: var(--vex-cookie-dark);
}

.vex-cookie-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.vex-cookie-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--vex-cookie-border);
    background: var(--vex-cookie-light);
    border-radius: 0 0 var(--vex-cookie-radius) var(--vex-cookie-radius);
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ===== CATEGORY ===== */
.vex-cookie-category {
    padding: 20px;
    background: var(--vex-cookie-light);
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--vex-cookie-border);
    transition: all 0.2s ease;
}

.vex-cookie-category:last-child {
    margin-bottom: 0;
}

.vex-cookie-category:hover {
    border-color: var(--vex-cookie-primary);
}

.vex-cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.vex-cookie-category-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.vex-cookie-category-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    background: var(--white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.vex-cookie-category-text strong {
    display: block;
    font-size: 15px;
    color: var(--vex-cookie-dark);
    font-weight: 600;
}

.vex-cookie-category-count {
    font-size: 12px;
    color: var(--vex-cookie-text-muted);
    margin-left: 6px;
}

.vex-cookie-category-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vex-always-active {
    font-size: 11px;
    font-weight: 600;
    color: var(--vex-cookie-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vex-cookie-category-desc {
    margin: 12px 0 0 0;
    font-size: 13px;
    color: var(--vex-cookie-text);
    line-height: 1.6;
}

/* ===== SWITCH ===== */
.vex-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.vex-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.vex-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-300);
    border-radius: 26px;
    transition: all 0.3s ease;
}

.vex-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.vex-switch input:checked + .vex-slider {
    background: var(--vex-cookie-primary);
}

.vex-switch input:checked + .vex-slider:before {
    transform: translateX(22px);
}

.vex-switch input:disabled + .vex-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== EXPAND BUTTON ===== */
.vex-cookie-expand {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 0;
    background: none;
    border: none;
    font-size: 12px;
    color: var(--vex-cookie-primary);
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
}

.vex-cookie-expand:hover {
    text-decoration: underline;
}

.vex-expand-icon {
    font-size: 10px;
    transition: transform 0.2s;
    display: inline-block;
}

.vex-cookie-expand.expanded .vex-expand-icon {
    transform: rotate(180deg);
}

/* ===== COOKIE TABLE ===== */
.vex-cookie-table-wrap {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.vex-cookie-table-wrap.active {
    max-height: 400px;
    margin-top: 16px;
}

.vex-cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.vex-cookie-table th,
.vex-cookie-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--vex-cookie-border);
}

.vex-cookie-table th {
    background: var(--vex-cookie-dark);
    color: var(--white);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vex-cookie-table tr:last-child td {
    border-bottom: none;
}

.vex-cookie-table code {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* ===== FLOATING BUTTON ===== */
.vex-cookie-floating {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: var(--vex-cookie-dark);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 99999;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--white);
}

.vex-cookie-floating.active {
    opacity: 1;
    transform: scale(1);
}

.vex-cookie-floating:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* ===== TOAST ===== */
.vex-cookie-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 14px 28px;
    background: var(--vex-cookie-dark);
    color: var(--white);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 99999999;
    opacity: 0;
    transition: all 0.3s ease;
}

.vex-cookie-toast.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.vex-cookie-toast.success {
    background: var(--success);
}

.vex-cookie-toast.error {
    background: var(--danger);
}

.vex-cookie-toast.warning {
    background: var(--warning);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .vex-cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        gap: 20px;
    }
    
    .vex-cookie-content {
        min-width: 100%;
    }
    
    .vex-cookie-actions {
        flex-direction: column;
    }
    
    .vex-btn {
        width: 100%;
    }
    
    .vex-cookie-modal-box {
        max-height: 90vh;
    }
    
    .vex-cookie-modal-footer {
        flex-direction: column;
    }
    
    .vex-cookie-modal-footer .vex-btn {
        width: 100%;
    }
    
    .vex-cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .vex-cookie-category-toggle {
        width: 100%;
        justify-content: space-between;
    }
    
    .vex-cookie-table {
        font-size: 11px;
    }
    
    .vex-cookie-table th,
    .vex-cookie-table td {
        padding: 8px;
    }
    
    .vex-cookie-floating {
        bottom: 15px;
        left: 15px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .vex-cookie-toast {
        bottom: 70px;
        left: 10px;
        right: 10px;
        transform: translateY(20px);
    }

    .vex-cookie-toast.active {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .vex-cookie-banner-inner {
        padding: 16px;
    }

    .vex-cookie-icon {
        font-size: 32px;
    }

    .vex-cookie-text h4 {
        font-size: 16px;
    }

    .vex-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .vex-cookie-modal-box {
        max-height: 95vh;
    }
}

/* ===== PRINT ===== */
@media print {
    .vex-cookie-banner,
    .vex-cookie-modal,
    .vex-cookie-overlay,
    .vex-cookie-floating {
        display: none !important;
    }
}

/* ===== BANNER TOP POSITION ===== */
.vex-cookie-banner-top {
    top: 0;
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid var(--vex-cookie-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
}

.vex-cookie-banner-top.active {
    transform: translateY(0);
}

/* ===== ACCESSIBILITY ===== */
.vex-btn:focus,
.vex-switch:focus-within,
.vex-cookie-modal-close:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== ANIMATIONS ===== */
@keyframes vex-cookie-slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes vex-cookie-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.vex-cookie-banner.active {
    animation: vex-cookie-slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.vex-cookie-modal.active {
    animation: vex-cookie-fadeIn 0.3s ease;
}