/* Simple Frontend Manager V19 - Image Removal Fix */

.sfm-wrapper {
    max-width: 1200px;
    margin: 2rem auto;
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
}

.sfm-header-row, .sfm-form-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.sfm-main-title { margin: 0 !important; font-size: 2rem !important; font-weight: 900 !important; text-transform: uppercase !important; color: #0f172a !important; }
.sfm-back-link { color: #2563eb; text-decoration: none; font-weight: 800; font-size: 0.8rem; text-transform: uppercase; }

/* PRODUCT LINK IN LIST */
.sfm-product-link {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
}

.sfm-product-link:hover {
    color: #2563eb;
}

/* POGAS */
.sfm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.2s;
}

.sfm-btn-add {
    background: #2563eb !important;
    color: #ffffff !important;
    padding: 0.8rem 1.5rem !important;
    border-radius: 0.75rem !important;
    font-weight: 800 !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2) !important;
}

.sfm-btn-add:hover {
    background: #1d4ed8 !important;
    transform: translateY(-1px);
}

.sfm-btn-edit { background: #2563eb !important; color: #ffffff !important; min-width: 80px !important; font-size: 0.75rem; padding: 0.5rem 1rem; border-radius: 0.5rem; font-weight: 800; text-transform: uppercase; }
.sfm-btn-delete { background: #fee2e2 !important; color: #dc2626 !important; min-width: 80px !important; font-size: 0.75rem; padding: 0.5rem 1rem; border-radius: 0.5rem; font-weight: 800; text-transform: uppercase; }

.sfm-form-grid { display: grid; gap: 2rem; }
.sfm-field-group { display: flex; flex-direction: column; gap: 0.6rem; }
.sfm-field-group label { font-weight: 800; text-transform: uppercase; font-size: 0.75rem; color: #64748b; letter-spacing: 0.025em; }
.sfm-required { color: #ef4444; margin-left: 2px; }

.sfm-form-grid input[type="text"], .sfm-form-grid input[type="number"], .sfm-form-grid select {
    padding: 0.8rem 1rem !important; border: 2px solid #f1f5f9 !important; border-radius: 0.75rem !important;
    background: #f8fafc !important; font-size: 1rem !important; font-weight: 600 !important; outline: none !important;
}

.sfm-field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.sfm-field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.sfm-field-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

.sfm-field-info { font-size: 0.75rem; color: #94a3b8; font-style: italic; margin: 0; }
.sfm-preview-box { background: #eff6ff; padding: 0.7rem 1.2rem; border-radius: 0.5rem; color: #1d4ed8; font-size: 0.85rem; font-weight: 700; }

/* KATEGORIJU LAUKS - ŠAURĀKS */
.sfm-cat-group { max-width: 350px; }
.sfm-multi-select { height: 160px !important; padding: 0.5rem !important; width: 100% !important; }

/* ATTR MESSAGE STYLE */
.sfm-attr-msg {
    font-size: 0.75rem;
    color: #64748b;
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border-left: 3px solid #cbd5e1;
    margin-top: 0.4rem;
    display: none !important;
}

.sfm-attr-msg.is-new {
    color: #b45309 !important;
    background: #fffbeb !important;
    border-left-color: #f59e0b !important;
    display: block !important;
}

.sfm-media-uploader { background: #fcfcfc; border: 2px dashed #e2e8f0; padding: 1.5rem; border-radius: 1rem; text-align: center; }
.sfm-btn-media { background: #ffffff !important; border: 1px solid #d1d5db !important; color: #374151 !important; padding: 0.5rem 1.5rem !important; font-size: 0.8rem !important; cursor: pointer; }
.sfm-main-image-preview, .sfm-gallery-preview { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }

/* MEDIA ITEM & REMOVE BUTTON */
.sfm-media-item {
    position: relative;
    border: 2px solid #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: visible; /* To show X outside if needed, but currently inside */
}

.sfm-remove-media {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #ef4444 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 14px !important;
    line-height: 18px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    z-index: 10;
}

.sfm-remove-media:hover {
    background: #dc2626 !important;
    transform: scale(1.1);
}

.sfm-editor-wrapper { border: 2px solid #f1f5f9; border-radius: 1rem; overflow: hidden; }
.sfm-btn-submit { background: #10b981 !important; color: #ffffff !important; padding: 1.25rem 4rem !important; font-size: 1.1rem !important; border-radius: 1rem !important; border: none !important; font-weight: 900 !important; cursor: pointer !important; transition: all 0.2s; box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3) !important; }
.sfm-btn-submit:hover { background: #059669 !important; transform: translateY(-2px); }

/* LIST VIEW */
.sfm-actions-btns { display: flex; justify-content: flex-end; gap: 0.5rem; }
.sfm-brand-badge {
    background: #d1e8ff !important;
    color: #2271b1 !important;
    padding: 3px 10px !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: inline-block !important;
}

.sfm-price { font-weight: 400 !important; font-size: 1rem; color: #1e293b; }
.sfm-row-number { font-family: monospace; font-weight: 800; color: #94a3b8; }
.sfm-table { width: 100%; border-collapse: collapse; }
.sfm-table th { background: #f8fafc; padding: 1rem; text-transform: uppercase; font-size: 0.75rem; font-weight: 800; color: #64748b; border-bottom: 1px solid #f1f5f9; }
.sfm-table td { padding: 1rem; border-bottom: 1px solid #f8fafc; vertical-align: middle; }
.sfm-thumb img { width: 48px; height: 48px; object-fit: cover; border-radius: 0.4rem; }

/* EKRĀNA OPCIJAS PANELIS */
.sfm-screen-options-group {
    display: flex;
    align-items: center;
    background: #fcfcfc;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.sfm-btn-outline, .sfm-btn-save-cols {
    background: #f0f0f1;
    border: 1px solid #dcdcde;
    padding: 0.4rem 1rem;
    border-radius: 0.25rem;
    font-weight: 400;
    color: #3c434a;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.sfm-hidden-panel {
    display: none;
    align-items: center;
    gap: 1.5rem;
    flex-grow: 1;
    margin-left: 1rem;
}

.sfm-checkbox-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: nowrap;
}

.sfm-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 13px;
    color: #3c434a;
    cursor: pointer;
    white-space: nowrap;
}

.sfm-arrow-indicator { color: #cbd5e1; font-weight: bold; }

.sfm-search-input-wrapper { position: relative; width: 100%; }
.sfm-input-search { width: 100% !important; padding: 0.75rem 1rem 0.75rem 3.5rem !important; border: 2px solid #f1f5f9 !important; border-radius: 1rem !important; font-size: 1.125rem !important; font-weight: 600 !important; background: #ffffff !important; outline: none !important; }
.sfm-search-icon { position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: #cbd5e1; }

.select2-container--default .select2-selection--single { height: 46px !important; border: 2px solid #f1f5f9 !important; border-radius: 0.75rem !important; background: #f8fafc !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 44px !important; padding-left: 1rem !important; font-weight: 600; }
