/* Agents Section Styles */
/* Global body styles now in global.css */

/* Table container and common table styles now in admin-sections-shared.css */

#agents-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#agents-table th,
#agents-table td {
    text-align: left;
    vertical-align: top;
}

#agents-table tbody tr {
    transition: all 0.2s ease;
}

#agents-table tbody tr:hover {
    background-color: #f8f9fa;
}

#agents-table tbody tr td {
    border-bottom: 1px solid #e9ecef;
}

/* Sticky header - position relative to viewport when scrolling */
#agents-section main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    min-width: 0;
    /* Height is managed dynamically by JavaScript based on item count */
}

#agents-section .table-container {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    width: 100%;
    min-width: 0;
}

#agents-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f1f1f1;
}

#agents-table th {
    position: sticky;
    top: 0;
    background: #fff !important;
    z-index: 10;
}

/* Agent Toggle Button Styles */
.agent-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

.agent-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.agent-toggle-btn:active {
    transform: translateY(0);
}

.agent-toggle-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Enabled state */
.agent-enabled {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.agent-enabled .toggle-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

/* Disabled state */
.agent-disabled {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.agent-disabled .toggle-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.toggle-indicator {
    display: inline-block;
    transition: all 0.2s ease;
}

.toggle-text {
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        padding: 15px;
    }

    .table-container {
        margin-top: 15px;
    }

    #agents-table th,
    #agents-table td {
        padding: 12px 8px;
        font-size: 13px;
    }

    .agent-toggle-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #495057;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 30px;
}

/* Error state */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    gap: 10px;
}

.pagination-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-items-per-page {
    padding: 5px 8px;
    border: 1px solid #dee2e6;
    background-color: #fff;
    color: #495057;
    border-radius: 4px;
    font-size: 7px;
    font-weight: lighter;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 20px;
    min-width: 50px;
    margin-left: 4px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 10px;
    padding-right: 20px;
}

.pagination-items-per-page:hover {
    background-color: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.pagination-items-per-page:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.pagination-items-per-page option {
    text-transform: none;
    font-size: 12px;
    padding: 4px;
}

.pagination-view-all-btn {
    padding: 5px 8px;
    border: 1px solid #dee2e6;
    background-color: #fff;
    color: #495057;
    border-radius: 4px;
    font-size: 7px;
    font-weight: lighter;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    min-width: 20px;
    margin-left: 4px;
}

.pagination-view-all-btn:hover {
    background-color: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.pagination-view-all-btn i {
    font-size: 14px;
}
