/* ============================================
   SkyPanel - Modern Subscription Management UI
   ============================================ */

:root {
    /* Light Theme */
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-card: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --accent: #667eea;
    --accent-hover: #5a6fd6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --nav-height: 64px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: #1a1a2e;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #2d3748;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ============ NAVBAR ============ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
}

.nav-brand i {
    font-size: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--accent);
    background: var(--bg-tertiary);
}

.nav-link.active {
    color: var(--accent);
    background: rgba(102, 126, 234, 0.1);
}

.nav-link i {
    font-size: 0.9rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.nav-username {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.nav-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 500;
}

.nav-status.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.nav-status.expired {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.nav-logout {
    color: var(--text-muted);
    font-size: 1rem;
    transition: var(--transition);
    padding: 4px;
}

.nav-logout:hover {
    color: var(--danger);
}

.nav-mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 999;
    padding: 12px 16px;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu.show {
    display: flex;
}

.mobile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: var(--transition);
}

.mobile-link:hover {
    background: var(--bg-tertiary);
    color: var(--accent);
}

/* ============ MAIN CONTENT ============ */
.main-content {
    margin-top: var(--nav-height);
    padding: 24px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.auth-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* ============ DASHBOARD ============ */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ============ USER CARD ============ */
.user-card {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.user-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: var(--gradient-card);
}

.user-card-content {
    position: relative;
    padding: 28px 32px;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.user-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    border: 3px solid rgba(255,255,255,0.4);
    flex-shrink: 0;
}

.user-info-main h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.user-badges {
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-level {
    background: rgba(255,255,255,0.2);
    color: white;
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.badge-expired {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 4px;
}

.stat-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: rgba(102, 126, 234, 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stat-icon:nth-child(1) { background: rgba(102, 126, 234, 0.1); color: var(--accent); }
.stat-item:nth-child(2) .stat-icon { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.stat-item:nth-child(3) .stat-icon { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-item:nth-child(4) .stat-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value small {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.user-card-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.expire-info {
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
}

/* ============ ACTION BUTTONS ============ */
.action-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.action-form {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 280px;
}

.action-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.action-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background: rgba(102, 126, 234, 0.1);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-header i {
    color: var(--accent);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* ============ SUBSCRIPTION LINKS ============ */
.sub-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sub-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sub-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.sub-url-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    overflow: hidden;
}

.sub-url {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-copy:hover {
    background: var(--accent-hover);
}

.btn-copy-sm {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 4px;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-copy-sm:hover {
    color: var(--accent-hover);
}

/* ============ DOWNLOAD GRID ============ */
.download-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.download-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.download-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.download-icon {
    font-size: 2.5rem;
    color: var(--accent);
}

.download-name {
    font-weight: 600;
    color: var(--text-primary);
}

.download-item .btn {
    width: 100%;
    justify-content: center;
}

/* ============ PACKAGE GRID ============ */
.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.package-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.package-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.package-featured {
    border-color: var(--accent);
}

.package-badge {
    position: absolute;
    top: 12px;
    right: -28px;
    background: var(--gradient-primary);
    color: white;
    padding: 4px 36px;
    font-size: 0.75rem;
    font-weight: 600;
    transform: rotate(45deg);
}

.package-header {
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.package-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.package-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}

.price-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
}

.price-period {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.package-body {
    padding: 20px 24px;
}

.package-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.package-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.package-features i {
    color: var(--success);
    font-size: 0.8rem;
}

.package-footer {
    padding: 16px 24px 24px;
}

/* ============ DATA TABLE ============ */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.data-table tr:hover td {
    background: var(--bg-tertiary);
}

/* ============ TAG ============ */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(102, 126, 234, 0.1);
    color: var(--accent);
    margin-right: 4px;
}

/* ============ PROFILE ============ */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.profile-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.profile-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-value code {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ============ INVITE ============ */
.invite-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.invite-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.invite-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.invite-code-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}

.invite-code {
    flex: 1;
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
}

.invite-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

/* ============ WALLET ============ */
.wallet-balance {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
}

.wallet-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.wallet-amount {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============ TICKET ============ */
.ticket-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.ticket-msg {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent);
}

.ticket-msg.admin-msg {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.ticket-msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ticket-msg-header strong {
    font-size: 0.9rem;
}

.ticket-msg-header span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ticket-msg-body {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.ticket-reply-form {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* ============ TUTORIAL ============ */
.tutorial-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.tutorial-card .card-header i {
    font-size: 1.5rem;
}

.tutorial-steps {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tutorial-steps li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============ AUTH PAGES ============ */
.auth-page {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 16px;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============ FORMS ============ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-input {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    flex-direction: row;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 12px;
}

/* ============ FLASH MESSAGES ============ */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease;
    min-width: 280px;
}

.flash-success { background: #10b981; color: white; }
.flash-danger { background: #ef4444; color: white; }
.flash-warning { background: #f59e0b; color: white; }
.flash-info { background: #3b82f6; color: white; }

.flash-message button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 1rem;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============ TOAST ============ */
.toast {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 3000;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
}

.toast-success { background: var(--success); }
.toast-warning { background: var(--warning); }
.toast-error { background: var(--danger); }

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.3;
}

.empty-state p {
    margin-bottom: 16px;
}

/* ============ PAGE TITLE ============ */
.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title h2 i {
    color: var(--accent);
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .download-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tutorial-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu { display: none; }
    .nav-user { display: none; }
    .nav-mobile-toggle { display: block; }

    .main-content { padding: 16px; }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .download-grid {
        grid-template-columns: 1fr 1fr;
    }
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .package-grid {
        grid-template-columns: 1fr;
    }

    .user-card-content { padding: 20px; }
    .user-card-header { flex-direction: column; text-align: center; }
    .user-info-main h2 { color: white; }
    .user-badges { justify-content: center; }

    .auth-card { padding: 24px; }
    .action-buttons { flex-direction: column; }
    .action-form { min-width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .download-grid { grid-template-columns: 1fr; }
}

/* ============ TRAFFIC BAR ============ */
.traffic-bar-wrap {
    margin-top: 8px;
}

.traffic-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.traffic-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.traffic-bar-ok {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.traffic-bar-warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.traffic-bar-danger {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.traffic-bar-text {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============ TRAFFIC CHART ============ */
.traffic-chart-card {
    margin-top: 24px;
}

.traffic-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.traffic-chart-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.traffic-chart-header h3 i {
    color: var(--accent);
}

.traffic-legend {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.traffic-legend span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.traffic-legend .dot-upload {
    width: 8px; height: 8px; border-radius: 50%;
    background: #6366f1;
    display: inline-block;
}

.traffic-legend .dot-download {
    width: 8px; height: 8px; border-radius: 50%;
    background: #10b981;
    display: inline-block;
}

.traffic-chart-container {
    position: relative;
    height: 200px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
}

.traffic-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 180px;
    padding: 10px 8px 0;
}

.traffic-chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.traffic-chart-bar-pair {
    display: flex;
    align-items: flex-end;
    gap: 1px;
    height: 140px;
    width: 100%;
    justify-content: center;
}

.traffic-chart-bar {
    width: 40%;
    border-radius: 2px 2px 0 0;
    min-height: 1px;
    transition: height 0.3s ease;
}

.traffic-chart-bar.upload { background: #6366f1; }
.traffic-chart-bar.download { background: #10b981; }

.traffic-chart-bar-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

.traffic-chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
