@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

@font-face {
    font-family: 'Heebo';
    src: url('/static/fonts/Heebo.ttf') format('truetype');
    font-weight: 300 900;
    font-display: swap;
}

:root {
    --bg-dark: #030305;
    --card-bg: rgba(15, 15, 20, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.06);
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.4);
    --secondary: #d946ef;
    --accent: #00f2fe;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --gold: #f59e0b;
    --diamond: #06b6d4;
    --radius: 20px;
    --header-height: 80px;
    --sidebar-width: 280px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(0, 242, 254, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(217, 70, 239, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, .logo {
    font-family: 'Outfit', sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glassmorphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-hover:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
}

/* Layout */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4rem;
    background: rgba(3, 3, 5, 0.7);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--glass-border);
}

main {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

.container {
    display: flex;
    min-height: calc(100vh - var(--header-height));
    width: 100%;
}

.sidebar {
    width: var(--sidebar-width);
    padding: 2.5rem 1.5rem;
    border-right: 1px solid var(--glass-border);
    background: rgba(3, 3, 5, 0.4);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
}

.content {
    flex: 1;
    padding: 3rem 5rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Sidebar Menu */
.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 0.75rem;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.25rem;
    border-radius: 14px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

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

.sidebar li.active a {
    background: linear-gradient(135deg, var(--primary-glow), rgba(139, 92, 246, 0.1));
    color: white;
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.1);
}

/* Navigation */
.logo {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, white 50%, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-links a {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.nav-links a:hover {
    color: white;
    text-shadow: 0 0 15px var(--primary-glow);
}

/* Buttons */
.btn-login, .btn-primary {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white !important;
    padding: 0.8rem 2rem;
    border-radius: 14px;
    font-weight: 700;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 20px var(--primary-glow);
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn-login:hover, .btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px var(--primary-glow);
}

.btn-login:active, .btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 14px;
    font-weight: 600;
}

.btn-secondary:hover {
    background: var(--glass-border);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Cards & Grid */
.card {
    padding: 2.5rem;
    margin-bottom: 2rem;
    background: var(--card-bg);
    position: relative;
    transition: all 0.3s ease;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    padding: 2rem;
    text-align: left;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Outfit';
    margin: 0.5rem 0;
    background: linear-gradient(135deg, white, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Badges */
.badge {
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tier-free { background: rgba(71, 85, 105, 0.2); border: 1px solid #475569; color: #94a3b8; }
.tier-gold { background: rgba(245, 158, 11, 0.1); border: 1px solid var(--gold); color: var(--gold); }
.tier-diamond { background: rgba(6, 182, 212, 0.1); border: 1px solid var(--diamond); color: var(--diamond); }

/* Forms */
.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 10rem 2rem 6rem;
    max-width: 1100px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 2rem;
    letter-spacing: -3px;
    background: linear-gradient(to bottom, white, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.4rem;
    color: var(--text-muted);
    margin-bottom: 3.5rem;
    font-weight: 300;
}

/* Dashboard Table */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
}

.data-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-table td {
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
}

.data-table tr td:first-child { border-radius: 14px 0 0 14px; border-left: 1px solid var(--glass-border); }
.data-table tr td:last-child { border-radius: 0 14px 14px 0; border-right: 1px solid var(--glass-border); }
.data-table tr td { border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); }

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] body {
    font-family: 'Heebo', 'Inter', sans-serif;
}

[dir="rtl"] .sidebar a {
    flex-direction: row-reverse;
}

[dir="rtl"] .stat-card {
    text-align: right;
}

[dir="rtl"] .data-table th {
    text-align: right;
}

/* Media Queries */
@media (max-width: 1200px) {
    .content { padding: 3rem; }
}

@media (max-width: 1024px) {
    header { padding: 0 2rem; }
    .sidebar { width: 100%; height: auto; position: relative; top: 0; padding: 1rem; }
    .sidebar ul { display: flex; overflow-x: auto; gap: 0.5rem; }
    .sidebar a { white-space: nowrap; }
}
