/* Custom Settings UI for CCRF Repeater */

:root {
    --ccrf-bg: #f3f4f6;
    --ccrf-card-bg: #ffffff;
    --ccrf-text: #1e293b;
    --ccrf-text-muted: #64748b;
    --ccrf-border: #e2e8f0;
    --ccrf-primary: #6366f1;
    --ccrf-primary-hover: #4f46e5;
    --ccrf-radius: 12px;
    --ccrf-font: 'Outfit', sans-serif;
    --ccrf-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

body.toplevel_page_code-and-core-repeater-settings, body.contact_page_code-and-core-repeater-settings {
    background-color: var(--ccrf-bg);
}

.ccrf-wrap {
    margin: 20px 20px 0 0;
    color: var(--ccrf-text);
    font-family: var(--ccrf-font);
}

.ccrf-wrap h1.main-title {
    font-family: var(--ccrf-font);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.ccrf-subtitle {
    font-size: 15px;
    color: #64748b;
    margin-bottom: 30px;
    font-family: var(--ccrf-font);
}

/* Tabs */
.ccrf-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0;
}

.ccrf-tab {
    background: var(--ccrf-card-bg);
    border: 1px solid #e2e8f0;
    border-bottom: 2px solid #e0e7ff;
    padding: 10px 18px;
    border-radius: 8px 8px 0 0;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
    margin-bottom: -1px;
}

.ccrf-tab .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #94a3b8;
    transition: color 0.2s;
}

.ccrf-tab-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ccrf-tab-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.ccrf-tab-subtitle {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
    line-height: 1;
}

.ccrf-tab.active {
    background: var(--ccrf-primary);
    border-color: var(--ccrf-primary);
    border-bottom: 2px solid var(--ccrf-primary);
    box-shadow: none;
}

.ccrf-tab.active .dashicons,
.ccrf-tab.active .ccrf-tab-title,
.ccrf-tab.active .ccrf-tab-subtitle {
    color: #fff;
}

.ccrf-tab:hover:not(.active) {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}

/* Layout */
.ccrf-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.ccrf-main {
    flex: 1;
}

/* Sidebar Styling */
.ccrf-sidebar {
    width: 380px;
    position: sticky;
    top: 40px;
}

.ccrf-sidebar-widget {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: none;
    margin-top: 0;
}

.ccrf-sidebar-widget h3 {
    font-family: var(--ccrf-font);
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    margin-bottom: 6px;
}

.ccrf-sidebar-widget__subtitle {
    font-size: 13.5px;
    color: var(--ccrf-text-muted);
    margin-bottom: 24px;
    margin-top: 0;
}

/* Plugin Cards */
.ccrf-plugin-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.ccrf-plugin-card--highlight {
    border-color: #e0e7ff;
    background: linear-gradient(180deg, #f5f8ff 0%, #ffffff 100%);
    margin-top: 20px;
}

.ccrf-plugin-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ccrf-plugin-thumb__logo--under {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 5px #6167f84d;
    padding: 5px;
}

.ccrf-plugin-thumb__logo--under img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.ccrf-plugin-card__head {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.ccrf-plugin-card__head h4 {
    font-family: var(--ccrf-font);
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #000;
}

.ccrf-plugin-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.05);
    color: #000;
}

.ccrf-plugin-badge--cta {
    background: var(--ccrf-primary);
    color: #fff;
}

.ccrf-plugin-card p {
    font-size: 13px;
    color: var(--ccrf-text-muted);
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.ccrf-plugin-card__cta .button {
    padding: 8px 14px;
    border-radius: 10px;
}

/* Main Cards */
.ccrf-card {
    background: var(--ccrf-card-bg);
    border: 1px solid var(--ccrf-border);
    border-radius: var(--ccrf-radius);
    box-shadow: var(--ccrf-shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

.ccrf-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: transparent;
}

.ccrf-card-header h2 {
    margin: 0 0 6px 0;
    font-family: var(--ccrf-font);
    font-size: 16px;
    font-weight: 700;
    color: var(--ccrf-text);
}

.ccrf-card-header p {
    margin: 0;
    font-size: 13.5px;
    color: var(--ccrf-text-muted);
}

/* Form Rows */
.ccrf-repeater- {
    display: flex;
    align-items: flex-start;
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.ccrf-repeater-:last-child {
    border-bottom: none;
}

.ccrf-repeater--label {
    width: 280px;
    font-size: 14px;
    font-weight: 500;
    padding-top: 4px;
    color: var(--ccrf-text);
}

.ccrf-repeater--content {
    flex: 1;
}

.ccrf-repeater--content input[type="text"],
.ccrf-repeater--content input[type="number"],
.ccrf-repeater--content select {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-family: var(--ccrf-font);
    font-size: 14px;
}

.ccrf-repeater--content select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.ccrf-desc {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: var(--ccrf-text-muted);
}

/* Color Grid Layout */
.ccrf-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.ccrf-color-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s ease;
}

.ccrf-color-card:hover {
    border-color: #cbd5e1;
}

.ccrf-color-card-label {
    font-size: 13.5px;
    color: #64748b;
    font-weight: 500;
    font-family: var(--ccrf-font);
}

.ccrf-color-card .wp-picker-container {
    display: flex;
    align-items: center;
}

.ccrf-color-card .wp-color-result.button {
    margin: 0 8px 0 0;
    border-radius: 4px;
}

/* Toggle Switch */
.ccrf-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.ccrf-toggle input {
    appearance: none;
    background: #cbd5e1;
    width: 44px;
    height: 24px;
    border-radius: 24px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background 0.3s;
    margin: 0;
    border: none;
}

.ccrf-toggle input::before {
    display: none !important;
}

.ccrf-toggle input::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.ccrf-toggle input:checked {
    background: var(--ccrf-primary);
}

.ccrf-toggle input:checked::after {
    transform: translateX(20px);
}

.ccrf-toggle span {
    font-size: 14px;
    color: var(--ccrf-text-muted);
}

/* Save Button Card */
.ccrf-save-card {
    background: #fff;
    padding: 20px 24px;
    border: 1px solid var(--ccrf-border);
    border-radius: var(--ccrf-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* Stronger shadow for floating */
    margin-bottom: 24px;
    position: sticky;
    bottom: 20px;
    z-index: 99;
}

.ccrf-save-card input.button-primary.ccrf-btn {
    background: var(--ccrf-primary);
    border: none;
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    font-family: var(--ccrf-font);
    font-weight: 500;
    cursor: pointer;
    font-size: 14.5px;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
    text-shadow: none;
    height: auto;
    line-height: normal;
    transition: all 0.2s;
}

.ccrf-save-card input.button-primary.ccrf-btn:hover {
    background: var(--ccrf-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.4);
}


.ccrf-plugin-card__cta {
    margin-top: 6px;
    display: flex;
    align-items: center;
}

.ccrf-plugin-card__cta .button-primary {
    background: var(--ccrf-primary);
    border-color: var(--ccrf-primary);
}

/* Telemetry Cards */
.ccrf-telemetry-container {
    padding: 24px;
    margin-top: 24px;
}
.ccrf-telemetry-label {
    font-family: var(--ccrf-font);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 16px 0;
}
.ccrf-telemetry-options {
    display: flex;
    gap: 20px;
}
.ccrf-telemetry-option {
    flex: 1;
    border: 1px solid var(--ccrf-border);
    border-radius: 8px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.ccrf-telemetry-option:hover {
    border-color: #cbd5e1;
}
.ccrf-telemetry-option.selected {
    border-color: var(--ccrf-primary);
    box-shadow: inset 0 0 0 1px var(--ccrf-primary);
}
.ccrf-telemetry-option-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 16px;
}
.ccrf-telemetry-option-header input[type="radio"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
}
.ccrf-telemetry-title strong {
    display: block;
    font-size: 15px;
    font-family: var(--ccrf-font);
    color: #1e293b;
    margin-bottom: 4px;
}
.ccrf-telemetry-title span {
    font-size: 13px;
    color: var(--ccrf-text-muted);
}
.ccrf-telemetry-desc {
    font-size: 13px;
    color: var(--ccrf-text-muted);
    line-height: 1.5;
}

/* Modal Overlay */
.ccrf-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ccrf-telemetry-modal {
    background: #fff;
    padding: 36px 40px;
    border-radius: 16px;
    max-width: 540px;
    text-align: left;
    font-family: var(--ccrf-font);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    box-sizing: border-box;
}
.ccrf-modal-pill {
    display: inline-block;
    background: #eff1fe;
    color: #6167f8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}
.ccrf-telemetry-modal h2 {
    font-family: var(--ccrf-font);
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #000;
    line-height: 1.3;
}
.ccrf-telemetry-modal p {
    color: #475569;
    margin: 0 0 20px 0;
    line-height: 1.6;
    font-size: 15px;
}
.ccrf-modal-list {
    margin: 0 0 24px 0;
    padding: 0;
    list-style: none;
}
.ccrf-modal-list li {
    position: relative;
    padding-left: 24px;
    color: #475569;
    margin-bottom: 8px;
    font-size: 14.5px;
}
.ccrf-modal-list li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1;
}
.ccrf-modal-footer-text {
    font-size: 14px !important;
    margin-bottom: 28px !important;
}
.ccrf-modal-actions {
    display: flex;
    gap: 12px;
}
.ccrf-modal-actions .ccrf-repeater-allow {
    background: #6167f8;
    border-color: #6167f8;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 6px 18px;
    border-radius: 6px;
    height: auto;
    line-height: 2;
    text-transform: none;
    box-shadow: none;
}
.ccrf-modal-actions .ccrf-repeater-allow:hover {
    background: #4f55e5;
    border-color: #4f55e5;
}
.ccrf-modal-actions .ccrf-repeater-deny {
    background: transparent;
    border: 1px solid #94a3b8;
    color: #334155;
    font-weight: 500;
    font-size: 14px;
    padding: 6px 18px;
    border-radius: 6px;
    height: auto;
    line-height: 2;
    text-transform: none;
    text-decoration: none;
    transition: all 0.2s;
}
.ccrf-modal-actions .ccrf-repeater-deny:hover {
    border-color: #64748b;
    color: #0f172a;
}

/* Style Customizer Panel styling */
.ccrf-card-subheader {
    font-family: var(--ccrf-font);
    font-size: 14px;
    color: var(--ccrf-text);
    border-bottom: 1px solid var(--ccrf-border);
}

.ccrf-slider-val {
    font-size: 14px;
    font-weight: 600;
    color: var(--ccrf-primary);
    min-width: 40px;
}

/* Color picker styling fixes inside rows */
.ccrf-repeater--content .wp-picker-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ccrf-repeater--content .wp-color-result-text {
    border-radius: 0 4px 4px 0;
}

.ccrf-repeater--content input[type="text"].wp-color-picker {
    width: 80px !important;
    padding: 3px 6px !important;
    height: auto !important;
    font-size: 12px !important;
}

/* Live Preview Widget details */
.ccrf-preview-repeater-container {
    padding: 15px;
    background: #f8fafc;
    border: 1px dashed var(--ccrf-border);
    border-radius: 8px;
    margin-top: 10px;
}

.ccrf-preview-repeater-container .ccrf-repeater-row {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    position: relative;
}

.ccrf-preview-repeater-container button {
    display: inline-flex;
    align-items: center;
    border: none;
    cursor: pointer;
    font-family: var(--ccrf-font);
}

.ccrf-preview-repeater-container .ccrf-repeater-add {
    background: #4CAF50;
    color: #fff;
    padding: 6px 12px;
    margin-top: 10px;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.2s;
}

.ccrf-preview-repeater-container .ccrf-repeater-remove {
    background: #ff4d4d;
    color: #fff;
    padding: 4px 8px;
    margin-top: 5px;
    border-radius: 3px;
    font-size: 12px;
    transition: background 0.2s;
}

.ccrf-preview-repeater-container .ccrf-repeater-duplicate {
    background: #2196F3;
    color: #fff;
    padding: 4px 8px;
    margin-top: 5px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 5px;
    transition: background 0.2s;
}

/* Make range slider look premium */
.ccrf-style-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #cbd5e1;
    outline: none;
    transition: background 0.2s;
}

.ccrf-style-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ccrf-primary);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.1s;
}

.ccrf-style-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

