/* ===== CSS Variables ===== */
:root {
    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-card: #ffffff;
    
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-tertiary: #adb5bd;
    
    --border-color: #dee2e6;
    --border-light: #e9ecef;
    
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --primary-light: #e6f2ff;
    
    --success-color: #28a745;
    --success-light: #d4edda;
    --error-color: #dc3545;
    --error-light: #f8d7da;
    --warning-color: #ffc107;
    --warning-light: #fff3cd;
    --info-color: #17a2b8;
    --info-light: #d1ecf1;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.18);
    
    --header-height: 60px;
    --sidebar-width: 260px;
    --radius: 8px;
    --transition: all 0.3s ease;
    
    /* Compact sizing for desktop */
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 13px;
    --font-size-lg: 14px;
    --font-size-xl: 16px;
    
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
}

/* ===== Custom Modal Styles ===== */
#customModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

#customModal .modal-content {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

#customModal .modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

#customModal .modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--font-size-xl);
}

#customModal .close {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

#customModal .close:hover {
    background: var(--error-light);
    color: var(--error-color);
}

#customModal .modal-footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Accordion Styles */
.accordion-section {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 15px;
    overflow: hidden;
    background: var(--bg-card);
}

.accordion-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
    user-select: none;
}

.accordion-header:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--bg-tertiary));
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.accordion-title i {
    color: var(--primary-color);
    font-size: 18px;
}

.accordion-icon {
    font-size: 14px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.active {
    max-height: 1000px;
}

.accordion-section.active .accordion-icon {
    transform: rotate(90deg);
}

.accordion-inner {
    padding: 20px;
}

.form-main {
    border: none;
    background: transparent;
    padding: 0;
}

.proxy-list-main {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
}

/* 1. THÊM MỚI/TẠO MỚI - Xanh lá */
.btn-primary,
.btn[onclick*="showAddProxyModal"],
button[onclick*="showAddDataQuotaModal"] {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    border: 1px solid #10b981 !important;
    box-shadow: 0 1px 6px rgba(16, 185, 129, 0.25) !important;
    padding: 9px 12px !important;  /* KÍCH THƯỚC CHUẨN */
    font-size: 12px !important;    /* KÍCH THƯỚC CHUẨN */
}

.btn-primary:hover,
.btn[onclick*="showAddProxyModal"]:hover,
button[onclick*="showAddDataQuotaModal"]:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.4) !important;
}

/* 2. XEM/XUẤT/THỐNG KÊ - Xanh dương */
.btn-info,
button[onclick*="exportProxies"],
button[onclick*="exportSelectedProxies"],
button[onclick*="exportProxyAPIs"],
button[onclick*="exportSelectedAPIs"],
button[onclick*="showDataQuotaStats"] {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: white !important;
    border: 1px solid #3b82f6 !important;
    box-shadow: 0 1px 6px rgba(59, 130, 246, 0.25) !important;
    padding: 9px 12px !important;  /* KÍCH THƯỚC CHUẨN */
    font-size: 12px !important;    /* KÍCH THƯỚC CHUẨN */
}

.btn-info:hover,
button[onclick*="exportProxies"]:hover,
button[onclick*="exportSelectedProxies"]:hover,
button[onclick*="exportProxyAPIs"]:hover,
button[onclick*="exportSelectedAPIs"]:hover,
button[onclick*="showDataQuotaStats"]:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.4) !important;
}

/* 3. CẤU HÌNH/GIỚI HạN - Cam */
.btn-warning,
button[onclick*="showRateLimitSelectedModal"],
button[onclick*="showBandwidthLimitModal"],
button[onclick*="showDataQuotaModal"],
button[onclick*="selectTopBandwidthProxies"] {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: white !important;
    border: 1px solid #f59e0b !important;
    box-shadow: 0 1px 6px rgba(245, 158, 11, 0.25) !important;
    padding: 9px 12px !important;  /* KÍCH THƯỚC CHUẨN */
    font-size: 12px !important;    /* KÍCH THƯỚC CHUẨN */
}

.btn-warning:hover,
button[onclick*="showRateLimitSelectedModal"]:hover,
button[onclick*="showBandwidthLimitModal"]:hover,
button[onclick*="showDataQuotaModal"]:hover,
button[onclick*="selectTopBandwidthProxies"]:hover {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4) !important;
}

/* 4. GIA HạN/RESET - Tím */
.btn-success,
button[onclick*="showExtendModal"],
button[onclick*="resetDataUsageForSelected"],
button[onclick*="resetProxyPool"] {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
    color: white !important;
    border: 1px solid #8b5cf6 !important;
    box-shadow: 0 1px 6px rgba(139, 92, 246, 0.25) !important;
    padding: 9px 12px !important;  /* KÍCH THƯỚC CHUẨN */
    font-size: 12px !important;    /* KÍCH THƯỚC CHUẨN */
}

.btn-success:hover,
button[onclick*="showExtendModal"]:hover,
button[onclick*="resetDataUsageForSelected"]:hover,
button[onclick*="resetProxyPool"]:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.4) !important;
}

/* 5. XÓA/NGUY HIỂM - Đỏ */
.btn-danger,
button[onclick*="deleteAllProxies"],
button[onclick*="deleteSelectedProxies"] {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    border: 1px solid #ef4444 !important;
    box-shadow: 0 1px 6px rgba(239, 68, 68, 0.25) !important;
    padding: 9px 12px !important;  /* KÍCH THƯỚC CHUẨN */
    font-size: 12px !important;    /* KÍCH THƯỚC CHUẨN */
}

.btn-danger:hover,
button[onclick*="deleteAllProxies"]:hover,
button[onclick*="deleteSelectedProxies"]:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.4) !important;
}

/* 6. NÚT PHỤ/SECONDARY - Xám */
.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563) !important;
    color: white !important;
    border: 1px solid #6b7280 !important;
    box-shadow: 0 1px 6px rgba(107, 114, 128, 0.25) !important;
    padding: 9px 12px !important;  /* KÍCH THƯỚC CHUẨN */
    font-size: 12px !important;    /* KÍCH THƯỚC CHUẨN */
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #374151) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(107, 114, 128, 0.4) !important;
}

/* Icon trong nút */
.btn i {
    font-size: 11px !important;   /* KÍCH THƯỚC CHUẨN */
    margin-right: 4px !important;
}
/* Conversion Warning Styles */
.conversion-warning {
    margin-top: 10px;
    padding: 12px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.conversion-warning i {
    color: #f59e0b;
}

.conversion-warning span {
    color: #92400e;
    font-size: 14px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #1a1d21;
    --bg-secondary: #2d3136;
    --bg-tertiary: #3a3f44;
    --bg-card: #2d3136;
    
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --text-tertiary: #6c757d;
    
    --border-color: #495057;
    --border-light: #3a3f44;
    
    --primary-light: #002855;
    --success-light: #1e4620;
    --error-light: #5a1e28;
    --warning-light: #533f03;
    --info-light: #184e5a;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.6);
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    transition: var(--transition);
    overflow-x: hidden;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* ===== Header ===== */
.header {
    background: var(--bg-primary);
    border-bottom: 2px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

[data-theme="dark"] .header {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 28px;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 20px;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), #0099ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.version {
    background: var(--bg-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--success-color);
}

.server-status i {
    font-size: 8px;
    animation: pulse 2s infinite;
}

/* ===== Main Container ===== */
.main-container {
    max-width: 100%;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
    min-height: calc(100vh - var(--header-height) - 60px);
}

/* ===== Statistics Section ===== */
.stats-section {
    margin-bottom: var(--spacing-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-md);
}

.stats-grid.compact {
    max-width: 800px;
    margin: 0 auto;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    transition: var(--transition);
}

.stat-card.stat-total::before { background: var(--primary-color); }
.stat-card.stat-live::before { background: var(--success-color); }
.stat-card.stat-dead::before { background: var(--error-color); }
.stat-card.stat-performance::before { background: var(--warning-color); }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-total .stat-icon {
    background: var(--primary-light);
    color: var(--primary-color);
}

.stat-live .stat-icon {
    background: var(--success-light);
    color: var(--success-color);
}

.stat-dead .stat-icon {
    background: var(--error-light);
    color: var(--error-color);
}

.stat-performance .stat-icon {
    background: var(--warning-light);
    color: var(--warning-color);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

/* ===== Tab Navigation ===== */
.tab-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: var(--bg-card);
    padding: 5px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ===== Section Cards ===== */
.section-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.section-header {
    padding: 25px;
    border-bottom: 2px solid var(--border-light);
    background: linear-gradient(to right, var(--bg-card), var(--bg-secondary));
}

.section-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
}

.section-header h2 i {
    color: var(--primary-color);
    font-size: 24px;
}

.section-description {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== Forms ===== */
.proxy-form {
    padding: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group-large {
    grid-column: 1 / -1;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label i {
    color: var(--text-tertiary);
    font-size: 12px;
}

.form-group input,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
}

.form-help {
    margin-top: 5px;
    font-size: 13px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===== Credential Options ===== */
.credential-options {
    padding: 0 25px 20px;
}

.credential-options h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    transition: var(--transition);
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    transform: scale(1);
}

.radio-label input[type="radio"]:checked ~ .radio-text {
    color: var(--primary-color);
    font-weight: 500;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: var(--transition);
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    transition: var(--transition);
}

.radio-label input[type="radio"]:checked ~ .radio-custom {
    border-color: var(--primary-color);
}

.radio-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.custom-credentials {
    padding: 20px 25px 0;
    animation: slideDown 0.3s ease;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #229e3e;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.form-actions {
    padding: 0 25px 25px;
    display: flex;
    gap: 12px;
}

/* ===== Message Container ===== */
.message-container {
    padding: 0 25px;
}

.message {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.message-success {
    background: var(--success-light);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.message-error {
    background: var(--error-light);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.message-info {
    background: var(--info-light);
    color: var(--info-color);
    border: 1px solid var(--info-color);
}

.message.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

/* ===== Table ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
    width: 250px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.search-box input {
    width: 100%;
    padding: 8px 16px 8px 36px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.table-container {
    overflow-x: auto;
}

.proxy-table {
    width: 100%;
    border-collapse: collapse;
}

.proxy-table th,
.proxy-table td {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    font-size: var(--font-size-sm);
}

.proxy-table th:last-child,
.proxy-table td:last-child {
    border-right: none;
}

.proxy-table th {
    background: linear-gradient(135deg, #f0f4f8, #e2e8f0);
    font-weight: 800;
    font-size: 14px;
    color: #1a365d;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 3px solid var(--primary-color);
}

[data-theme="dark"] .proxy-table th {
    background: linear-gradient(135deg, #2d3748, #1a202c);
    color: #e2e8f0;
    border-bottom: 3px solid #4299e1;
}

.proxy-table tr {
    transition: var(--transition);
}

.proxy-table tbody tr {
    background: var(--bg-card);
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}
/* Checkbox styling - make larger and easier to click */
.proxy-checkbox,
#selectAllCheckbox {
    width: 18px !important;
    height: 18px !important;
    cursor: pointer;
    transform: scale(1.3);
    margin: 0 auto;
}

/* Center checkbox in cell */
.proxy-table td:first-child,
.proxy-table th:first-child {
    text-align: center;
    padding: 18px 10px;
    width: 60px;
}

/* Hover effect for checkbox cells */
.proxy-table td:first-child:hover {
    background: rgba(0, 102, 204, 0.1);
}

.proxy-table tbody tr:hover {
    background: linear-gradient(to right, rgba(0, 102, 204, 0.05), rgba(0, 102, 204, 0.02));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary-color);
}

[data-theme="dark"] .proxy-table tbody tr:hover {
    background: linear-gradient(to right, rgba(66, 153, 225, 0.1), rgba(66, 153, 225, 0.05));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.proxy-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== Table Elements ===== */
.port-badge {
    background: linear-gradient(135deg, var(--primary-color), #0099ff);
    color: white;
    padding: 5px 9px;
    border-radius: 18px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.3);
}

.proxy-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.proxy-original {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    background: var(--bg-tertiary);
    padding: 6px 10px;
    border-radius: 4px;
    color: var(--text-primary);
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.proxy-endpoint-full {
    display: flex;
    align-items: center;
    gap: 10px;
}

.endpoint-text {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    background: linear-gradient(135deg, #e6f2ff, #cce7ff);
    padding: 6px 12px;
    border-radius: 8px;
    color: #003d82;
    font-weight: 550;
    border: 2px solid var(--primary-color);
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.2);
}

[data-theme="dark"] .endpoint-text {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.3), rgba(23, 162, 184, 0.3));
    color: #4db8ff;
    border-color: #0066cc;
}

.btn-copy {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 16px;
}

.btn-copy:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    transform: scale(1.1);
}

.btn-copy-primary {
    color: var(--primary-color);
    font-size: 18px;
}

.btn-copy-primary:hover {
    background: var(--primary-light);
    color: var(--primary-hover);
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 400;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 20px;
    position: relative;
    z-index: 1;
}

.status i {
    font-size: 10px;
}

.status-live {
    color: white;
    background: var(--success-color);
}

.status-dead {
    color: white;
    background: var(--error-color);
}

.ping {
    font-weight: 500;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 15px;
}

.ping-good {
    color: var(--success-color);
    background: var(--success-light);
}

.ping-medium {
    color: var(--warning-color);
    background: var(--warning-light);
}

.ping-bad,
.ping-timeout {
    color: var(--error-color);
    background: var(--error-light);
}

/* Bandwidth Usage Styles */
.bandwidth-usage {
    font-weight: 500;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    min-width: 60px;
    text-align: center;
    display: inline-block;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-action {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.btn-edit {
    background: var(--warning-light);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.btn-edit:hover {
    background: var(--warning-color);
    color: white;
    transform: scale(1.1);
}

.btn-delete {
    background: var(--error-light);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.btn-delete:hover {
    background: var(--error-color);
    color: white;
    transform: scale(1.1);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    color: var(--text-tertiary);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 20px;
    margin-bottom: 24px;
    font-weight: 500;
}

/* ===== Loading Spinner ===== */
.loading-spinner {
    text-align: center;
    padding: 80px;
    color: var(--text-secondary);
}

.loading-spinner i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.loading-spinner p {
    font-size: 18px;
    font-weight: 500;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

.modal.show .modal-content {
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-actions {
    padding: 20px 25px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes rowHighlight {
    0% { background: var(--bg-card); }
    50% { background: var(--primary-light); }
    100% { background: var(--bg-card); }
}

/* ===== Table Row Effects ===== */
.proxy-table tbody tr {
    animation: fadeIn 0.3s ease;
}

.proxy-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .proxy-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.proxy-table tbody tr.new-row {
    animation: rowHighlight 1s ease;
}

/* ===== Additional Visual Enhancements ===== */
.proxy-list-section {
    margin-top: 30px;
}

.proxy-list-section .section-card {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .proxy-list-section .section-card {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* Status Pills Enhancement */
.status {
    position: relative;
}

.status-live::before,
.status-dead::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 20px;
    opacity: 0.2;
    z-index: -1;
}

.status-live::before {
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.status-dead::before {
    background: var(--error-color);
}

/* Table Header Sticky Enhancement */
.table-container {
    max-height: 850px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius) var(--radius);
}

.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* ===== Responsive Design ===== */
@media (max-width: 1200px) {
    .proxy-table {
        font-size: 14px;
    }
    
    .endpoint-text {
        font-size: 14px;
    }
    
    .proxy-table th,
    .proxy-table td {
        padding: 14px 16px;
    }
}

@media (max-width: 1024px) {
    .header-content {
        padding: 0 15px;
    }
    
    .main-container {
        padding: 20px 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .logo h1 {
        font-size: 20px;
    }
    
    .header-info {
        gap: 10px;
    }
    
    .version {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .tab-navigation {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        width: 100%;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .proxy-table {
        font-size: 13px;
    }
    
    .proxy-table th,
    .proxy-table td {
        padding: 12px 8px;
    }
    
    .proxy-original,
    .endpoint-text {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .port-badge {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .status {
        font-size: 10px;
        padding: 6px 12px;
    }
    
    .ping {
        font-size: 14px;
        padding: 4px 8px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .logo {
        gap: 8px;
    }
    
    .logo i {
        font-size: 24px;
    }
    
    .proxy-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Hide bandwidth column on mobile */
    .proxy-table th:nth-child(9),
    .proxy-table td:nth-child(9) {
        display: none;
    }
}

/* ===== Print Styles ===== */
@media print {
    .header,
    .footer,
    .tab-navigation,
    .add-proxy-section,
    .btn-action,
    .btn-copy,
    .search-box {
        display: none !important;
    }
    
    .main-container {
        padding: 0;
    }
    
    .section-card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .proxy-table {
        font-size: 12px;
    }
}
/* ===== Smart Update Transitions ===== */
.proxy-table tbody tr {
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.proxy-table tbody tr.updating {
    background-color: rgba(0, 102, 204, 0.1) !important;
}

.proxy-table tbody tr.removing {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

.proxy-table tbody tr td {
    transition: all 0.2s ease;
}

.proxy-table tbody tr .status,
.proxy-table tbody tr .ping {
    transition: all 0.3s ease;
}

/* Smooth fade for new rows */
.proxy-table tbody tr.new-row {
    animation: rowFadeIn 0.5s ease;
}

@keyframes rowFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Highlight effect for updated cells */
.proxy-table tbody tr.highlight {
    animation: rowHighlight 1s ease;
}

@keyframes rowHighlight {
    0% { background-color: transparent; }
    50% { background-color: rgba(0, 102, 204, 0.2); }
    100% { background-color: transparent; }
}

.header-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
}
.badge-socks5 {
    background: #6366f1;
    color: white;
}
.badge-http {
    background: #10b981;
    color: white;
}
/* Form Controls */
select, .form-control {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    background-color: white;
    transition: border-color 0.3s;
    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='%23333' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

select:focus, .form-control:focus {
    outline: none;
    border-color: #667eea;
}

/* Fix cho form group */
.form-group select {
    margin-top: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    select, .form-control {
        font-size: 16px; /* Prevent zoom on mobile */
    }
}
.note-cell {
    min-height: 30px;
    padding: 5px 8px;
    cursor: text;
    white-space: pre-wrap;
    word-break: break-word;
    transition: all 0.2s ease;
    font-size: 13px;
    line-height: 1.4;
}

.proxy-ip {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #2196F3;
    font-size: 14px;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Responsive cho cột note */
@media (max-width: 1200px) {
    .note-cell {
        max-width: 200px;
    }
}

/* Dark mode support nếu cần */
[data-theme="dark"] .note-cell {
    background: #2a2a2a;
    color: #f0f0f0;
}

[data-theme="dark"] .note-cell:hover {
    background: #3a3a3a;
}

[data-theme="dark"] .note-cell:focus {
    background: #1a1a1a;
    outline-color: #66bb6a;
}

[data-theme="dark"] .note-cell.saved {
    background: #1b5e20;
}

[data-theme="dark"] .note-cell.error {
    background: #b71c1c;
}
/* ===== Proxy Replace Styles ===== */
.btn-replace {
    background: var(--info-light);
    color: var(--info-color);
    border: 1px solid var(--info-color);
}

.btn-replace:hover {
    background: var(--info-color);
    color: white;
    transform: scale(1.1);
}

.btn-replace.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-key {
    background: var(--warning-light);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.btn-key:hover {
    background: var(--warning-color);
    color: white;
    transform: scale(1.1);
}

/* Replace Success Info */
.replace-success-info {
    position: fixed;
    top: 100px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 20px;
    min-width: 350px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 2000;
}

.replace-success-info.show {
    transform: translateX(0);
}

.replace-info-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.replace-info-content i {
    font-size: 32px;
    color: var(--success-color);
}

.replace-info-details strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.replace-info-ips {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.replace-info-ips .old-ip {
    color: var(--error-color);
}

.replace-info-ips .new-ip {
    color: var(--success-color);
    font-weight: 600;
}

.replace-info-ips i {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Modal Replace Confirm */
.modal-replace-confirm {
    max-width: 500px;
    text-align: center;
}

.modal-icon-info {
    background: rgba(23, 162, 184, 0.1);
}

.modal-icon-info i {
    color: var(--info-color);
}

/* API Key Modal */
.modal-api-key {
    max-width: 600px;
}

.modal-api-key .modal-body {
    padding: 20px 25px;
}

.api-key-section {
    margin-bottom: 20px;
}

.api-key-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.api-key-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.api-key-display code {
    flex: 1;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    color: var(--primary-color);
    word-break: break-all;
}

.api-key-display .btn-copy {
    flex-shrink: 0;
    padding: 8px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.api-key-display .btn-copy:hover {
    background: var(--primary-hover);
}

.api-usage-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--info-light);
    border-radius: 6px;
    font-size: 14px;
    color: var(--info-color);
}

/* Dark mode support */
[data-theme="dark"] .replace-success-info {
    background: var(--bg-card);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .api-key-display {
    background: var(--bg-primary);
}

[data-theme="dark"] .modal-replace-confirm,
[data-theme="dark"] .modal-api-key {
    background: var(--bg-card);
}

/* Responsive */
@media (max-width: 768px) {
    .replace-success-info {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
    
    .action-buttons {
        gap: 5px;
    }
    
    .btn-action {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* ===== Rate Limit Modal Styles ===== */
.modal-rate-limit {
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.rate-limit-info {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #92400e;
}

.rate-limit-info i {
    color: #f59e0b;
    font-size: 18px;
}

/* Proxy Selection Area */
.proxy-selection {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    background: var(--bg-secondary);
}

.select-all-wrapper {
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 12px;
}

.proxy-list-scroll {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 8px;
}

.proxy-list-scroll::-webkit-scrollbar {
    width: 6px;
}

.proxy-list-scroll::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.proxy-list-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

/* Proxy Item */
.proxy-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.proxy-item:last-child {
    border-bottom: none;
}

/* Selected Proxies Info */
.selected-proxies-info {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #155724;
}

.selected-proxies-info i {
    color: #28a745;
    font-size: 18px;
}

/* Proxy List Compact */
.proxy-list-compact {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    max-height: 200px;
    overflow-y: auto;
}

.proxy-item-compact {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.proxy-item-compact:last-child {
    border-bottom: none;
}

.proxy-info-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px;
    border-radius: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: var(--bg-tertiary);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.proxy-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.proxy-port {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 80px;
}

.proxy-user {
    color: var(--text-secondary);
    font-size: 14px;
    flex: 1;
}

.rate-limit-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.rate-limit-badge.no-limit {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.rate-limit-badge.has-limit {
    background: var(--warning-light);
    color: var(--warning-color);
    font-weight: 600;
}

/* Rate Limit Settings */
.rate-limit-settings {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.rate-limit-settings .form-group {
    margin-bottom: 16px;
}

.rate-limit-settings label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Time Unit Tabs */
.time-unit-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.tab-btn:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-btn i {
    margin-right: 6px;
}

/* Time Input Groups */
.time-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group .form-control {
    width: 100px;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.input-group .form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

.input-suffix {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Bulk Time Unit Tabs */
.bulk-time-unit-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 8px;
    background: var(--bg-primary);
    border-radius: 6px;
    padding: 2px;
}

.bulk-tab-btn {
    flex: 1;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.bulk-tab-btn:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.bulk-tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.bulk-time-input {
    margin-top: 4px;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-tertiary);
    font-style: italic;
}

/* Custom Rate Limit Groups */
#customRateLimitGroup,
#customRateLimitMinutesGroup {
    margin-top: 12px;
}

#customRateLimitGroup label,
#customRateLimitMinutesGroup label {
    font-size: 14px;
    margin-bottom: 6px;
}

#customRateLimitGroup input,
#customRateLimitMinutesGroup input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

#customRateLimitGroup input:focus,
#customRateLimitMinutesGroup input:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Quick Select Buttons */
.quick-select {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-select span {
    font-size: 14px;
    color: var(--text-secondary);
    margin-right: 4px;
}

.btn-quick {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.btn-quick:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.selected-count {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.selected-count span {
    color: var(--primary-color);
    font-weight: 600;
}

/* Dark mode support */
[data-theme="dark"] .rate-limit-info {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

[data-theme="dark"] .proxy-selection {
    background: var(--bg-primary);
}

[data-theme="dark"] .rate-limit-settings {
    background: var(--bg-primary);
}

[data-theme="dark"] .btn-quick {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-quick:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .input-group .form-control {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Responsive */
@media (max-width: 600px) {
    .modal-rate-limit {
        max-width: 95%;
        margin: 10px;
    }
    
    .proxy-list-scroll {
        max-height: 200px;
    }
    
    .quick-select {
        justify-content: center;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .selected-count {
        width: 100%;
        text-align: center;
    }
}
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
}
.badge-socks5 {
    background: #6366f1;
    color: white;
}
.badge-http {
    background: #10b981;
    color: white;
}
.btn-info {
    background: #0ea5e9;
    color: white;
}
.btn-info:hover {
    background: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}
.expiry-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    white-space: nowrap;
}
.expiry-active {
    background: #d1fae5;
    color: #065f46;
}
.expiry-warning {
    background: #fef3c7;
    color: #92400e;
}
.expiry-danger {
    background: #fee2e2;
    color: #991b1b;
}
.expiry-expired {
    background: #f3f4f6;
    color: #6b7280;
    text-decoration: line-through;
}
.btn-success {
    background: #10b981;
    color: white;
}
.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.modal-info {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #1e40af;
}
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}
.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
}
.radio-label input[type="radio"] {
    display: none;
}
.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #3b82f6;
}
.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #3b82f6;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.radio-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bandwidth-limit-indicator {
    display: inline-block !important;
    margin-left: 8px !important;
    padding: 2px 8px !important;
    background: #0ea5e9 !important;
    color: white !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    max-width: 80px !important;
    text-align: center !important;
}
.bandwidth-limit-indicator i {
    margin-right: 3px;
}

/* Style cho info box trong modal */
.info-box {
    background: #f0f9ff;
    border: 1px solid #0284c7;
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
    display: flex;
    gap: 12px;
}
.info-box i {
    color: #0284c7;
    font-size: 18px;
    flex-shrink: 0;
}
.info-box ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}
.info-box li {
    margin: 4px 0;
    font-size: 13px;
}

/* Dark mode cho info box */
[data-theme="dark"] .info-box {
    background: #1e3a5f;
    border-color: #0ea5e9;
}
[data-theme="dark"] .info-box i {
    color: #38bdf8;
}

/* ===== MODAL STYLES ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.alert-info {
    background: var(--info-light);
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-info i {
    color: var(--info-color);
    margin-top: 2px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #ced4da;
}

/* Dark theme cho modal */
[data-theme="dark"] .modal {
    background-color: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .alert-info {
    background: #1e3a5f;
    border-color: #0ea5e9;
    color: #bfdbfe;
}

/* ===== TOAST NOTIFICATION STYLES ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 10px;
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: auto;
    border-left: 4px solid var(--success-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.info {
    border-left-color: var(--info-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--error-color);
}

.toast.info .toast-icon {
    color: var(--info-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.toast-message {
    font-size: 13px;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-secondary);
}

/* Dark theme cho toast */
[data-theme="dark"] .toast {
    background: var(--bg-card);
    border-left-color: var(--success-color);
}

[data-theme="dark"] .toast-title {
    color: var(--text-primary);
}

[data-theme="dark"] .toast-message {
    color: var(--text-secondary);
}

/* ===== LARGE MODAL STYLES ===== */
.modal-large .modal-content {
    max-width: 900px;
    width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-body-large {
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
}

.modal-body-large::-webkit-scrollbar {
    width: 6px;
}

.modal-body-large::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.modal-body-large::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.modal-body-large::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ===== Rate Limit Selected Styles ===== */
.selected-proxies-info {
    background: #d1f2eb;
    border: 1px solid #a3e4d7;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #0d7b3a;
}

.selected-proxies-info i {
    color: #28a745;
    font-size: 18px;
}

.proxy-list-compact {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    max-height: 150px;
    overflow-y: auto;
}

.proxy-item-compact {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    border-radius: 4px;
    background: var(--bg-primary);
    margin-bottom: 8px;
}

.proxy-item-compact:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.proxy-info-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.proxy-info-compact .proxy-port {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 70px;
}

.proxy-info-compact .proxy-user {
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .modal-large .modal-content {
        width: 95vw;
        max-height: 90vh;
        margin: 20px auto;
    }
    
    .modal-body-large {
        max-height: 70vh;
        padding: 15px;
    }
}

/* ===== Message Container Styles ===== */
.message-container {
    margin-bottom: 20px;
}

.message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.message-success {
    background-color: var(--success-light);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.message-error {
    background-color: #f8d7da;
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
}

.message-info {
    background-color: var(--info-light);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

.message i {
    font-size: 16px;
}

.message span {
    flex: 1;
}

/* Bandwidth Statistics Modal */
.modal-bandwidth-stats {
    max-width: 900px;
    max-height: 85vh;
}

.stats-summary {
    display: flex;
    gap: 20px;
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.stat-item i {
    color: var(--primary-color);
    font-size: 18px;
}

.stat-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 16px;
}

.proxy-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}

.proxy-selection-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.selection-actions {
    display: flex;
    gap: 8px;
}

.bandwidth-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.bandwidth-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.bandwidth-stats-table th {
    background: var(--bg-secondary);
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.bandwidth-stats-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.bandwidth-stats-table tr:hover {
    background: var(--bg-secondary);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 11px;
}

.rank-badge.rank-top {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b5a00;
    border: 2px solid #ffd700;
}

.rank-badge.rank-high {
    background: linear-gradient(135deg, #c0c0c0, #e5e5e5);
    color: #666;
    border: 2px solid #c0c0c0;
}

.rank-badge.rank-normal {
    background: linear-gradient(135deg, #cd7f32, #deb887);
    color: #5d3e1a;
    border: 2px solid #cd7f32;
}

.bandwidth-value {
    font-weight: 600;
    color: var(--primary-color);
}

.current-limit {
    font-size: 12px;
    color: var(--text-secondary);
}

.selected-info {
    font-weight: 500;
    color: var(--text-primary);
}

/* Dark mode styles */
[data-theme="dark"] .stats-summary {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .bandwidth-stats-table th {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .bandwidth-stats-table tr:hover {
    background: var(--bg-tertiary);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .modal-bandwidth-stats {
        max-width: 95vw;
        margin: 10px;
    }
    
    .stats-summary {
        flex-direction: column;
        gap: 12px;
    }
    
    .proxy-selection-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .selection-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .bandwidth-stats-table {
        font-size: 12px;
    }
    
    .bandwidth-stats-table th,
    .bandwidth-stats-table td {
        padding: 6px 4px;
    }
}

/* Data Quota Styles */
.data-quota-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
    white-space: nowrap;
}

.data-quota-badge.quota-normal {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.data-quota-badge.quota-warning {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    color: #f57c00;
    border: 1px solid #ffcc02;
}

.data-quota-badge.quota-danger {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #d32f2f;
    border: 1px solid #ef5350;
}

.data-quota-badge.quota-exceeded {
    background: linear-gradient(135deg, #ffebee, #f8bbd9);
    color: #b71c1c;
    border: 1px solid #d32f2f;
    animation: pulse-red 2s infinite;
}

.data-quota-badge.quota-unlimited {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1976d2;
    border: 1px solid #64b5f6;
}

@keyframes pulse-red {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.data-quota-badge i {
    margin-right: 4px;
    font-size: 10px;
}

/* Data Quota Modal Styles */
#dataQuotaModal .modal-content,
#addDataQuotaModal .modal-content,
#dataQuotaStatsModal .modal-content {
    max-width: 500px;
}

#dataQuotaModal .info-box,
#addDataQuotaModal .info-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

#dataQuotaModal .info-box i,
#addDataQuotaModal .info-box i {
    color: #17a2b8;
    font-size: 20px;
    margin-top: 2px;
}

#dataQuotaModal .info-box ul,
#addDataQuotaModal .info-box ul {
    margin: 5px 0 0 0;
    padding-left: 20px;
}

#dataQuotaModal .info-box li,
#addDataQuotaModal .info-box li {
    margin-bottom: 5px;
    font-size: 14px;
    color: #495057;
}

/* Data Quota Stats Modal */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-item {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Data Quota Buttons */
.btn[onclick="showDataQuotaModal()"] {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn[onclick="showDataQuotaModal()"]:hover {
    background: linear-gradient(135deg, #f57c00, #ef6c00);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

.btn[onclick="showAddDataQuotaModal()"] {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn[onclick="showAddDataQuotaModal()"]:hover {
    background: linear-gradient(135deg, #388e3c, #2e7d32);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.btn[onclick="showDataQuotaStats()"] {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn[onclick="showDataQuotaStats()"]:hover {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}
/* Responsive Table Updates */
@media (max-width: 1400px) {
    .proxy-table th:nth-child(7), /* Data Quota */
    .proxy-table td:nth-child(7) {
        min-width: 120px;
    }
}

@media (max-width: 1200px) {
    .data-quota-badge {
        font-size: 10px;
        padding: 2px 6px;
        min-width: 70px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 20px;
    }
}
/* ===== DELETE ALL MODAL FIXES ===== */
.modal-delete-all {
    max-width: 500px;
    width: 90%;
}

.modal-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 3px solid #ef4444;
}

.modal-icon-danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 3px solid #ef4444;
}

.modal-icon-wrapper i {
    font-size: 36px;
    color: #dc2626;
}

.modal-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.modal-message {
    text-align: center;
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-message .text-danger {
    color: #dc2626;
    font-weight: 700;
    font-size: 18px;
}

.modal-warning {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.modal-warning i {
    color: #d97706;
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.modal-warning div {
    flex: 1;
}

.modal-warning p {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #92400e;
}

.modal-warning ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.modal-warning li {
    margin: 5px 0;
    color: #92400e;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 20px 25px;
    border-top: 1px solid var(--border-light);
}

.modal-actions .btn {
    min-width: 140px;
    padding: 12px 20px;
    font-weight: 600;
}

/* Dark theme support */
[data-theme="dark"] .modal-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .modal-warning p,
[data-theme="dark"] .modal-warning li {
    color: #fbbf24;
}

[data-theme="dark"] .modal-icon-wrapper {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Responsive */
@media (max-width: 600px) {
    .modal-delete-all {
        width: 95%;
        margin: 20px auto;
    }
    
    .modal-icon-wrapper {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }
    
    .modal-icon-wrapper i {
        font-size: 28px;
    }
    
    .modal-title {
        font-size: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

/* Auto Replace Indicators */
.auto-replace-indicator {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 5px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auto-replace-indicator.auto-disabled {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.auto-replace-indicator:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.auto-replace-indicator i {
    font-size: 10px;
}
