/**
 * Vet Clinic Analytics CSS - v1.1
 * Case details table + pagination, no revenue styles
 */

:root {
    --primary-color: #007AFF;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --error-color: #FF3B30;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F2F2F7;
    --text-primary: #000000;
    --text-secondary: #8E8E93;
    --border-color: #E5E5EA;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vet-analytics-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
}

/* Header */
.vet-analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 24px 20px;
    background: var(--bg-primary);
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--border-color);
}

.vet-analytics-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
}

.vet-title-icon {
    margin-right: 12px;
    color: var(--primary-color);
}

.vet-analytics-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

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

/* Buttons */
.vet-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.vet-btn-primary:hover {
    background: #0051D5;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.vet-btn-secondary {
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.vet-btn-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vet-btn-icon-sm {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
}

/* Filters */
.vet-analytics-filters {
    margin-bottom: 0;
    padding: 24px 20px;
    background: var(--bg-primary);
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--border-color);
}

.vet-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.vet-filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vet-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.vet-search-box {
    position: relative;
}

.vet-search-icon {
    position: absolute;
    left: 12px;
    top: 12px;
    color: var(--text-secondary);
}

.vet-search-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
}

.vet-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.vet-filter-select,
.vet-filter-date {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
}

/* Loading */
.vet-analytics-loading {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-primary);
    border-radius: 0;
    box-shadow: none;
}

.vet-spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Stats Grid */
.vet-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 0;
    padding: 20px;
    background: var(--bg-secondary);
}

.vet-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.vet-stat-card:hover {
    box-shadow: var(--shadow-md);
}

.vet-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vet-stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.vet-stat-value {
    font-size: 28px;
    font-weight: 700;
}

/* Charts */
.vet-charts-section {
    margin-bottom: 0;
    padding: 20px;
    background: var(--bg-secondary);
}

.vet-chart-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.vet-chart-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.vet-chart-header {
    display: flex;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.vet-chart-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.vet-chart-body {
    padding: 24px;
    height: 300px;
}

/* Status Grid */
.vet-status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    height: 100%;
}

.vet-status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.vet-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.vet-status-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.vet-status-value {
    font-size: 24px;
    font-weight: 700;
}

/* TABLE STYLES */
.vet-case-details-section {
    background: var(--bg-primary);
    border-radius: 0;
    box-shadow: none;
    padding: 24px 20px;
}

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

.vet-section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.vet-pagination-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.vet-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    width: 100%;
}

/* Scrollbar styling */
.vet-table-container::-webkit-scrollbar {
    height: 8px;
}

.vet-table-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.vet-table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

.vet-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.vet-case-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.vet-case-table thead {
    background: var(--bg-secondary);
}

.vet-case-table th {
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.vet-case-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.vet-case-table tr:hover {
    background: var(--bg-secondary);
}

.vet-table-empty {
    text-align: center;
    padding: 40px !important;
    color: var(--text-secondary);
}

.vet-pet-info,
.vet-owner-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vet-pet-info small,
.vet-owner-info small {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Status Badges */
.vet-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.vet-status-open {
    background: rgba(52, 199, 89, 0.1);
    color: #34C759;
}

.vet-status-under_treatment {
    background: rgba(255, 149, 0, 0.1);
    color: #FF9500;
}

.vet-status-closed {
    background: rgba(0, 122, 255, 0.1);
    color: #007AFF;
}

.vet-status-dead {
    background: rgba(255, 59, 48, 0.1);
    color: #FF3B30;
}

/* Visit Badges */
.vet-visit-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.vet-visit-vaccination {
    background: rgba(52, 199, 89, 0.1);
    color: #34C759;
}

.vet-visit-medicine {
    background: rgba(0, 122, 255, 0.1);
    color: #007AFF;
}

.vet-visit-surgery {
    background: rgba(255, 59, 48, 0.1);
    color: #FF3B30;
}

.vet-visit-consultation {
    background: rgba(255, 149, 0, 0.1);
    color: #FF9500;
}

.vet-visit-other {
    background: rgba(142, 142, 147, 0.1);
    color: #8E8E93;
}

/* Pagination */
.vet-pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.vet-pagination-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.vet-per-page-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}

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

.vet-pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vet-pagination-btn:hover:not(.disabled) {
    background: var(--primary-color);
    color: white;
}

.vet-pagination-btn.active {
    background: var(--primary-color);
    color: white;
}

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

/* Messages */
.vet-analytics-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
}

.vet-message-success {
    background: var(--success-color);
    color: white;
}

.vet-message-error {
    background: var(--error-color);
    color: white;
}

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

/* Responsive */
@media (max-width: 768px) {
    .vet-analytics-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 15px;
    }

    .vet-analytics-filters {
        padding: 20px 15px;
    }

    .vet-stats-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .vet-charts-section {
        padding: 15px;
    }

    .vet-filter-row {
        grid-template-columns: 1fr;
    }

    .vet-chart-row {
        grid-template-columns: 1fr;
    }

    .vet-case-details-section {
        padding: 20px 15px;
    }

    .vet-case-table {
        font-size: 12px;
        min-width: 800px;
    }

    .vet-case-table th,
    .vet-case-table td {
        padding: 12px 8px;
    }

    .vet-pagination-controls {
        flex-direction: column;
        gap: 16px;
    }

    
}