/**
 * Cookie Consent v2 Frontend Stylesheet
 * Premium, modern responsive design for Cookie Bar, Floting box and tabbed settings modal.
 */

#ivanivi-cc2-bar {
    position: fixed;
    z-index: 99999998;
    box-sizing: border-box;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.08), 0 -2px 4px rgba(0, 0, 0, 0.04);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border: 1px solid transparent;
    transition: all 0.3s ease-in-out;
    padding: 18px 24px;
}

/* Position and layout styles */
#ivanivi-cc2-bar.cc2-layout-banner {
    width: 100%;
    left: 0;
}

#ivanivi-cc2-bar.cc2-layout-banner.cc2-position-bottom {
    bottom: 0;
    border-top: 1px solid #e5e7eb;
}

#ivanivi-cc2-bar.cc2-layout-banner.cc2-position-top {
    top: 0;
    border-bottom: 1px solid #e5e7eb;
}

#ivanivi-cc2-bar.cc2-layout-box {
    max-width: 580px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin: 20px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

#ivanivi-cc2-bar.cc2-layout-box.cc2-position-left {
    bottom: 0;
    left: 0;
}

#ivanivi-cc2-bar.cc2-layout-box.cc2-position-right {
    bottom: 0;
    right: 0;
}

/* Container */
.cc2-bar-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#ivanivi-cc2-bar.cc2-layout-banner .cc2-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.cc2-message {
    font-size: 13.5px;
    line-height: 1.5;
    flex-grow: 1;
}

.cc2-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Buttons styling */
.cc2-btn {
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    outline: none;
    text-transform: none;
}

.cc2-btn-accept {
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.cc2-btn-reject {
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.cc2-btn-settings {
    border: 1px solid #d1d5db;
}


/* --- SETTINGS POPUP MODAL OVERLAY --- */
#ivanivi-cc2-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999999;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 20px;
}

#ivanivi-cc2-modal {
    background-color: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 780px;
    max-height: 80vh;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border: 1px solid #f1f5f9;
}

/* Header */
.cc2-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cc2-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.cc2-modal-close {
    font-size: 24px;
    font-weight: bold;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.cc2-modal-close:hover {
    color: #1e293b;
}

/* Body split layout */
.cc2-modal-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    flex-grow: 1;
    overflow: hidden;
}

/* Sidebar Menu */
.cc2-modal-sidebar {
    background-color: #f8fafc;
    border-right: 1px solid #f1f5f9;
    padding: 15px 0;
    overflow-y: auto;
}

.cc2-tab-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cc2-tab-item {
    padding: 12px 20px;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.cc2-tab-item:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.cc2-tab-item.active {
    background-color: #eff6ff;
    color: #2563eb;
    border-left-color: #2563eb;
}

/* Content Area */
.cc2-modal-content {
    padding: 25px 30px;
    overflow-y: auto;
    box-sizing: border-box;
}

.cc2-tab-panel {
    display: none;
}

.cc2-tab-panel.active {
    display: block;
    animation: cc2-fade-in 0.25s ease-out;
}

.cc2-tab-panel h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.cc2-tab-panel p {
    font-size: 13px;
    line-height: 1.6;
    color: #475569;
    margin: 0;
}

.cc2-panel-title-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
}

.cc2-panel-title-group h4 {
    margin-bottom: 0;
}

/* Badges and toggles */
.cc2-badge-always {
    background-color: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
    text-transform: uppercase;
}

/* Switch sliders */
.cc2-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.cc2-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cc2-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 34px;
}

.cc2-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.cc2-switch input:checked + .cc2-slider:before {
    transform: translateX(20px);
}

/* Table audit list styling */
.cc2-table-responsive {
    overflow-x: auto;
    margin-top: 15px;
}

.cc2-audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

.cc2-audit-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    padding: 8px 12px;
    border-bottom: 2px solid #e2e8f0;
}

.cc2-audit-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #64748b;
    line-height: 1.4;
}

/* Footer actions */
.cc2-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.cc2-btn-save {
    background-color: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.cc2-btn-save:hover {
    filter: brightness(0.9);
}

/* Keyframes */
@keyframes cc2-fade-in {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive modal */
@media (max-width: 640px) {
    #ivanivi-cc2-modal-overlay {
        padding: 10px;
    }
    
    #ivanivi-cc2-modal {
        max-height: 90vh;
    }
    
    .cc2-modal-body {
        grid-template-columns: 1fr;
    }
    
    .cc2-modal-sidebar {
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
        max-height: 120px;
    }
    
    .cc2-tab-list {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .cc2-tab-item {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 10px 15px;
    }
    
    .cc2-tab-item.active {
        border-bottom-color: #2563eb;
    }
}
