/* Đường dẫn: proxy-manager/assets/css/style.css */
/* Custom styles cho Proxy Manager */

:root {
    --primary-color: #0f172a;
    --secondary-color: #1e293b;
    --accent-color: #10b981;
    --success-color: #4ade80;
    --warning-color: #fbbf24;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --text-color: #e2e8f0;
}

/* Global Styles */
body {
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Consolas', 'Courier New', monospace;
    background-color: #f8fafc;
    padding-top: 70px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

/* Gradient Background */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Navbar */
.navbar {
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.15);
    padding: 1rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.navbar-brand {
    font-size: 1.4rem;
    letter-spacing: -0.02em;
    font-weight: 700;
    color: var(--text-color) !important;
    font-family: 'JetBrains Mono', monospace;
}

.navbar-brand i {
    color: var(--accent-color);
    margin-right: 0.5rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    color: var(--text-color) !important;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.nav-link:hover {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-color) !important;
    transform: translateY(-1px);
}

.nav-link.active {
    background-color: rgba(16, 185, 129, 0.3) !important;
    color: var(--accent-color) !important;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.navbar-toggler {
    border-color: var(--accent-color);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.dropdown-menu {
    background-color: var(--secondary-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
}

.dropdown-item {
    color: var(--text-color);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.dropdown-item:hover {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-color);
}

.dropdown-header {
    color: var(--accent-color);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.dropdown-item-text code {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-color);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Clickable Items in Proxy Display */
.clickable-item {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.85em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background-color: rgba(0,0,0,0.05);
    border: 1px solid transparent;
}

.clickable-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: rgba(13, 110, 253, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.clickable-item i {
    font-size: 0.75em;
    margin-right: 2px;
}

.proxy-ip.clickable {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.proxy-ip.clickable:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.proxy-ip-alt.clickable-item:hover {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
}

.port-item:hover {
    background-color: rgba(25, 135, 84, 0.1);
    border-color: rgba(25, 135, 84, 0.3);
}

.auth-item:hover {
    background-color: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

/* Compact copy icon buttons */
.copy-icons .btn {
    padding: 4px 6px !important;
    font-size: 0.75rem;
    line-height: 1;
    border-radius: 3px;
}

.copy-icons .btn i {
    font-size: 0.75rem !important;
}

.copy-icons .btn:hover {
    transform: scale(1.1);
}

/* Proxy IP display */
.proxy-ip {
    font-size: 0.9rem;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Page Title */
.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.02em;
}

.page-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--primary-color) 100%);
    border-radius: 2px;
}

.page-title i {
    color: var(--accent-color);
    margin-right: 0.75rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.25rem;
    font-weight: 600;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark-color);
}

.stat-content p {
    margin: 0;
    color: #6b7280;
    font-weight: 500;
}

/* Tables */
.table {
    font-size: 0.9rem;
}

.table thead th {
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #6b7280;
    padding: 1rem;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: -0.01em;
    border-width: 1px;
    border-style: solid;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #059669 100%);
    border-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--accent-color);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background-color: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--text-color);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #22c55e 100%);
    border-color: var(--success-color);
}

.btn-success:hover {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #f59e0b 100%);
    border-color: var(--warning-color);
    color: var(--primary-color);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, 0.2);
    padding: 0.625rem 0.875rem;
    transition: all 0.3s ease;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    background-color: rgba(248, 250, 252, 0.8);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background-color: white;
}

.form-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: -0.01em;
}

/* Code elements */
code {
    background-color: rgba(15, 23, 42, 0.1);
    color: var(--primary-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

pre {
    background-color: var(--primary-color);
    color: var(--text-color);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    font-family: 'JetBrains Mono', monospace;
}

/* Tables with code styling */
.table {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.table th {
    background-color: var(--primary-color);
    color: var(--text-color);
    border-color: var(--secondary-color);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.table td {
    border-color: rgba(15, 23, 42, 0.1);
}

/* Modals */
.modal-content {
    border-radius: 12px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.modal-title {
    font-weight: 700;
}

/* Badges */
.badge {
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .table {
        font-size: 0.8rem;
    }
}

/* Nút icon nhỏ */
.btn-icon {
    padding: 0.125rem 0.25rem;
    line-height: 1;
}

/* Màu sắc biểu thị trạng thái proxy */
.proxy-status-success i {
    color: #4ade80 !important;
}

.proxy-status-error i {
    color: #ef4444 !important;
}

/* Animation quay khi đang kiểm tra */
.proxy-checking i {
    animation: spin 1s linear infinite;
}

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

/* Container port và các nút */
.port-container {
    min-width: 180px;
}

/* Tooltip */
.proxy-tooltip {
    position: relative;
    display: inline-block;
}

.proxy-tooltip .tooltiptext {
    visibility: hidden;
    width: 140px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 150%;
    left: 50%;
    margin-left: -75px;
    opacity: 0;
    transition: opacity 0.3s;
}

.proxy-tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.proxy-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}
/* Cải thiện hiển thị proxy */
.proxy-row {
    transition: background-color 0.2s ease;
}

.proxy-row:hover {
    background-color: rgba(0,0,0,0.02);
}

.proxy-cell {
    min-width: 280px;
}

.proxy-header {
    margin-bottom: 5px;
}

.proxy-ip {
    font-family: 'Consolas', monospace;
    cursor: pointer;
    transition: color 0.2s ease;
}

.proxy-ip:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.ports {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

.auth {
    font-size: 0.85rem;
}

.edit-comment {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.edit-comment:hover {
    opacity: 1;
}

.proxy-comment:hover .edit-comment {
    opacity: 1;
}

/* Nút export và import */
.export-button {
    position: relative;
}

.export-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    z-index: 1000;
    display: none;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    background-color: #fff;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.175);
}

.export-dropdown a {
    display: block;
    padding: 0.25rem 1.5rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

.export-dropdown a:hover {
    color: #16181b;
    text-decoration: none;
    background-color: #f8f9fa;
}

.export-button:hover .export-dropdown {
    display: block;
}

/* Status indicator */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-available {
    background-color: #4ade80;
}

.status-in-use {
    background-color: #fbbf24;
}

.status-expired {
    background-color: #ef4444;
}

/* Country flag */
.country-flag {
    font-size: 1.2em;
    margin-right: 4px;
}

/* Cải thiện hiển thị các nút action */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.action-buttons .btn {
    padding: 0.25rem 0.5rem;
}

/* Cải thiện hiển thị thông tin xác thực */
.auth .badge {
    font-family: monospace;
    font-weight: normal;
}

/* Tooltip hiển thị khi hover */
.tooltip-proxy {
    position: relative;
    display: inline-block;
}

.tooltip-proxy .tooltip-text {
    visibility: hidden;
    width: 140px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -70px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip-proxy:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Cải thiện hiển thị proxy status check */
.proxy-status-success i {
    color: #4ade80;
}

.proxy-status-error i {
    color: #ef4444;
}

.proxy-checking i {
    animation: spin 1s linear infinite;
}

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

/* Cải thiện hiển thị expiration */
.expiration-date {
    font-size: 0.85rem;
}

.days-left {
    font-size: 0.85rem;
}

/* Cải thiện hiển thị filter */
.filter-container {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.filter-button {
    min-width: 100px;
}
