/* ============================================= */
/* === STATUS PILLS AND COLOR TAGS (UPDATED) === */
/* ============================================= */

/* Base status pill styling */
.cupm-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Status color variations */
.status-active { background-color: #2271b1; }
.status-inactive { background-color: #d63638; }
.status-pending { background-color: #f0ad4e; }

/* Color tag wrapper and box styling */
.column-color_tag .cupm-color-tag-wrapper,
.cupm-detail-value .cupm-color-tag-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cupm-color-box {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(0,0,0,0.1);
    display: inline-block;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Color picker wrapper */
.cupm-color-picker-wrapper {
    display: flex;
    align-items: center;
}

.cupm-color-picker-wrapper .wp-picker-container {
    margin-right: 10px;
}

.cupm-color-picker-wrapper .cupm-color-preview {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: inline-block;
}

/* ============================================= */
/* === SORTABLE LIST STYLES (UPDATED) === */
/* ============================================= */

/* Base sortable list styles */
.cupm-sortable-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
    max-width: 350px; /* Default width from new file */
}

.cupm-sortable-list li {
    margin: 0;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cupm-sortable-list li:last-child {
    border-bottom: none;
}

.cupm-sortable-list li.inactive {
    opacity: 0.6;
    background-color: #f9f9f9;
}

.cupm-sortable-list li .handle {
    cursor: move;
    color: #888;
}

.cupm-sortable-list li label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
}

.cupm-sortable-placeholder {
    height: 45px;
    background-color: #e0eaf3;
    border: 1px dashed #a4b9d2;
    margin: 0;
}

/* ============================================= */
/* === MODAL STYLES (IMPROVED FROM NEW FILE) === */
/* ============================================= */

/* Modal container with improved flex layout */
.cupm-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(25, 35, 45, 0.7);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

/* Modal content with flexbox and max-height */
.cupm-modal-content {
    background-color: #fff;
    margin: 5vh auto; /* Changed from 5% to 5vh for better vertical centering */
    padding: 0;
    border: none;
    width: 90%;
    max-width: 700px;
    max-height: 90vh; /* Prevent modal from being too tall */
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-radius: 8px;
    overflow: hidden;
    display: flex; /* New flex layout */
    flex-direction: column; /* Stack header, body, footer vertically */
}

/* Modal close button */
.cupm-modal-close {
    color: #555;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.cupm-modal-close:hover {
    color: #000;
}

/* Modal header */
.cupm-modal-header {
    padding: 20px 25px;
}

.cupm-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1d2327;
}

.cupm-modal-header .cupm-header-status {
    margin-top: 10px;
}

/* Modal body with scrollable content */
#cupm-modal-body {
    padding: 0;
    overflow-y: auto; /* Make content scrollable */
    flex: 1 1 auto; /* Allow body to grow/shrink as needed */
}

#cupm-modal-body .loading-text {
    padding: 40px;
    text-align: center;
    font-size: 16px;
    color: #555;
}

#cupm-modal-body-content {
    padding: 25px;
}

/* Details grid */
.cupm-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px 25px;
}

.cupm-detail-item {
    line-height: 1.5;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.cupm-detail-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #50575e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.cupm-detail-value {
    font-size: 15px;
    color: #1d2327;
}

/* Notes section */
.cupm-notes-section {
    margin-top: 30px;
}

.cupm-modal-notes {
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(0,0,0,0.05);
    padding: 15px;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 6px;
    line-height: 1.6;
}

.cupm-modal-notes p:first-child {
    margin-top: 0;
}

.cupm-modal-notes p:last-child {
    margin-bottom: 0;
}

/* Modal footer */
.cupm-modal-footer {
    padding: 15px 25px;
    text-align: right;
    background: #F0F0F1;
    border-top: 1px solid #ddd;
}

/* ============================================= */
/* === STATUS MANAGEMENT REPEATER FIELD === */
/* ============================================= */

#cupm-status-repeater-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
    max-width: 500px;
}

.cupm-repeater-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

#cupm-status-repeater-list li:last-child {
    border-bottom: none;
}

.cupm-repeater-item .handle {
    cursor: move;
    color: #888;
}

.cupm-repeater-item input[type="text"] {
    flex-grow: 1;
}

.cupm-repeater-item .wp-picker-container {
    flex-shrink: 0;
}

.cupm-repeater-item .remove-status {
    text-decoration: none;
    font-size: 20px;
    color: #a0a5aa;
}

.cupm-repeater-item .remove-status:hover {
    color: #d63638;
}

.cupm-repeater-placeholder {
    height: 50px;
    background-color: #e0eaf3;
    border: 1px dashed #a4b9d2;
}

#add-status-button {
    margin-top: 10px;
}

/* ============================================= */
/* === CUSTOM FIELD REPEATER FIELD === */
/* ============================================= */

#cupm-custom-fields-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
    max-width: 800px;
}

#cupm-custom-fields-list .cupm-repeater-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

#cupm-custom-fields-list li:last-child {
    border-bottom: none;
}

#cupm-custom-fields-list .handle {
    padding-top: 5px;
    cursor: move;
}

.cupm-repeater-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.cupm-repeater-fields > * {
    max-width: 400px;
}

#add-custom-field-button {
    margin-top: 10px;
}

/* ============================================= */
/* === DANGER ZONE STYLES (NEW) === */
/* ============================================= */

/* 
 * Styles for the dangerous operations section
 * Used for critical actions like data deletion
 * Visual styling makes it clear this area is different
 */
#cupm_danger_zone_section ~ table {
    border: 2px solid #d63638;
    background-color: #fef7f7;
}

/* Danger zone section header */
#cupm_danger_zone_section h2 {
    color: #d63638 !important;
    font-weight: 600;
}

/* Danger zone field styling */
.cupm-danger-zone-field p {
    margin-top: 5px;
}

/* Text input in danger zone */
.cupm-danger-zone-field input[type="text"] {
    margin-bottom: 10px;
    border-color: #d63638;
}

/* Checkbox label alignment */
.cupm-danger-zone-field label {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Disabled checkbox styling */
.cupm-danger-zone-field input[type="checkbox"]:disabled + strong {
    color: #a7aaad;
}