/* Supabase Manager Styles */

.sm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.sm-modal-overlay.active {
    display: flex;
}

.sm-modal-content {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sm-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
}

.sm-modal-header h2 {
    margin: 0;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sm-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Header Dashboard - HUD Style */
.sm-header-dashboard {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 4px 0;
}

.sm-header-dashboard .sm-dashboard-card {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
}

.sm-header-dashboard .sm-dashboard-card:hover {
    background: rgba(255, 255, 255, 0.35);
}

.sm-header-dashboard .sm-card-icon {
    font-size: 0.85rem;
}

.sm-header-dashboard .sm-card-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.sm-header-dashboard .sm-card-value {
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
}

.sm-header-dashboard .sm-card-label {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.85);
}

/* Main Content Area */
.sm-main-content {
    display: flex;
    height: calc(90vh - 200px);
    min-height: 500px;
}

/* Sidebar */
.sm-sidebar {
    width: 220px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sm-sidebar-title {
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding: 0 10px;
}

.sm-table-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sm-table-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: #ccc;
}

.sm-table-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sm-table-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sm-table-icon {
    font-size: 1.2rem;
}

.sm-table-name {
    font-size: 0.95rem;
}

/* Data Area */
.sm-data-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Toolbar */
.sm-toolbar {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sm-search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 0.95rem;
}

.sm-search-input:focus {
    outline: none;
    border-color: #667eea;
}

.sm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.sm-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.sm-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sm-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sm-btn-danger {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: white;
}

/* Data Table */
.sm-data-table {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.sm-table-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    overflow: hidden;
}

.sm-table {
    width: 100%;
    border-collapse: collapse;
    color: #ccc;
}

.sm-table th,
.sm-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sm-table th {
    background: rgba(0, 0, 0, 0.3);
    color: #888;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    position: sticky;
    top: 0;
}

.sm-table th:hover {
    color: white;
}

.sm-table th.sorted.asc::after {
    content: ' ↑';
}

.sm-table th.sorted.desc::after {
    content: ' ↓';
}

.sm-table tbody tr {
    transition: background 0.2s;
}

.sm-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.sm-table td {
    font-size: 0.9rem;
}

.sm-null {
    color: #555;
    font-style: italic;
}

.actions-col {
    width: 100px;
}

.actions-cell {
    display: flex;
    gap: 8px;
}

.sm-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-edit-btn {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.sm-edit-btn:hover {
    background: rgba(102, 126, 234, 0.4);
}

.sm-delete-btn {
    background: rgba(245, 87, 108, 0.2);
    color: #f5576c;
}

.sm-delete-btn:hover {
    background: rgba(245, 87, 108, 0.4);
}

/* Pagination */
.sm-pagination {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sm-page-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.sm-page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.sm-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sm-page-info {
    color: #888;
    font-size: 0.9rem;
}

/* Loading & Empty States */
.sm-loading,
.sm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #888;
}

.sm-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.sm-empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Notifications */
#smNotifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sm-notification {
    background: linear-gradient(145deg, #2d2d44 0%, #1f1f35 100%);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border-left: 4px solid #667eea;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.sm-notification-success {
    border-left-color: #00b894;
}

.sm-notification-error {
    border-left-color: #f5576c;
}

.sm-notification-warning {
    border-left-color: #fdcb6e;
}

.sm-notification-info {
    border-left-color: #0984e3;
}

.sm-notification-icon {
    font-size: 1.5rem;
}

.sm-notification-content {
    flex: 1;
}

.sm-notification-title {
    font-weight: 600;
    color: white;
    margin-bottom: 3px;
}

.sm-notification-message {
    color: #aaa;
    font-size: 0.9rem;
}

.sm-notification-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.sm-notification-close:hover {
    color: white;
}

/* Edit Modal */
.sm-edit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.sm-edit-modal-overlay.active {
    display: flex;
}

.sm-edit-modal {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    width: 500px;
    max-width: 95%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sm-edit-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sm-edit-modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.2rem;
}

.sm-edit-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.sm-edit-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.sm-edit-modal-body {
    padding: 25px;
}

.sm-form-group {
    margin-bottom: 20px;
}

.sm-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #888;
    font-size: 0.9rem;
}

.sm-form-group input,
.sm-form-group select,
.sm-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1rem;
}

.sm-form-group input:focus,
.sm-form-group select:focus,
.sm-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.sm-edit-modal-actions {
    padding: 20px 25px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Bulk Upload Modal */
.sm-bulk-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.sm-bulk-modal-overlay.active {
    display: flex;
}

.sm-bulk-modal-content {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    width: 600px;
    max-width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sm-bulk-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sm-bulk-modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sm-bulk-modal-body {
    padding: 20px;
}

/* Bulk Upload Area */
.sm-bulk-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.sm-bulk-upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.sm-bulk-upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
}

.sm-bulk-upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.sm-bulk-upload-text {
    color: #888;
    margin-bottom: 10px;
}

.sm-bulk-upload-hint {
    color: #555;
    font-size: 0.85rem;
}

#smBulkFileInput {
    display: none;
}

.sm-bulk-preview {
    margin-top: 20px;
    max-height: 300px;
    overflow: auto;
}

.sm-bulk-preview pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #aaa;
    white-space: pre-wrap;
    word-wrap: break-word;
}
