/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Thiết lập cơ bản */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    color: #333;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

/* Header */
.header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 5px;
}

/* Statistics */
.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    align-items: center;
    flex: 1;
}

.stat-item {
    color: #333;
    font-size: 13px;
    line-height: 1.5;
    white-space: nowrap;
}

.stat-item strong {
    font-weight: 700;
    margin-right: 6px;
    color: #e91e63;
}

/* Form đăng nhập */
.login-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 50px auto;
    text-align: center;
}

.login-form h2 {
    margin-bottom: 30px;
    color: #e91e63;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e91e63;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
    color: white;
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 0;
    box-shadow: 0 2px 6px rgba(233, 30, 99, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
    background: linear-gradient(135deg, #d81b60 0%, #e91e63 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
}

.logout-btn {
    background: #6c757d;
    color: white;
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #5a6268;
}

/* Main content */
.main-content {
    display: none;
    height: 100vh;
    width: 100%;
}

.main-content.show {
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    border-right: 1px solid rgba(233, 30, 99, 0.1);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-header h2 {
    font-size: 12px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 10px 0;
    flex: 1;
}

.nav-item {
    display: block;
    padding: 10px 20px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(233, 30, 99, 0.05);
    color: #e91e63;
}

.nav-item.active {
    background: rgba(233, 30, 99, 0.1);
    color: #e91e63;
    border-left-color: #e91e63;
    font-weight: 600;
}

.nav-item span {
    display: block;
}

/* Content Wrapper */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100vh;
}

/* Top Header */
.top-header {
    background: rgba(255, 255, 255, 0.98);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(233, 30, 99, 0.1);
    flex-shrink: 0;
}

/* Tab Content */
.tab-content {
    display: none;
    flex: 1;
    padding: 15px 20px;
    overflow-y: auto;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

/* Navigation tabs - Hidden */
.nav-tabs {
    display: none;
}

/* Content header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border-left: 3px solid #e91e63;
}

.content-header h3 {
    color: #e91e63;
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
}

/* Table */
.table-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow-x: auto;
    border: 1px solid rgba(233, 30, 99, 0.1);
}

/* Proxy input container */
.proxy-input-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(233, 30, 99, 0.1);
}

.proxy-input-container label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

#proxyListTextarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    min-height: 400px;
    transition: border-color 0.3s ease;
    background: #fafafa;
}

#proxyListTextarea:focus {
    outline: none;
    border-color: #e91e63;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    background: white;
}

th, td {
    padding: 3px 6px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.2;
}

th {
    background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    font-size: 9px;
    position: sticky;
    top: 0;
    z-index: 10;
    line-height: 1.2;
}

tbody tr {
    transition: all 0.3s ease;
    background: white;
    height: auto;
}

tbody tr:nth-child(even) {
    background: #fafafa;
}

tbody tr:hover {
    background: linear-gradient(90deg, rgba(233, 30, 99, 0.05) 0%, rgba(240, 98, 146, 0.05) 100%);
    transform: translateX(2px);
}

td {
    color: #333;
    font-weight: 400;
    vertical-align: middle;
    word-break: break-word;
    line-height: 1.2;
    font-size: 11px;
}

td:first-child {
    font-weight: 600;
    color: #e91e63;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

/* Status badges */
.status-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    display: inline-block;
    color: white;
}

.status-active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.status-expired {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.status-revoked {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.action-btn {
    padding: 3px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
    margin: 0 1px;
}

.edit-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.edit-btn:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    transform: translateY(-2px);
}

.delete-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.delete-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 3% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #666;
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.05) 0%, rgba(240, 98, 146, 0.05) 100%);
    border-radius: 12px;
    border: 2px dashed rgba(233, 30, 99, 0.2);
}

.empty-state h4 {
    margin-bottom: 15px;
    color: #e91e63;
    font-size: 1.3rem;
    font-weight: 600;
}

.empty-state p {
    color: #888;
    font-size: 1rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }
    
    .content-header h3 {
        font-size: 1.4rem;
    }
    
    .table-container {
        padding: 15px;
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 12px 8px;
    }
    
    .nav-tab {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #666;
}

.items-per-page label {
    margin: 0;
    font-weight: 500;
}

.items-per-page select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 11px;
    background: white;
    cursor: pointer;
}

.items-per-page select:focus {
    outline: none;
    border-color: #e91e63;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 12px;
    gap: 4px;
}

.pagination {
    display: flex;
    gap: 0;
    align-items: center;
}

.pagination-btn {
    padding: 6px 10px;
    border: 1px solid #ddd;
    background: white;
    color: #e91e63;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
    border-right: none;
}

.pagination-btn:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.pagination-btn:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    border-right: 1px solid #ddd;
}

.pagination-btn:hover:not(:disabled):not(.active) {
    background: #f5f5f5;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: #e91e63;
    color: white;
    border-color: #e91e63;
    font-weight: 600;
}

