:root {
    --primary-color: #0ea5e9;
    --primary-light: #38bdf8;
    --primary-dark: #0284c7;
    --secondary-color: #06b6d4;
    --accent-color: #14b8a6;
    --sidebar-width: 240px;
    --topbar-height: 60px;
    --bg-main: #f0f9ff;
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-main);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0fdfa 50%, #ecfeff 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.05) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-2%, 2%) rotate(5deg); }
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(14, 165, 233, 0.1);
    padding: 40px;
    max-width: 420px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.3);
}

.auth-header .logo i {
    font-size: 36px;
    color: white;
}

.auth-header h1 {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-card .nav-tabs {
    border-bottom: none;
    display: flex;
    gap: 8px;
    background: var(--bg-hover);
    padding: 4px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.auth-card .nav-tabs .nav-link {
    border: none;
    color: var(--text-secondary);
    padding: 10px 20px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    flex: 1;
    text-align: center;
    transition: var(--transition);
}

.auth-card .nav-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-auth {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
    display: flex;
    justify-content: space-around;
}

.auth-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.auth-footer a:hover {
    color: var(--primary-color);
}

.user-container {
    display: flex;
    min-height: 100vh;
}

.user-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.user-sidebar::-webkit-scrollbar {
    width: 4px;
}

.user-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.user-sidebar .sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.user-sidebar .sidebar-header h4 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-sidebar .sidebar-header h4 i {
    color: var(--primary-color);
    font-size: 22px;
}

.user-sidebar .nav {
    padding: 12px;
}

.user-sidebar .nav-item {
    margin-bottom: 4px;
}

.user-sidebar .nav-link {
    color: var(--text-secondary);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    position: relative;
}

.user-sidebar .nav-link i {
    margin-right: 12px;
    width: 20px;
    font-size: 18px;
    color: var(--text-muted);
    transition: var(--transition);
}

.user-sidebar .nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.user-sidebar .nav-link:hover i {
    color: var(--primary-color);
}

.user-sidebar .nav-link.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.user-sidebar .nav-link.active i {
    color: white;
}

.user-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-main);
}

.user-topbar {
    height: var(--topbar-height);
    background: white;
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.user-topbar .btn-link {
    color: var(--text-primary);
    font-size: 24px;
    padding: 8px;
}

.user-topbar .ms-auto {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-level {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.user-content {
    padding: 24px;
}

.welcome-section h4 {
    color: var(--text-primary);
    font-weight: 700;
}

.info-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.info-card:hover {
    box-shadow: var(--shadow-md);
}

.info-card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card-header.bg-danger {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
}

.info-card-header i {
    font-size: 18px;
}

.info-card-body {
    padding: 20px;
}

.traffic-progress .progress {
    height: 12px;
    border-radius: 6px;
    background: var(--bg-hover);
}

.traffic-progress .progress-bar {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 6px;
}

.account-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.account-info .info-row:last-child {
    border-bottom: none;
}

.account-info .label {
    color: var(--text-secondary);
    font-size: 14px;
}

.account-info .value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.node-item {
    padding: 14px 16px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    margin-bottom: 10px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.node-item:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.node-item .node-name {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.node-item .node-info {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 16px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: white;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.25);
}

.quick-action-btn i {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--primary-color);
    transition: var(--transition);
}

.quick-action-btn:hover i {
    color: white;
}

.quick-action-btn span {
    font-size: 13px;
    font-weight: 500;
}

.node-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 2px solid transparent;
    transition: var(--transition);
}

.node-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.node-card.subscribed {
    border-color: var(--primary-color);
}

.node-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-hover);
}

.node-card-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.node-card-body {
    padding: 16px 20px;
}

.node-info-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.node-info-row i {
    width: 20px;
    margin-right: 12px;
    color: var(--primary-color);
}

.node-card-footer {
    padding: 16px 20px;
    background: var(--bg-hover);
    display: flex;
    gap: 10px;
}

.redeem-tips {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.redeem-tips h6 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-weight: 600;
}

.redeem-tips ul {
    margin: 0;
    padding-left: 20px;
}

.redeem-tips li {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 6px;
}

.account-status .status-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.account-status .status-row:last-child {
    border-bottom: none;
}

.account-status .label {
    color: var(--text-secondary);
    font-size: 14px;
}

.account-status .value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-floating > .form-control {
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
    padding: 16px;
    font-size: 15px;
}

.form-floating > .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control {
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
    padding: 12px 16px;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
    outline: none;
}

.btn {
    border-radius: var(--radius);
    font-weight: 500;
    padding: 10px 20px;
    transition: var(--transition);
}

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

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}

.btn-outline-light {
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    background: white;
}

.btn-outline-light:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.table {
    border-radius: var(--radius);
    overflow: hidden;
}

.table th {
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.badge {
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, #10b981, #14b8a6) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #f43f5e, #e11d48) !important;
}

.badge.bg-secondary {
    background: var(--bg-hover) !important;
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: #10b981 !important;
}

.text-danger {
    color: #f43f5e !important;
}

@media (max-width: 768px) {
    .user-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    
    .user-sidebar.show {
        transform: translateX(0);
    }
    
    .user-main {
        margin-left: 0;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .user-content {
        padding: 16px;
    }
}

@media (max-width: 576px) {
    .quick-actions {
        grid-template-columns: 1fr 1fr;
    }
    
    .auth-card {
        padding: 24px;
    }
}
