/* Frontend Admin Dashboard Styles */

.svl-frontend-admin {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.svl-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.svl-admin-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.svl-admin-actions {
    display: flex;
    gap: 10px;
}

.svl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.svl-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.svl-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.svl-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.svl-btn-secondary:hover {
    background: #e8e8e8;
}

.svl-btn-danger {
    background: #ef4444;
    color: white;
}

.svl-btn-danger:hover {
    background: #dc2626;
}

.svl-btn-success {
    background: #10b981;
    color: white;
}

.svl-btn-success:hover {
    background: #059669;
}

.svl-btn-full {
    width: 100%;
    justify-content: center;
}

.svl-btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

/* Stats Grid */
.svl-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.svl-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 15px;
}

.svl-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.svl-stat-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.svl-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Tabs */
.svl-admin-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}

.svl-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.svl-tab-btn:hover {
    color: #333;
    background: #f8f9fa;
}

.svl-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8f9fa;
}

/* Tab Content */
.svl-tab-content {
    display: none;
}

.svl-tab-content.active {
    display: block;
}

/* Content Card */
.svl-content-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.svl-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.svl-card-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

/* Search Box */
.svl-search-box {
    position: relative;
}

.svl-search-box input {
    padding: 10px 15px 10px 40px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    width: 300px;
    transition: border-color 0.2s;
}

.svl-search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.svl-search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #999;
}

/* Table */
.svl-table-container {
    overflow-x: auto;
}

.svl-admin-table {
    width: 100%;
    border-collapse: collapse;
}

.svl-admin-table thead th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #e0e0e0;
}

.svl-admin-table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
}

.svl-admin-table tbody tr {
    transition: background 0.2s;
}

.svl-admin-table tbody tr:hover {
    background: #f8f9fa;
}

.svl-admin-table tbody tr.ui-sortable-helper {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.drag-handle {
    cursor: grab;
    font-size: 18px;
    color: #999;
    text-align: center;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Form Groups */
.svl-form-group {
    margin-bottom: 20px;
}

.svl-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.svl-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.svl-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Modal */
.svl-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svl-modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.svl-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.svl-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.svl-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svl-modal-close:hover {
    color: #333;
}

/* Spinner */
.svl-spinner {
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Settings Grid */
.svl-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.svl-setting-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.svl-setting-link:hover {
    background: #e8e8e8;
    transform: translateY(-2px);
}

.svl-setting-icon {
    font-size: 32px;
}

.svl-setting-link h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.svl-setting-link p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.svl-setting-link .arrow {
    margin-left: auto;
    font-size: 20px;
    color: #999;
}

/* Offer List */
.offer-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.offer-item h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.offer-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.offer-stat {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.offer-details summary {
    transition: background 0.2s;
}

.offer-details summary:hover {
    background: #e8e8e8 !important;
}

.offer-details[open] summary {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 10px;
}

.offer-recipients table {
    font-size: 13px;
}

/* Notices */
.svl-notice {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 14px;
}

.svl-notice-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.svl-notice-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.svl-notice-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Add this to frontend-admin.css at the end */

/* Export/Import Buttons */
.svl-card-header > div {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

#svl-import-file {
    padding: 10px;
    cursor: pointer;
}

#svl-import-file::-webkit-file-upload-button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #667eea;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#svl-import-file::-webkit-file-upload-button:hover {
    background: #5568d3;
}

/* Modal Base Styles - Make sure these are present */
.svl-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0,0,0,0.5) !important;
    z-index: 99999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Import Modal Specific */
#svl-import-modal {
    z-index: 99999 !important;
}

#svl-import-modal.svl-modal {
    display: none;
    position: fixed;
    align-items: center;
    justify-content: center;
}

#svl-import-modal .svl-modal-content {
    max-width: 600px;
    position: relative;
    z-index: 100000;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

#svl-import-modal pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Responsive adjustments for export/import buttons */
@media (max-width: 768px) {
    .svl-card-header > div {
        width: 100%;
        flex-direction: column;
    }
    
    .svl-search-box {
        width: 100%;
    }
    
    .svl-search-box input {
        width: 100%;
    }
    
    .svl-card-header .svl-btn {
        width: 100%;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .svl-admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .svl-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .svl-admin-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .svl-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .svl-search-box input {
        width: 100%;
    }
    
    .svl-table-container {
        overflow-x: scroll;
    }
    
    .svl-admin-table {
        min-width: 900px;
    }
}