/* user/assets/css/style.css */
/* Inter font loaded via <link> in HTML head — non-blocking */

:root {
    --primary: #6C63FF;
    --primary-glow: rgba(108, 99, 255, 0.4);
    --primary-dark: #5A52E0;
    --secondary: #0FF0FC;
    --accent: #FF6584;
    --bg-base: #0A0B1A;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-input: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(108, 99, 255, 0.6);
    --text-white: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.55);
    --text-dim: rgba(255, 255, 255, 0.35);
    --success: #10E980;
    --danger: #FF4F6A;
    --warning: #FFB830;
    --info: #0FF0FC;
    --gradient-main: linear-gradient(135deg, #6C63FF 0%, #0FF0FC 100%);
    --gradient-card: linear-gradient(135deg, rgba(108, 99, 255, 0.15) 0%, rgba(15, 240, 252, 0.05) 100%);
    --shadow-glow: 0 0 40px rgba(108, 99, 255, 0.2);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ========== Animated Background ========== */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 20%, rgba(108, 99, 255, 0.12) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 80%, rgba(15, 240, 252, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 50%, rgba(255, 101, 132, 0.05) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

.page-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* ========== Login Page ========== */
.login-page {
    width: 100%;
    min-width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-box {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    animation: fadeSlideUp 0.6s ease forwards;
}

.login-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo .logo-icon {
    width: 72px;
    height: 72px;
    background: var(--gradient-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    box-shadow: 0 0 30px var(--primary-glow);
    animation: pulse-glow 3s ease infinite;
}

.login-logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ========== Dashboard Layout ========== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.brand-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-main);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 0 15px var(--primary-glow);
}

.brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-sub {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 1px;
}

/* User Profile in Sidebar */
.sidebar-user {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.user-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: var(--gradient-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-info-side .username {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-white);
}

.user-info-side .status-badge {
    font-size: 0.68rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 2px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    padding: 0.5rem 1.5rem 0.25rem;
    margin-top: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s ease;
    position: relative;
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-link:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    color: var(--primary);
    background: rgba(108, 99, 255, 0.12);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-main);
    border-radius: 0 3px 3px 0;
}

.sidebar-link .nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: rgba(255, 79, 106, 0.15);
    border: 1px solid rgba(255, 79, 106, 0.3);
    color: var(--danger);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: rgba(255, 79, 106, 0.25);
    border-color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

/* Top Bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-heading h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-white);
}

.page-heading p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ========== Cards ========== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
    border-color: rgba(108, 99, 255, 0.25);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-main);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(108, 99, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.stat-icon.purple { background: rgba(108, 99, 255, 0.2); color: var(--primary); }
.stat-icon.cyan   { background: rgba(15, 240, 252, 0.15); color: var(--secondary); }
.stat-icon.green  { background: rgba(16, 233, 128, 0.15); color: var(--success); }
.stat-icon.red    { background: rgba(255, 79, 106, 0.15); color: var(--danger); }
.stat-icon.yellow { background: rgba(255, 184, 48, 0.15); color: var(--warning); }

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========== Form Controls ========== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-white);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--border-focus);
    background: rgba(108, 99, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.form-control::placeholder {
    color: var(--text-dim);
}

.form-control option {
    background: #1a1b30;
    color: var(--text-white);
}

.input-group {
    position: relative;
}

.input-group .form-control {
    padding-left: 2.75rem;
}

.input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 1rem;
    pointer-events: none;
}

.toggle-password {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--primary);
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(108, 99, 255, 0.08);
}

.btn-success {
    background: rgba(16, 233, 128, 0.2);
    border: 1px solid rgba(16, 233, 128, 0.4);
    color: var(--success);
}

.btn-success:hover {
    background: rgba(16, 233, 128, 0.3);
    box-shadow: 0 4px 15px rgba(16, 233, 128, 0.2);
}

.btn-danger {
    background: rgba(255, 79, 106, 0.15);
    border: 1px solid rgba(255, 79, 106, 0.3);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(255, 79, 106, 0.25);
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
}

/* ========== Alert/Message ========== */
.alert {
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.alert-success {
    background: rgba(16, 233, 128, 0.12);
    border: 1px solid rgba(16, 233, 128, 0.3);
    color: var(--success);
}

.alert-danger {
    background: rgba(255, 79, 106, 0.12);
    border: 1px solid rgba(255, 79, 106, 0.3);
    color: var(--danger);
}

.alert-warning {
    background: rgba(255, 184, 48, 0.12);
    border: 1px solid rgba(255, 184, 48, 0.3);
    color: var(--warning);
}

/* ========== Info Table (read-only details) ========== */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table tr {
    border-bottom: 1px solid var(--border);
}

.info-table tr:last-child {
    border-bottom: none;
}

.info-table td {
    padding: 0.9rem 0;
    font-size: 0.9rem;
}

.info-table td:first-child {
    color: var(--text-muted);
    font-weight: 500;
    width: 45%;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.info-table td:last-child {
    color: var(--text-white);
    font-weight: 600;
    text-align: right;
}

/* ========== Password Display Box ========== */
.password-box {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    gap: 0.75rem;
}

.password-value {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-white);
    letter-spacing: 0.08em;
}

.copy-btn {
    background: rgba(108, 99, 255, 0.2);
    border: 1px solid rgba(108, 99, 255, 0.3);
    color: var(--primary);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-btn:hover {
    background: rgba(108, 99, 255, 0.35);
}

/* ========== Server Cards ========== */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.server-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.server-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-main);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.server-card:hover {
    border-color: rgba(108, 99, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.server-card:hover::after {
    transform: scaleX(1);
}

.server-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.server-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-white);
}

.server-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
}

.badge-active {
    background: rgba(16, 233, 128, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 233, 128, 0.3);
}

.badge-inactive {
    background: rgba(255, 79, 106, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 79, 106, 0.3);
}

.server-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.server-meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.825rem;
}

.server-meta-item .label {
    color: var(--text-muted);
}

.server-meta-item .value {
    color: var(--text-white);
    font-weight: 500;
    font-family: monospace;
}

/* ========== Bandwidth Progress ========== */
.bandwidth-bar-wrap {
    margin-top: 0.75rem;
}

.bandwidth-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

.bandwidth-label .used {
    color: var(--primary);
    font-weight: 600;
}

.progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--gradient-main);
    transition: width 1s ease;
}

/* ========== Tabs ========== */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.65rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--text-white);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ========== Animations ========== */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px var(--primary-glow); }
    50% { box-shadow: 0 0 40px var(--primary-glow), 0 0 60px rgba(15, 240, 252, 0.2); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeSlideUp 0.4s ease forwards;
}

/* ========== Loading Spinner ========== */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* ========== Toast Notification ========== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: rgba(30, 30, 60, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.25rem;
    min-width: 280px;
    max-width: 350px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    animation: slideInRight 0.3s ease forwards;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--primary); }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ========== Section grid ========== */
.content-grid {
    display: grid;
    gap: 1.5rem;
}

.two-col {
    grid-template-columns: 1fr 1fr;
}

.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ========== Mobile Hamburger ========== */
.hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-white);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 1.1rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
}

/* ========== Divider ========== */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.25rem 0;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ========== Expiry Warning ========== */
.expiry-warning {
    background: rgba(255, 184, 48, 0.08);
    border: 1px solid rgba(255, 184, 48, 0.25);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.825rem;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.open {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .hamburger {
        display: flex;
        align-items: center;
    }
    .two-col {
        grid-template-columns: 1fr;
    }
    .three-col {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .server-grid {
        grid-template-columns: 1fr;
    }
    .login-box {
        padding: 2rem 1.5rem;
    }
}
