/**
 * Codicts Voxel Notification Control Center
 * Frontend styles
 */

/* ==============================
   Wrapper
   ============================== */
/* Make widget fill its Elementor container */
.elementor-widget-codicts-notifications-control-center {
    width: 100%;
}

.cvncc-wrapper {
    width: 100%;
    font-family: inherit;
    box-sizing: border-box;
}

.cvncc-wrapper *,
.cvncc-wrapper *::before,
.cvncc-wrapper *::after {
    box-sizing: border-box;
}

.cvncc-heading {
    font-size: 1.4em;
    font-weight: 600;
    margin: 0 0 6px;
    color: #1a1a1a;
}

.cvncc-description {
    font-size: 0.92em;
    color: #666;
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ==============================
   Column Headers
   ============================== */
.cvncc-column-headers {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    /* border-bottom: 1px solid #e5e5e5; */
}

.cvncc-col-event {
    flex: 1;
    min-width: 0;
}

.cvncc-col-inapp,
.cvncc-col-email {
    width: 70px;
    text-align: center;
    flex-shrink: 0;
}

/* ==============================
   Category
   ============================== */
.cvncc-category {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    background: #fff;
}

/* Allow dropdown to overflow when open */
.cvncc-category.cvncc-overflow-visible,
.cvncc-category-body.cvncc-overflow-visible {
    overflow: visible !important;
}

.cvncc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.cvncc-category-header:hover {
    background: #f0f1f3;
}

.cvncc-category-header.cvncc-no-collapse {
    cursor: default;
}

.cvncc-category-header.cvncc-no-collapse:hover {
    background: #f8f9fa;
}

.cvncc-category-header span {
    font-size: 0.95em;
    font-weight: 600;
    color: #2d2d2d;
}

.cvncc-chevron {
    transition: transform 0.2s ease;
    color: #999;
    flex-shrink: 0;
}

.cvncc-category-header.cvncc-collapsed .cvncc-chevron {
    transform: rotate(-90deg);
}

/* ==============================
   Event Rows
   ============================== */
.cvncc-category-body {
    /* content animated via JS slideToggle */
    overflow: hidden;
}

.cvncc-event-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    transition: background-color 0.1s ease;
}

.cvncc-event-row:hover {
    background: #fafbfc;
}

.cvncc-event-label {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cvncc-event-name {
    font-size: 0.9em;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
}

.cvncc-event-description {
    font-size: 0.8em;
    color: #888;
    font-weight: 400;
    line-height: 1.4;
}

.cvncc-dest-label {
    font-size: 0.78em;
    color: #999;
    font-weight: 400;
}

/* ==============================
   Toggle Cells
   ============================== */
.cvncc-toggle-cell {
    width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cvncc-toggle-disabled {
    color: #ccc;
    font-size: 0.85em;
    cursor: default;
}

/* ==============================
   Toggle Switch
   ============================== */
.cvncc-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.cvncc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cvncc-toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #ccc;
    border-radius: 22px;
    transition: background-color 0.2s ease;
}

.cvncc-toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.cvncc-toggle input:checked + .cvncc-toggle-slider {
    background-color: #4CAF50;
}

.cvncc-toggle input:checked + .cvncc-toggle-slider::before {
    transform: translateX(18px);
}

.cvncc-toggle input:focus + .cvncc-toggle-slider {
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.25);
}

/* Saving state */
.cvncc-toggle.cvncc-saving {
    opacity: 0.5;
    pointer-events: none;
}

/* ==============================
   Responsive
   ============================== */
@media (max-width: 600px) {
    .cvncc-col-inapp,
    .cvncc-col-email,
    .cvncc-toggle-cell {
        width: 55px;
    }

    .cvncc-event-row {
        padding: 8px 12px;
    }

    .cvncc-category-header {
        padding: 10px 12px;
    }

    .cvncc-column-headers {
        padding: 6px 12px;
    }
}

/* ==============================
   Taxonomy Filters (Frontend)
   ============================== */

.cvncc-taxonomy-filters {
    border-top: 1px dashed #e0e0e0;
    padding: 0;
    background: #f5f6f8;
    /* border-radius: 0 0 6px 6px; */
    margin-top: -1px;
}

.cvncc-taxonomy-filters.cvncc-tf-saving {
    opacity: 0.6;
    pointer-events: none;
}

/* Collapsible header */
.cvncc-tf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
    border-radius: inherit;
}

.cvncc-tf-header:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.cvncc-tf-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cvncc-tf-header svg:first-child {
    opacity: 0.6;
}

/* Chevron */
.cvncc-tf-chevron {
    transition: transform 0.2s ease;
    color: #999;
    flex-shrink: 0;
}

.cvncc-tf-collapsed .cvncc-tf-chevron {
    transform: rotate(-90deg);
}

/* Collapsible body */
.cvncc-tf-body {
    padding: 16px 14px;
}

/* Allow popup to overflow all ancestors when open */
.cvncc-taxonomy-filters.cvncc-overflow-visible,
.cvncc-tf-body.cvncc-overflow-visible {
    overflow: visible !important;
}

.cvncc-tf-filter-field {
    position: relative;
    z-index: 1;
    margin-bottom: 10px;
}

.cvncc-tf-filter-field.cvncc-tf-open {
    z-index: 100;
}

.cvncc-tf-filter-field:last-child {
    margin-bottom: 0;
}

.cvncc-tf-filter-label {
    margin-bottom: 6px;
}

.cvncc-tf-filter-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.cvncc-tf-filter-desc {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

/* Popup container positioning */
.cvncc-tf-picker.ts-field-popup-container {
    position: relative;
}

/* Popup overlay — absolute on top of content */
.cvncc-tf-popup.ts-field-popup {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: 2px;
}

/* No results message */
.cvncc-tf-no-results {
    padding: 20px 16px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

/* Load more button — inherits Voxel's .ts-term-centered + .ts-term-icon styles */
.cvncc-tf-load-more.ts-term-centered a {
    cursor: pointer;
}
