@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0d0d0f;
    --bg-secondary: #13131a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --accent: #7c3aed;
    --accent-secondary: #a855f7;
    --accent-glow: rgba(124, 58, 237, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(124, 58, 237, 0.5);
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    cursor: none;
}

/* Scroll Animations & 3D Effects */
.reveal,
.from-left,
.from-right,
.zoom-in,
.rotate-in,
.premium-reveal,
.skew-reveal {
    opacity: 0;
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity, filter;
}

.premium-reveal {
    transform: scale(0.92) translateY(40px);
    filter: blur(15px);
}

.premium-reveal.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
}

.skew-reveal {
    transform: perspective(1000px) rotateX(-20deg) translateY(50px) scale(0.9);
    transform-origin: top;
}

.skew-reveal.active {
    opacity: 1;
    transform: perspective(1000px) rotateX(0) translateY(0) scale(1);
}

.reveal {
    transform: translateY(50px);
}

.from-left {
    transform: translateX(-100px) rotateY(-10deg);
}

.from-right {
    transform: translateX(100px) rotateY(10deg);
}

.zoom-in {
    transform: scale(0.8);
}

.rotate-in {
    transform: rotate(-15deg) scale(0.9);
}

.reveal.active,
.from-left.active,
.from-right.active,
.zoom-in.active,
.rotate-in.active {
    opacity: 1;
    transform: translate(0) rotate(0) scale(1);
}

/* Staggered delays */
.stagger-1 {
    transition-delay: 150ms;
}

.stagger-2 {
    transition-delay: 250ms;
}

.stagger-3 {
    transition-delay: 350ms;
}

.stagger-4 {
    transition-delay: 450ms;
}

.stagger-5 {
    transition-delay: 550ms;
}

.stagger-6 {
    transition-delay: 650ms;
}

.stagger-7 {
    transition-delay: 750ms;
}

.stagger-8 {
    transition-delay: 850ms;
}

/* Custom Cursor */
html,
body,
button,
a,
.btn,
.nav-link,
input,
textarea,
select,
[contenteditable] {
    cursor: none !important;
}

.cursor {
    width: 30px;
    height: 30px;
    border: 2px solid rgba(124, 58, 237, 0.9);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
    transition: transform 120ms cubic-bezier(.22, .9, .39, 1), background 120ms ease, border-color 120ms ease, width 120ms ease, height 120ms ease;
    background: rgba(124, 58, 237, 0.15);
    /* Lighter background */
}

.cursor.active {
    --cursor-scale: 0.85;
    background: rgba(124, 58, 237, 0.3);
    border-color: rgba(124, 58, 237, 1);
}

.cursor.click {
    --cursor-scale: 0.9;
    background: rgba(138, 43, 226, 0.6);
    border-color: rgba(138, 43, 226, 1);
}

.cursor.text {
    width: 2px;
    height: 24px;
    background: #ffffff;
    border: none;
    border-radius: 0;
    transform: translate3d(-50%, -50%, 0);
}

*:not(.cursor) {
    cursor: none !important;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 2rem;
    background: rgba(13, 13, 15, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: padding 0.3s ease;
}

.header.scrolled {
    padding: 0.75rem 2rem;
    background: rgba(13, 13, 15, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.logo-text span {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Desktop Nav */
.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.6rem 1.2rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0%;
    height: 2px;
    background: var(--accent);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--accent);
    background: rgba(124, 58, 237, 0.1);
}

.nav-link.active::after {
    width: 80%;
}

.user-section {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    cursor: pointer;
    transition: transform 0.2s;
}

.user-avatar-small:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Mobile Menu Button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 101;
}

/* Buttons */
.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* Button Pulse/Shine Effect */
.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn:hover::after {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 100px;
    color: var(--accent-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    backdrop-filter: blur(4px);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.hero-title {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-title .gradient {
    background: linear-gradient(135deg, #fff 10%, var(--accent) 50%, #f472b6 90%);
    background-size: 200% auto;
    animation: gradientText 5s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(124, 58, 237, 0.4));
}

@keyframes gradientText {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
    font-weight: 300;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 4rem;
}

/* Stats Grid - Hero */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.stat-card {
    background: rgba(26, 26, 36, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    background: rgba(26, 26, 36, 0.4);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.stat-card:hover {
    border-color: rgba(124, 58, 237, 0.5);
    transform: translateY(-10px);
    box-shadow: 0 20px 40px -10px rgba(124, 58, 237, 0.15);
    background: rgba(26, 26, 36, 0.8);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #ccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Features Section */
.page-section {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Responsive Grid */
    gap: 2rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    transition: all 0.4s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-8px);
    background: linear-gradient(145deg, var(--bg-card), var(--bg-card-hover));
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.7);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: rgba(124, 58, 237, 0.1);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--accent);
    color: white;
}

.feature-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

/* Download Section */
.download-card {
    background: radial-gradient(circle at center, rgba(26, 26, 36, 1) 0%, rgba(13, 13, 15, 1) 100%);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.download-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.download-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.download-card h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

/* Footer */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    margin-top: 0;
    /* Reset */
    background: var(--bg-primary);
    position: relative;
    /* Not fixed */
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

/* Panel Styles - Enhanced */
.panel {
    padding-top: 140px;
    min-height: 80vh;
}

.panel-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.panel-card {
    background: rgba(22, 22, 28, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.panel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
    pointer-events: none;
}

.panel-card:hover {
    border-color: rgba(124, 58, 237, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
    background: rgba(26, 26, 36, 0.8);
}

.panel-card h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
    color: white;
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
}

/* Admin Dashboard Specifics */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.admin-stat-card {
    background: linear-gradient(145deg, rgba(26, 26, 36, 0.9), rgba(20, 20, 28, 0.95));
    border: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    height: 100%;
    min-height: 180px;
}

.admin-stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 10px 40px -10px var(--accent-glow);
}

.admin-stat-card .stat-value {
    font-size: 2.5rem;
    background: linear-gradient(to bottom right, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Table Enhancements */
.users-table {
    width: 100%;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.user-row:nth-child(odd) {
    background: rgba(255, 255, 255, 0.04);
}

.user-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(124, 58, 237, 0.3);
    transform: translateX(5px);
}

/* Scrollbar for table */
.users-table {
    scrollbar-width: thin;
    scrollbar-color: var(--border) rgba(0, 0, 0, 0.1);
}

/* WebKit scrollbar (Chrome/Edge/Safari) */
@supports selector(::-webkit-scrollbar) {
    .users-table::-webkit-scrollbar {
        width: 6px;
    }

    .users-table::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
    }

    .users-table::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 3px;
    }

    .users-table::-webkit-scrollbar-thumb:hover {
        background: var(--accent);
    }
}

/* Form Elements */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
    background: rgba(0, 0, 0, 0.5);
}

/* Profile specific */
.profile-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    padding: 3rem 2rem;
    background: linear-gradient(145deg, rgba(30, 30, 40, 0.8), rgba(20, 20, 28, 0.9));
}

.profile-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.profile-info {
    width: 100%;
}

.profile-info h3 {
    border: none;
    padding: 0;
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
    background: linear-gradient(135deg, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-info p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cursor {
        display: none;
    }

    /* Hide custom cursor on touch devices */
    html,
    body,
    a,
    button {
        cursor: auto !important;
    }

    .header-inner {
        padding: 0.5rem 0;
    }

    .menu-toggle {
        display: block;
        /* Show hamburger */
    }

    .nav {
        position: fixed;
        top: 70px;
        /* Below header */
        left: 0;
        width: 100%;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--border);
        transform: translateY(-150%);
        transition: transform 0.4s ease-in-out;
        z-index: 99;
    }

    .nav.open {
        transform: translateY(0);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .nav-link {
        font-size: 1.2rem;
        text-align: center;
        background: transparent !important;
        /* Remove bg on mobile */
    }

    .nav-link.active {
        color: var(--accent);
    }

    .user-section {
        display: none;
        /* Hide user section in header, move to mobile menu if needed or keep separate */
    }

    /* Special handling: If user logged in, we might want a mobile profile link. 
       For now, we can add a mobile-only user/login section to the .nav via JS or CSS. 
       Let's keep it simple: if specific "mobile-user-actions" exist, show them. */

    .hero-title {
        font-size: 2.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        /* Stack vertically */
        gap: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .panel-grid {
        grid-template-columns: 1fr;
        /* Stack panels */
    }

    .panel-card.wide {
        grid-column: span 1;
    }

    .footer-inner {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: white;
}

.modal h2 {
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.8rem;
    text-align: center;
}

.modal input {
    width: 100%;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    margin-bottom: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.modal input:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

/* Notification Toast */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: white;
    z-index: 2000;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.notification.active {
    transform: translateX(0);
}

.notification.success {
    border-left-color: var(--success);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.info {
    border-left-color: var(--accent);
}

/* Avatar Upload */
.avatar-upload {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--bg-card);
    transition: transform 0.2s;
}

.avatar-upload:hover {
    transform: scale(1.1);
}

.avatar-upload input {
    display: none;
}

.avatar-upload span {
    font-size: 1rem;
    line-height: 1;
}

/* ==================== MISSING COMPONENTS ==================== */

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-full {
    width: 100%;
}

/* Helper Buttons */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    background: var(--success);
    color: white;
}

/* User & Public Stats Grid */
.user-stats-grid,
.public-stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.user-stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.user-stat:hover {
    border-color: rgba(124, 58, 237, 0.3);
    transform: translateY(-2px);
}

.user-stat .label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.user-stat .value {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

/* Invites Section */
.quota-info {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.invite-result {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
    border-radius: 8px;
    color: var(--success);
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    display: none;
    word-break: break-all;
    text-align: center;
}

.invite-result.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.invited-list {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.invited-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.invited-item::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--success);
}

/* Admin Badges & Actions */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.badge-admin {
    background: rgba(124, 58, 237, 0.2);
    color: var(--accent-secondary);
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.badge-banned {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.panel-header-actions {
    flex-wrap: wrap;
    gap: 1rem;
}

/* Public Profile View */
.public-profile-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
}

.profile-avatar.large {
    width: 120px;
    height: 120px;
}

.profile-info.centered {
    text-align: center;
    width: 100%;
}

.public-stats-grid {
    margin-top: 2rem;
}

/* ========= PREMIUM PROFILE CARD ========= */
.profile-modal-content {
    max-width: 460px !important;
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid rgba(124, 58, 237, 0.2) !important;
    background: transparent !important;
}

.profile-modal-content .modal-close {
    z-index: 10;
    top: 1rem;
    right: 1rem;
    color: rgba(255,255,255,0.6);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.pp-card {
    position: relative;
    background: linear-gradient(165deg, #16161e 0%, #0f0f15 50%, #12101d 100%);
    border-radius: 20px;
    overflow: hidden;
    text-align: center;
}

/* Animated background glow */
.pp-bg-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        rgba(124, 58, 237, 0.08) 10%,
        transparent 20%,
        rgba(168, 85, 247, 0.06) 30%,
        transparent 40%
    );
    animation: ppGlowSpin 12s linear infinite;
    pointer-events: none;
}

@keyframes ppGlowSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Banner */
.pp-banner {
    height: 120px;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 40%, #6d28d9 70%, #4c1d95 100%);
    position: relative;
    overflow: hidden;
}

.pp-banner-pattern {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 40%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 20px,
            rgba(255,255,255,0.02) 20px,
            rgba(255,255,255,0.02) 40px
        );
    animation: ppBannerShimmer 8s ease-in-out infinite alternate;
}

@keyframes ppBannerShimmer {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Avatar */
.pp-avatar-wrapper {
    position: relative;
    margin-top: -55px;
    z-index: 5;
    display: inline-block;
}

.pp-avatar-ring {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, #7c3aed, #a855f7, #c084fc, #7c3aed);
    background-size: 300% 300%;
    animation: ppRingGradient 4s ease infinite;
    box-shadow: 
        0 0 20px rgba(124, 58, 237, 0.5),
        0 0 40px rgba(124, 58, 237, 0.2),
        inset 0 0 10px rgba(124, 58, 237, 0.3);
}

@keyframes ppRingGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.pp-avatar-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #16161e;
    display: block;
}

/* Rank Badge */
.pp-rank-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: 3px solid #16161e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.5);
    z-index: 6;
}

/* User Info */
.pp-user-info {
    padding: 0.75rem 2rem 0;
}

.pp-username {
    font-size: 1.65rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #ffffff 0%, #d4d4d8 50%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.pp-rank-title {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.2rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #c084fc;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 20px;
}

/* Stats Row */
.pp-stats-row {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    margin: 1.5rem 1.5rem 0;
    padding: 1.1rem 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    backdrop-filter: blur(4px);
}

.pp-stat {
    flex: 1;
    padding: 0.5rem 0.75rem;
    position: relative;
}

.pp-stat-divider {
    width: 1px;
    background: linear-gradient(180deg, transparent 10%, rgba(124, 58, 237, 0.3) 50%, transparent 90%);
    align-self: stretch;
}

.pp-stat-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.pp-stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.pp-stat-highlight .pp-stat-value {
    background: linear-gradient(135deg, #a855f7, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hit Rate Bar */
.pp-hitrate-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin-top: 0.55rem;
    overflow: hidden;
}

.pp-hitrate-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 35%, #22c55e 65%, #7c3aed 100%);
    background-size: 200% 100%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.4);
}

/* Footer branding */
.pp-footer {
    padding: 1rem 1.5rem;
    margin-top: 1.25rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.pp-brand {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border-radius: 4px;
    font-weight: 800;
    font-size: 0.65rem;
    color: white;
    vertical-align: middle;
    margin-right: 0.2rem;
}

/* Rank-based color variants */
.pp-rank-elite .pp-banner {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 40%, #dc2626 70%, #b91c1c 100%);
}
.pp-rank-elite .pp-avatar-ring {
    background: linear-gradient(135deg, #f59e0b, #f97316, #ef4444, #f59e0b);
    background-size: 300% 300%;
    animation: ppRingGradient 4s ease infinite;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5), 0 0 40px rgba(245, 158, 11, 0.2);
}
.pp-rank-elite .pp-rank-badge {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
}
.pp-rank-elite .pp-rank-title {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
}

.pp-rank-master .pp-banner {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 40%, #8b5cf6 70%, #6d28d9 100%);
}
.pp-rank-master .pp-avatar-ring {
    background: linear-gradient(135deg, #06b6d4, #3b82f6, #8b5cf6, #06b6d4);
    background-size: 300% 300%;
    animation: ppRingGradient 4s ease infinite;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5), 0 0 40px rgba(59, 130, 246, 0.2);
}
.pp-rank-master .pp-rank-badge {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5);
}
.pp-rank-master .pp-rank-title {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Profile card entrance animation */
.profile-modal-content .pp-card {
    animation: ppCardEntrance 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes ppCardEntrance {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .profile-modal-content {
        max-width: 95vw !important;
        margin: 0 0.5rem;
    }
    .pp-banner { height: 90px; }
    .pp-avatar-wrapper { margin-top: -45px; }
    .pp-avatar-ring { width: 90px; height: 90px; }
    .pp-stats-row { margin: 1rem 1rem 0; padding: 0.8rem 0.25rem; }
    .pp-stat-value { font-size: 1.25rem; }
    .pp-username { font-size: 1.4rem; }
}

/* Mobile Tweaks */
@media (max-width: 768px) {

    .user-stats-grid,
    .public-stats-grid {
        grid-template-columns: 1fr;
    }

    .panel-header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box input {
        width: 100% !important;
    }

    .user-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .user-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer Styling */
.footer {
    padding: 6rem 0 3rem;
    border-top: 1px solid var(--border);
    background: linear-gradient(to bottom, transparent, rgba(124, 58, 237, 0.02));
    margin-top: 8rem;
    text-align: center;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

/* Z-Coin & Subscription System */
.coin-display {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    /* Profiles style background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    /* Less rounded like profile */
    margin-right: 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    backdrop-filter: blur(8px);
}

.z-char {
    color: #a78bfa;
    /* Vibrant Purple */
    font-weight: 800;
    font-size: 1.1rem;
    margin-right: 8px;
    /* Increased margin */
    /* text-shadow: 0 0 10px rgba(124, 58, 237, 0.5); Removed glow */

    /* Box style */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 6px;
}

.coin-text {
    color: white;
    margin-right: 8px;
}

#userCoins {
    color: #fff;
    min-width: 50px;
}

.subscription-status {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.subscription-status p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.subscription-status span {
    font-weight: 700;
    color: white;
}

.subscription-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.plan-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.plan-card:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.plan-name {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.plan-price {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.plan-price .z-char {
    font-size: 0.9rem;
}

.btn-purchase {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.85rem;
    border-radius: 8px;
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent);
    border: 1px solid rgba(124, 58, 237, 0.3);
    transition: all 0.2s;
}

.plan-card:hover .btn-purchase {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Admin coin/sub fields */
.admin-detail-item {
    margin-bottom: 1rem;
}

.admin-detail-item label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.admin-input-group {
    display: flex;
    gap: 0.5rem;
}

.admin-input-group input {
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* User Table Edit Row Expansion */
.edit-row-container {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 0 solid rgba(255, 255, 255, 0.05);
    opacity: 0;
}

.edit-row-container.active {
    max-height: 500px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    opacity: 1;
    margin-bottom: 0.5rem;
}

.edit-row-content {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}