/* Models View Styling */
.models-grid-container {
    padding: var(--space-lg);
    animation: fadeIn 0.3s ease;
}

.models-table-wrapper {
    background: var(--bg-surface);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

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

.admin-table th {
    background: var(--bg-surface-hover);
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.825rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover {
    background: var(--bg-surface-hover);
}

.model-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.model-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.model-name-text {
    font-weight: 600;
    color: var(--text-primary);
}

.desc-cell {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.status-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-deleted {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.row-deleted {
    opacity: 0.6;
    background: var(--bg-body) !important;
}

.actions-cell {
    width: 120px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.action-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

.action-btn.restore-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: #3b82f6;
}

/* Modal Styling Improvements */
.form-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.form-checkbox-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.emoji-picker-container {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.selected-emoji-preview {
    font-size: 2.5rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-hover);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    flex-shrink: 0;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    padding: 8px;
    background: var(--bg-surface-hover);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.emoji-option {
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.emoji-option:hover {
    background: var(--bg-surface);
    transform: scale(1.1);
}

.emoji-option.active {
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

.flex-2 {
    flex: 2;
}

.flex-1 {
    flex: 1;
}

.toggle-control {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--bg-surface-hover);
    border-radius: 20px;
    transition: 0.3s;
    border: 1px solid var(--border-color);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background: var(--accent-color);
}

input:checked+.toggle-slider:before {
    transform: translateX(16px);
    background: white;
}

#show-deleted-toggle {
    display: none;
}

/* Tab Styling */
.view-tabs {
    display: flex;
    gap: 8px;
    margin: 0 var(--space-lg) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.view-tab {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.view-tab:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.view-tab.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Sorting View Styling */
.sorting-view-container {
    padding: 0 var(--space-lg) var(--space-lg);
}

.sorting-header {
    background: var(--bg-surface);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.sorting-header h3 {
    margin: 0;
}

.sorting-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

#save-order-btn {
    position: absolute;
    right: 24px;
    top: 24px;
}

.sorting-lists-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}

.sorting-section h4 {
    margin: 0 0 12px 4px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.draggable-list {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    min-height: 100px;
}

.sortable-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: move;
    transition: all 0.2s;
}

.sortable-item:last-child {
    margin-bottom: 0;
}

.sortable-item:hover {
    border-color: var(--text-muted);
    background: var(--bg-surface-hover);
    transform: translateX(4px);
}

.sortable-item.dragging {
    opacity: 0.5;
    border: 2px dashed var(--accent-color);
    background: var(--bg-surface-hover);
}

.drag-handle {
    color: var(--text-muted);
    font-size: 1.2rem;
    user-select: none;
}

.item-name {
    font-weight: 600;
    flex: 1;
}

.item-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
    background: var(--bg-surface-hover);
    padding: 2px 6px;
    border-radius: 4px;
}

.empty-list {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.875rem;
}