/* VPN Proxy Gateway - Custom Styles */

/* Base */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* ============================================
   Stat Cards
   ============================================ */
.stat-card {
    background: #111827;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.1);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.stat-card.blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-card.purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.stat-card.green::before { background: linear-gradient(90deg, #22c55e, #4ade80); }
.stat-card.red::before { background: linear-gradient(90deg, #ef4444, #f87171); }

.stat-card.blue { border-top-color: #3b82f6; }
.stat-card.purple { border-top-color: #8b5cf6; }
.stat-card.green { border-top-color: #22c55e; }
.stat-card.red { border-top-color: #ef4444; }

.stat-card.blue .stat-icon { background: rgba(59,130,246,0.12); color: #60a5fa; }
.stat-card.purple .stat-icon { background: rgba(139,92,246,0.12); color: #a78bfa; }
.stat-card.green .stat-icon { background: rgba(34,197,94,0.12); color: #4ade80; }
.stat-card.red .stat-icon { background: rgba(239,68,68,0.12); color: #f87171; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 5px;
    flex-shrink: 0;
}
.badge-online { background: rgba(34,197,94,0.12); color: #4ade80; }
.badge-online::before { background: #4ade80; }
.badge-error { background: rgba(239,68,68,0.12); color: #f87171; }
.badge-error::before { background: #f87171; }
.badge-browsing { background: rgba(234,179,8,0.12); color: #facc15; }
.badge-browsing::before { background: #facc15; }

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.btn-success {
    background: rgba(34,197,94,0.15);
    color: #4ade80;
    border: 1px solid rgba(34,197,94,0.2);
}
.btn-success:hover {
    background: rgba(34,197,94,0.25);
    border-color: rgba(34,197,94,0.3);
}

.btn-danger {
    background: rgba(239,68,68,0.12);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.15);
}
.btn-danger:hover {
    background: rgba(239,68,68,0.22);
    border-color: rgba(239,68,68,0.3);
}

.btn-warning {
    background: rgba(234,179,8,0.12);
    color: #facc15;
    border: 1px solid rgba(234,179,8,0.15);
}
.btn-warning:hover {
    background: rgba(234,179,8,0.22);
    border-color: rgba(234,179,8,0.3);
}

.btn-ghost {
    background: rgba(255,255,255,0.04);
    color: #9ca3af;
    border: 1px solid rgba(255,255,255,0.06);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.08);
    color: #d1d5db;
    border-color: rgba(255,255,255,0.1);
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: #111827;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    transition: border-color 0.2s ease;
}
.card:hover {
    border-color: rgba(255,255,255,0.1);
}

/* ============================================
   Connection Boxes
   ============================================ */
.conn-box {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 6px 10px;
    display: inline-block;
}

.proxy-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}
.proxy-filter {
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}
.proxy-filter:hover,
.proxy-filter.is-active {
    background: rgba(59,130,246,0.12);
    border-color: rgba(96,165,250,0.35);
}
.proxy-filter-value {
    display: block;
    color: #f9fafb;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}
.proxy-filter-label {
    display: block;
    color: #9ca3af;
    font-size: 11px;
    margin-top: 4px;
}
.proxy-search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0 12px;
}
.proxy-search input {
    width: 100%;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: 0;
    color: #e5e7eb;
    font-size: 13px;
}
.proxy-search input::placeholder {
    color: #6b7280;
}
.proxy-copy-line {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 6px;
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 6px 8px;
}

@media (max-width: 768px) {
    .proxy-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .proxy-copy-line {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

/* ============================================
   Check Items
   ============================================ */
.check-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.check-item:last-child {
    border-bottom: none;
}
.check-label {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
}
.check-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    font-weight: 700;
}
.check-icon.pass {
    background: rgba(34,197,94,0.15);
    color: #4ade80;
}
.check-icon.fail {
    background: rgba(239,68,68,0.15);
    color: #f87171;
}
.check-label-text {
    color: #9ca3af;
    font-size: 13px;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ============================================
   Toast Notifications
   ============================================ */
#toastContainer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    min-width: 280px;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: toastSlideIn 0.3s ease-out;
    backdrop-filter: blur(8px);
}
.toast.removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}
.toast-success {
    background: rgba(34,197,94,0.9);
    border: 1px solid rgba(34,197,94,0.5);
}
.toast-error {
    background: rgba(239,68,68,0.9);
    border: 1px solid rgba(239,68,68,0.5);
}
.toast-warning {
    background: rgba(234,179,8,0.9);
    border: 1px solid rgba(234,179,8,0.5);
    color: #1a1a1a;
}
.toast-info {
    background: rgba(59,130,246,0.9);
    border: 1px solid rgba(59,130,246,0.5);
}
.toast-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ============================================
   Confirm Modal
   ============================================ */
#confirmModal {
    animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   Input Focus Ring
   ============================================ */
input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 2px rgba(59,130,246,0.25);
}

/* ============================================
   Table Styles
   ============================================ */
table thead th {
    background: #111827;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1023px) {
    aside { display: none !important; }
    main { margin-left: 0 !important; }
}
