/* proxy-toiuu.css - Optimized CSS for Proxy page */

/* ===========================================
   PROXY SPECIFIC STYLES
   =========================================== */

/* Main Container */
.proxy-container {
    padding: 30px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Proxy Section */
#proxy-key-section .card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 15px;
    border: none;
    transition: all 0.3s ease;
}

#proxy-key-section .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Table Styles */
#proxy-key-section .table {
    margin-bottom: 0;
}

#proxy-key-section .table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    border: none;
    padding: 1rem 0.75rem;
}

#proxy-key-section .table td {
    vertical-align: middle;
    border: 1px solid #f0f0f0;
    padding: 1rem 0.75rem;
    transition: all 0.2s ease;
}

#proxy-key-section .table tbody tr:hover {
    background-color: #f8f9ff;
    transform: scale(1.01);
}

/* Product Info Styling */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.product-available {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.badge.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.badge.bg-secondary {
    background: #6c757d !important;
    color: white;
}

/* Button Styles */
.btn-buy-key {
    min-width: 80px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-buy-key:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.btn-buy-key:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal Styles */
#proxyBuyKeyModal .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

#proxyBuyKeyModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    border: none;
}

#proxyBuyKeyModal .modal-title {
    font-weight: 700;
    font-size: 1.2rem;
}

#proxyBuyKeyModal .btn-close {
    filter: invert(1);
}

#proxyBuyKeyModal .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

#proxyBuyKeyModal .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Alert Styles */
#proxy-key-alert .alert {
    border-radius: 10px;
    border: none;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#proxy-key-alert .alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

#proxy-key-alert .alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Keys Management Section */
.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none;
    border-radius: 15px 15px 0 0 !important;
}

.card-header h5 {
    font-weight: 700;
    font-size: 1.1rem;
}

/* Tab Styles */
.nav-tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 8px 8px 0 0;
    margin-right: 0.5rem;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
    background: transparent;
}

.nav-tabs .nav-link:hover {
    background: #f8f9fa;
    color: #495057;
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

/* Key Table Styles */
#keysTableBodyActive,
#keysTableBodyExpired,
#keysTableBodyAll {
    position: relative;
}

.key-in-row {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    margin: 0.25rem 0;
}

.btn-copy-key {
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-copy-key:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-copy-key.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
}

/* Action Buttons */
#btn-copy-keys,
#btn-download-keys {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#btn-copy-keys:hover,
#btn-download-keys:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Days Left Badge Styles */
.badge.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
    color: #212529 !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.badge.bg-dark {
    background: linear-gradient(135deg, #343a40 0%, #23272b 100%) !important;
}

/* Category Row Styles */
.tenchuyenmuc td {
    /* background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important; */
    color: #495057 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-size: 0.9rem !important;
    border: none !important;
    padding: 1rem 0.75rem !important;
}

/* Loading States */
.skeleton-row {
    opacity: 0.7;
}

.skeleton-row .skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }
.skeleton-text.long { width: 100%; }

.skeleton-badge {
    width: 60px;
    height: 18px;
}

.skeleton-btn {
    width: 70px;
    height: 32px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .proxy-container {
        padding: 15px 0;
    }
    
    #proxy-key-section .table th,
    #proxy-key-section .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .product-name {
        font-size: 1rem;
    }
    
    .product-description {
        font-size: 0.8rem;
    }
    
    .btn-buy-key {
        min-width: 60px;
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }
    
    .nav-tabs .nav-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    .key-in-row {
        font-size: 0.75rem;
    }
    
    #btn-copy-keys,
    #btn-download-keys {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }
}

@media (max-width: 576px) {
    .titdichvu {
        font-size: 1.5rem;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    .card-header .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .nav-tabs .nav-link {
        margin-right: 0;
        margin-bottom: 0.25rem;
        border-radius: 8px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Success Animation */
.success-pulse {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ===========================================
   DARK MODE SUPPORT
   =========================================== */

/* Container */
body.dark-mode .proxy-container {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

/* Cards */
body.dark-mode #proxy-key-section .card {
    background-color: #2d3748;
    border-color: #4a5568;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode #proxy-key-section .card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

body.dark-mode .card-header {
    background-color: #4a5568;
    color: #e2e8f0;
    border-bottom-color: #718096;
}

/* Table */
body.dark-mode #proxy-key-section .table {
    color: #e2e8f0;
}

body.dark-mode #proxy-key-section .table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #4a5568;
}

body.dark-mode #proxy-key-section .table td {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode #proxy-key-section .table tbody tr:hover {
    background-color: #374151 !important;
}

/* Product Info */
body.dark-mode .product-name {
    color: #e2e8f0;
}

body.dark-mode .product-description {
    color: #cbd5e0;
}

body.dark-mode .product-available {
    color: #a0aec0;
}

/* Badges - Keep original colors for visibility */
body.dark-mode .badge {
    /* Badges keep their original colors */
}

/* Buttons */
body.dark-mode .btn-buy-key {
    /* Keep original gradient */
}

body.dark-mode .btn-copy {
    background-color: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
}

body.dark-mode .btn-copy:hover {
    background-color: #718096;
    border-color: #a0aec0;
}

/* Modal */
body.dark-mode .modal-buy-key .modal-content {
    background-color: #2d3748;
    border-color: #4a5568;
}

body.dark-mode .modal-buy-key .modal-header {
    background-color: #4a5568;
    border-bottom-color: #718096;
    color: #e2e8f0;
}

body.dark-mode .modal-buy-key .modal-body {
    background-color: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .modal-buy-key .modal-footer {
    background-color: #4a5568;
    border-top-color: #718096;
}

body.dark-mode .modal-buy-key .product-details {
    border-color: #4a5568;
}

body.dark-mode .modal-buy-key .total-price {
    color: #e2e8f0;
}

/* Tab Navigation */
body.dark-mode .tabs-nav {
    background-color: #2d3748;
    border-color: #4a5568;
}

body.dark-mode .tab-button {
    color: #cbd5e0;
    background-color: #374151;
}

body.dark-mode .tab-button:hover {
    background-color: #4a5568;
    color: #fff;
}

body.dark-mode .tab-button.active {
    background-color: #667eea;
    color: #fff;
}

body.dark-mode .tab-badge {
    /* Keep original colors */
}

/* Empty State */
body.dark-mode .empty-state {
    color: #cbd5e0;
}

body.dark-mode .empty-state i {
    color: #718096;
}

/* Stats Card */
body.dark-mode .stats-card {
    background-color: #2d3748;
    border-color: #4a5568;
}

body.dark-mode .stats-card .stats-icon {
    color: #667eea;
}

body.dark-mode .stats-card .stats-value {
    color: #e2e8f0;
}

body.dark-mode .stats-card .stats-label {
    color: #cbd5e0;
}