@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', 'Roboto', Arial, sans-serif;
    background: #050510;
    color: #e0e0e0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

.text-neon {
    color: #00f3ff;
}

.btn-primary {
    background: #00f3ff;
    color: #001219;
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    box-shadow: 0 15px 30px rgba(0, 243, 255, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 40px rgba(0, 243, 255, 0.4);
}

.hidden {
    display: none !important;
}

/* Layout */
.dashboard-shell {
    display: flex;
    min-height: 100vh;
}

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    padding: 2rem 1.5rem;
    background: rgba(5, 5, 15, 0.75);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 5;
    transform: translateX(0);
    transition: transform 0.35s ease;
}

#sidebar.closed {
    transform: translateX(-100%);
}

#sidebar header {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #00f3ff;
    font-size: 0.85rem;
}

#sidebar .nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

#sidebar .nav a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.9rem;
    border-radius: 0.8rem;
    color: rgba(224, 224, 224, 0.8);
    transition: background 0.2s ease, color 0.2s ease;
}

#sidebar .nav a:hover,
#sidebar .nav a.active {
    background: rgba(0, 243, 255, 0.12);
    color: #00f3ff;
}

body.has-sidebar header.site-header {
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    height: 70px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(5, 5, 15, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    z-index: 4;
}

body.has-sidebar header.site-header .logo {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.95rem;
    color: #00f3ff;
}

body.has-sidebar header.site-header .user-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

body.has-sidebar header.site-header .coin-badge {
    padding: 0.4rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 243, 255, 0.4);
    background: rgba(0, 243, 255, 0.1);
    color: #00f3ff;
    font-weight: 600;
}

body.has-sidebar header.site-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(0, 243, 255, 0.4);
}

.sidebar-toggle,
.sidebar-close {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: #e0e0e0;
    border-radius: 12px;
    padding: 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.sidebar-toggle span,
.sidebar-close span {
    width: 20px;
    height: 2px;
    background: currentColor;
}

.sidebar-close {
    align-self: flex-end;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
}

.main-content {
    margin-left: 250px;
    padding: 90px 2rem 2.5rem;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.content-frame {
    flex: 1;
    width: 100%;
}

.hero-card {
    grid-column: 1 / -1;
}

.hero-card h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    margin-bottom: 0.75rem;
}

.status-card h2,
.quick-actions h2 {
    margin-bottom: 1rem;
}

.status-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.status-item {
    padding: 1.2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.text-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    color: rgba(224, 224, 224, 0.65);
}

.quick-actions p {
    margin-bottom: 1rem;
    color: rgba(224, 224, 224, 0.85);
}

/* Animations */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 243, 255, 0.5);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-panel {
    animation: fade-in-up 0.5s ease-out;
}

.hero-card {
    animation-delay: 0.1s;
}

.status-card {
    animation-delay: 0.2s;
}

.quick-actions {
    animation-delay: 0.3s;
}

.text-neon {
    font-size: 2rem;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.6);
}

.status-item:hover {
    background: rgba(0, 243, 255, 0.05);
    border-color: rgba(0, 243, 255, 0.2);
    transition: all 0.3s ease;
}

.btn-primary {
    animation: pulse-glow 2s ease-in-out infinite;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* User role styling */
.user-role {
    font-size: 0.85rem;
    color: rgba(224, 224, 224, 0.6);
    padding: 0.5rem 0.8rem;
    background: rgba(0, 243, 255, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(0, 243, 255, 0.15);
}

/* Nav icons */
#sidebar .nav a i {
    color: #00f3ff;
    width: 20px;
    text-align: center;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 243, 255, 0.5);
}

@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
        width: 80vw;
        max-width: 320px;
    }

    #sidebar.open {
        transform: translateX(0);
    }

    body.has-sidebar header.site-header {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding-top: 110px;
    }

    .sidebar-toggle {
        display: flex;
    }

    .hero-card h1 {
        font-size: 1.8rem;
    }
}

/* ================================================
   Site Header (Global Navigation)
   ================================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(5, 5, 20, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
}

.site-header .header-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.site-header .header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.site-header .header-logo .logo-icon {
    font-size: 1.5rem;
}

.site-header .header-logo .logo-text {
    background: linear-gradient(135deg, #fff, #00f3ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-header .header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-header .nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
}

.site-header .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.site-header .nav-link.active {
    color: #00f3ff;
    background: rgba(0, 243, 255, 0.1);
}

.site-header .nav-link .nav-icon {
    font-size: 1rem;
}

.site-header .header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.site-header .user-coins {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #ffd700;
}

.site-header .user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.site-header .user-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.site-header .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(0, 243, 255, 0.2);
}

.site-header .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.site-header .user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
}

.site-header .user-chevron {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.2s ease;
}

.site-header .user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 180px;
    background: rgba(20, 20, 40, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.site-header .user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-header .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.site-header .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.site-header .dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.site-header .dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

.site-header .header-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.site-header .btn-login {
    color: rgba(255, 255, 255, 0.8);
}

.site-header .btn-login:hover {
    color: #fff;
}

.site-header .btn-register {
    background: linear-gradient(135deg, #00f3ff, #00b8cc);
    color: #050510;
}

.site-header .btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 243, 255, 0.3);
}

.site-header .mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

.site-header .mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.site-header .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.site-header .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.site-header .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(5, 5, 20, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-menu-overlay {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 998;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-link {
    display: block;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.highlight {
    background: rgba(0, 243, 255, 0.1);
    color: #00f3ff;
}

.mobile-nav-link.logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.mobile-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

/* Content offset for fixed header */
.has-header {
    padding-top: 70px;
}

/* ================================================
   Site Footer
   ================================================ */
.site-footer {
    background: rgba(5, 5, 15, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-main {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
}

.footer-tagline {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 4rem;
}

.footer-column h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #00f3ff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.footer-column a {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.6rem;
    transition: color 0.2s ease;
}

.footer-column a:hover {
    color: #fff;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.footer-credits {
    color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 900px) {
    .site-header .header-nav {
        display: none;
    }
    
    .site-header .mobile-menu-toggle {
        display: flex;
    }
    
    .footer-main {
        flex-direction: column;
        gap: 2rem;
    }
    
    .footer-links {
        flex-wrap: wrap;
        gap: 2rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* ================================================
   Flash Messages (Global)
   ================================================ */
.flash-container {
    margin-bottom: 1.5rem;
}

.flash-message {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: flashSlideIn 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.flash-message:last-child {
    margin-bottom: 0;
}

@keyframes flashSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flash-message::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    animation: flashProgress 5s linear forwards;
}

@keyframes flashProgress {
    from { width: 100%; }
    to { width: 0%; }
}

.flash-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.flash-content {
    flex: 1;
}

.flash-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.flash-text {
    opacity: 0.9;
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
    line-height: 1;
    transition: opacity 0.2s;
}

.flash-close:hover {
    opacity: 1;
}

/* Flash Types */
.flash-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.flash-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.flash-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.flash-info {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.3);
    color: #00f3ff;
}

/* Debug Flash (for developers) */
.flash-debug {
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: #a78bfa;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
}

.flash-debug .flash-content {
    white-space: pre-wrap;
    word-break: break-all;
}

