/* ==========================================================================
   Sifency Metabox Framework - Modern Admin Styles
   ========================================================================== */

/* --- Variables for Easy Theming --- */
.sifency-metabox-wrapper {
    --sifency-bg-light: #f6f7f7;
    --sifency-bg-hover: #f0f0f1;
    --sifency-text-color: #2c3338;
    --sifency-label-color: #1d2327;
    --sifency-desc-color: #646970;
    --sifency-danger-color: #d63638;
    --sifency-danger-hover: #b32d2e;
}

/* --- General Layout & Typography --- */
.sifency-metabox-wrapper {
    margin: -12px -12px 0; /* Fills the default WordPress metabox padding */
}

.sifency-addons-field-row {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border-bottom: 1px solid var(--sifency-border-color);
    transition: background-color 0.2s ease-in-out;
}
.sifency-addons-field-row:hover {
    background-color: var(--sifency-bg-light);
}
.sifency-addons-field-row:last-child {
    border-bottom: none;
}

.sifency-addons-label-col {
    flex: 0 0 220px;
    padding-right: 20px;
}
.sifency-addons-label-col label {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--sifency-label-color);
}

.sifency-addons-field-col {
    flex: 1;
}
.sifency-addons-field-col .description {
    font-size: 13px;
    color: var(--sifency-desc-color);
    margin-top: 8px;
}

.sifency-addons-field-col input[type='text'],
.sifency-addons-field-col input[type='email'],
.sifency-addons-field-col input[type='url'],
.sifency-addons-field-col input[type='number'],
.sifency-addons-field-col input[type='date'],
.sifency-addons-field-col input[type='time'],
.sifency-addons-field-col select,
.sifency-addons-field-col .sifency-field-date,
.sifency-addons-field-col textarea {
    width: 100%;
    max-width: 500px;
    padding: 8px 12px;
    border: 1px solid var(--sifency-border-color);
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.sifency-addons-field-col input:focus,
.sifency-addons-field-col select:focus,
.sifency-addons-field-col textarea:focus {
    border-color: var(--sifency-accent);
    box-shadow: none;
    outline: none;
}
.sifency-addons-field-col textarea {
    min-height: 120px;
}

/* ==========================================================================
   Specific Field Type Styles
   ========================================================================== */

/* --- Field: Button Set --- */
.sifency-button-set {
    display: inline-flex;
    border: 1px solid var(--sifency-border-color);
    border-radius: 4px;
    overflow: hidden;
}
.sifency-button-set input[type='radio'] { display: none; }
.sifency-button-set label {
    padding: 8px 18px;
    border-right: 1px solid var(--sifency-border-color);
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    transition: background-color 0.2s, color 0.2s;
}
.sifency-button-set label:last-of-type { border-right: none; }
.sifency-button-set label:hover { background-color: var(--sifency-bg-hover); }
.sifency-button-set input[type='radio']:checked + label {
    background-color: var(--sifency-accent);
    color: #fff;
    border-color: var(--sifency-accent);
}

/* --- Field: Media & Upload --- */
.sifency-media-preview img,
.sifency-upload-filename {
    margin-top: 10px;
    border: 1px solid var(--sifency-border-color);
    border-radius: 4px;
    padding: 5px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.sifency-upload-filename {
    display: inline-block;
    padding: 8px 12px;
    margin-top: 0;
    font-family: monospace;
    vertical-align: middle;
    margin-right: 8px;
}
.sifency-media-field .button,
.sifency-upload-field .button {
    margin-right: 4px;
    vertical-align: middle;
}
.sifency-media-remove, .sifency-upload-remove {
    color: var(--sifency-danger-color) !important;
}
.sifency-media-remove:hover, .sifency-upload-remove:hover {
    color: var(--sifency-danger-hover) !important;
}
.sifency-media-remove{
    border: none !important;
    box-shadow: none !important;
}

/* --- Field: Checkbox --- */
.sifency-checkbox-group label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
}
.sifency-checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: -2px;
}

/* --- Field: Slider --- */
.sifency-slider-wrapper { display: flex; align-items: center; max-width: 500px; }
.sifency-slider-value {
    font-weight: 600;
    font-size: 14px;
    background: var(--sifency-bg-light);
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid var(--sifency-border-color);
    min-width: 50px;
    text-align: center;
    margin-left: 20px;
}
input[type=range].sifency-slider-input {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}
input[type=range].sifency-slider-input:focus { outline: none; }
input[type=range].sifency-slider-input::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--sifency-border-color);
    border-radius: 3px;
}
input[type=range].sifency-slider-input::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--sifency-accent);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -7px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input[type=range].sifency-slider-input::-moz-range-track {
    width: 100%; height: 6px; cursor: pointer; background: var(--sifency-border-color); border-radius: 3px;
}
input[type=range].sifency-slider-input::-moz-range-thumb {
    height: 20px; width: 20px; border-radius: 50%; background: var(--sifency-accent); cursor: pointer; border: 0; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* --- Field: Repeater --- */
.sifency-addons-field-type-repeater .sifency-repeater-items { margin-bottom: 15px; }
.sifency-repeater-row {
    background: var(--sifency-bg-light);
    border: 1px solid var(--sifency-border-color);
    border-radius: 4px;
    padding: 15px 15px 5px 50px;
    margin-bottom: 10px;
    position: relative;
}
.sifency-repeater-sub-field { margin-bottom: 15px; }
.sifency-repeater-sub-field label {
    font-size: 13px;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}
.sifency-repeater-handle {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: #999;
    cursor: move;
}
.sifency-repeater-handle:before {
    content: '+'; font-family: dashicons; font-size: 24px;
}
.sifency-repeater-remove {
    position: absolute; top: 10px; right: 10px; color: var(--sifency-danger-color);
}
.sifency-repeater-remove:hover { color: var(--sifency-danger-hover); }
.repeater-placeholder {
    border: 2px dashed var(--sifency-accent); background: #eef5fa; height: 60px;
}

.sifency-metabox-wrapper button.sifency-upload-remove{
    border: none;
}

.sifency-metabox-wrapper button.sifency-upload-add,
.sifency-metabox-wrapper button.sifency-repeater-add,
.sifency-metabox-wrapper button.sifency-media-upload{
    background-color: var(--sifency-accent) !important;
    background: var(--sifency-accent) !important;
    border: none !important;
    color: var(--white-color) !important;
}