/* Generic Data Table Styles */
.data-dashboard {
    padding: 20px;
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.summary-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.summary-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f4;
    border-radius: 8px;
}

.summary-content h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.summary-number {
    font-size: 32px;
    font-weight: 700;
    color: #212529;
    line-height: 1;
    margin-bottom: 4px;
}

.summary-change {
    font-size: 12px;
    color: #28a745;
    font-weight: 500;
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.search-filter {
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.table-actions {
    display: flex;
    gap: 12px;
}

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

.btn-primary {
    background: #0066cc;
    color: white;
}

.btn-primary:hover {
    background: #0052a3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: #6c757d;
    border: 1px solid #e9ecef;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

/* Loading and State Messages */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.loading-state p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.no-results p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

.error-message {
    text-align: center;
    color: #dc3545;
    padding: 40px 20px;
    font-style: italic;
}

/* Table Wrapper */
.table-wrapper {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

/* Data Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    user-select: none;
}

.data-table th[data-sort] {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.data-table th[data-sort]:hover {
    background: #e9ecef;
}

.data-table th[data-sort]:after {
    content: '↕';
    position: absolute;
    right: 8px;
    opacity: 0.5;
    font-size: 12px;
    transition: opacity 0.2s ease;
}

.data-table th[data-sort]:hover:after {
    opacity: 0.8;
}

.data-table th.sort-asc:after {
    content: '↑';
    opacity: 1;
    color: #0066cc;
}

.data-table th.sort-desc:after {
    content: '↓';
    opacity: 1;
    color: #0066cc;
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

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

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

/* Item ID Styles */
.item-id {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #6c757d;
    font-size: 13px;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Name Cell with Avatar */
.name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0066cc;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.name {
    font-weight: 500;
    color: #212529;
}

/* Field Type Styles */
.email-link, .url-link {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s ease;
}

.email-link:hover, .url-link:hover {
    text-decoration: underline;
    color: #0052a3;
}

.currency {
    font-weight: 600;
    color: #28a745;
}

.date {
    color: #6c757d;
    font-size: 13px;
}

.no-data {
    color: #adb5bd;
    font-style: italic;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.action-btn:hover {
    background: #f1f3f4;
    transform: scale(1.1);
}

.edit-btn:hover {
    background: #e3f2fd;
}

.delete-btn:hover {
    background: #ffebee;
}

.more-btn:hover {
    background: #f5f5f5;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

/* Responsive Design */
@media (max-width: 768px) {
    .data-dashboard {
        padding: 16px;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .table-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .search-filter {
        max-width: none;
    }
    
    .table-wrapper {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 700px;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .summary-card {
        padding: 16px;
    }
    
    .summary-number {
        font-size: 24px;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Animation */
.loading-state::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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


/* Taxonomy Links */
.taxonomy-link {
    color: #0066cc;
    text-decoration: none;
    background: #e3f2fd;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 4px;
    display: inline-block;
    transition: all 0.2s ease;
}

.taxonomy-link:hover {
    background: #bbdefb;
    text-decoration: none;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.items-per-page-select {
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Pagination Wrapper */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 12px 12px;
    gap: 20px;
}

.pagination-info {
    color: #6c757d;
    font-size: 14px;
}

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

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 4px;
}

.pagination-number {
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    transition: all 0.2s ease;
    min-width: 40px;
}

.pagination-number:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.pagination-number.active {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

.pagination-ellipsis {
    padding: 8px 4px;
    color: #6c757d;
    font-size: 14px;
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
}

.page-jump-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .pagination-wrapper {
        flex-direction: column;
        gap: 16px;
    }
    
    .pagination-controls-bottom {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination-jump {
        order: -1;
    }
}


/* Advanced Filters */
.advanced-filters {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: end;
    margin-bottom: 16px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select, .filter-input {
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

#custom-date-range {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

#custom-date-range label {
    margin: 0;
    font-size: 14px;
    text-transform: none;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.filter-actions button {
    padding: 8px 16px;
    font-size: 14px;
}

/* Responsive filters */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: unset;
    }
    
    .filter-actions {
        margin-left: 0;
        justify-content: stretch;
    }
    
    .filter-actions button {
        flex: 1;
    }
}


/* Enhanced Summary Cards */
.summary-change {
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

.summary-change span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* Summary card variations for different data types */
.summary-card.financial {
    border-left: 4px solid #28a745;
}

.summary-card.warning {
    border-left: 4px solid #ffc107;
}

.summary-card.danger {
    border-left: 4px solid #dc3545;
}

/* Responsive summary cards */
@media (max-width: 576px) {
    .summary-number {
        font-size: 24px;
    }
    
    .summary-change {
        font-size: 11px;
    }
}