:root {
    --om-primary: var(--text);
    --om-accent: var(--secondary);
    --om-bg: var(--bg);
    --om-card-bg: var(--surface);
    --om-text: var(--text);
    --om-text-secondary: var(--text-secondary);
    --om-border: var(--border);
    --om-radius: var(--radius-md);
}

/* Reset WP Admin Styles within our wrapper */
.olami-settings-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    max-width: 900px;
    margin: 40px auto;
    color: var(--om-text);
}

.olami-settings-wrap * {
    box-sizing: border-box;
}

.olami-settings-wrap h1 {
    font-weight: 700;
    font-size: 40px;
    letter-spacing: -0.005em;
    margin-bottom: 40px;
    color: var(--om-primary);
}

.om-card {
    background: var(--om-card-bg);
    border-radius: var(--om-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    padding: 25px 20px;
    margin-bottom: 25px;
}

.om-section-title {
    font-size: 21px;
    font-weight: 600;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.om-form-group {
    margin-bottom: 25px;
}

.om-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--om-text);
}

.om-desc {
    font-size: 13px;
    color: var(--om-text-secondary);
    margin-top: 6px;
    line-height: 1.4;
}

/* Inputs */
.om-input,
.om-select,
.om-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid var(--om-border);
    border-radius: 8px;
    background: var(--surface);
    transition: all 0.2s ease;
}

.om-input:focus,
.om-select:focus {
    border-color: var(--om-accent);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
    outline: none;
}

/* Color Picker Overrides */
.wp-picker-container {
    display: block !important;
}

.wp-color-result {
    border-radius: 8px !important;
    height: 40px !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1) !important;
}

/* Toggle Switch */
.om-toggle {
    appearance: none;
    width: 50px;
    height: 30px;
    background: var(--border);
    border-radius: 30px;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
}

.om-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    background: var(--surface);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: 0.3s;
}

.om-toggle:checked {
    background: var(--success);
}

.om-toggle:checked::after {
    transform: translateX(20px);
}

/* Image Upload */
.om-image-preview {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    background: var(--bg);
    border: 2px dashed var(--border);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: 0.2s;
}

.om-image-preview:hover {
    border-color: var(--om-accent);
    background: var(--info-bg);
}

.om-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.om-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 99px;
    background: var(--om-accent);
    color: var(--surface);
    border: none;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}

.om-btn:hover {
    background: var(--secondary-hover);
    transform: scale(1.02);
}

.om-save-bar button:hover {
    background: var(--text);
    color: var(--surface);
    transform: scale(1.02);
}

/* Checkboxes */
.om-checkbox-group {
    margin-top: 10px;
}

.om-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 10px;
}

.om-checkbox-label input {
    display: none;
}

.om-checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s;
}

.om-checkbox-label input:checked+.om-checkmark {
    background: var(--om-primary);
    border-color: var(--om-primary);
}

.om-checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.om-checkbox-label input:checked+.om-checkmark::after {
    display: block;
}

.om-cb-text {
    font-size: 15px;
    font-weight: 500;
    padding-top: 2px;
}

.om-btn-secondary {
    background: var(--border-light);
    color: var(--text);
}

.om-btn-secondary:hover {
    background: var(--border);
}

/* Save Bar */
.om-save-bar {
    position: sticky;
    bottom: 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 15px 25px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-top: 40px;
    z-index: 100;
}

/* Repeater for Programs */
.om-repeater-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.om-repeater-remove {
    color: var(--danger);
    cursor: pointer;
    font-size: 18px;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

@media screen and (max-width: 1024px) {
    .olami-settings-wrap {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .om-card {
        padding: 25px 20px;
    }
}

@media screen and (max-width: 782px) {
    .olami-settings-wrap {
        margin: 15px auto;
        padding: 0 10px;
        max-width: 100%;
    }
    
    .olami-settings-wrap h1 {
        font-size: 28px;
        margin-bottom: 25px;
    }
    
    .om-card {
        padding: 20px 15px;
        margin-bottom: 20px;
        border-radius: 10px;
    }
    
    .om-section-title {
        font-size: 18px;
        margin-bottom: 18px;
        padding-bottom: 12px;
        flex-wrap: wrap;
    }
    
    .om-form-group {
        margin-bottom: 20px;
    }
    
    .om-label {
        font-size: 13px;
    }
    
    .om-desc {
        font-size: 12px;
    }
    
    /* Inputs - prevent zoom on iOS */
    .om-input,
    .om-select,
    .om-textarea {
        padding: 14px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    /* Buttons - full width on mobile */
    .om-btn {
        padding: 14px 20px;
        font-size: 15px;
        width: 100%;
        text-align: center;
    }
    
    .om-btn-secondary {
        width: 100%;
    }
    
    /* Toggle */
    .om-toggle {
        width: 46px;
        height: 28px;
    }
    
    .om-toggle::after {
        width: 24px;
        height: 24px;
    }
    
    .om-toggle:checked::after {
        transform: translateX(18px);
    }
    
    /* Image Upload */
    .om-image-preview {
        width: 100px;
        height: 100px;
    }
    
    /* Checkbox */
    .om-checkbox-label {
        gap: 12px;
    }
    
    .om-checkmark {
        width: 24px;
        height: 24px;
    }
    
    .om-cb-text {
        font-size: 14px;
    }
    
    /* Save Bar - make it fixed at bottom on mobile */
    .om-save-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        margin: 0;
        padding: 15px 20px;
        flex-direction: column;
        gap: 12px;
        z-index: 9999;
    }
    
    .om-save-bar button {
        width: 100%;
    }
    
    /* Add padding at bottom to account for fixed save bar */
    .olami-settings-wrap {
        padding-bottom: 120px;
    }
    
    /* Repeater */
    .om-repeater-row {
        flex-wrap: wrap;
    }
    
    .om-repeater-row input {
        flex: 1 1 100%;
        margin-bottom: 8px;
    }
}

@media screen and (max-width: 480px) {
    .olami-settings-wrap {
        padding: 0 8px;
    }
    
    .olami-settings-wrap h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .om-card {
        padding: 15px 12px;
        border-radius: 8px;
    }
    
    .om-section-title {
        font-size: 16px;
    }
    
    .om-input,
    .om-select,
    .om-textarea {
        padding: 12px;
    }
    
    .om-image-preview {
        width: 80px;
        height: 80px;
    }
    
    .om-save-bar {
        padding: 12px 15px;
    }
}