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

/* Glassmorphism Toast */
.glass-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.glass-toast {
    background: rgba(25, 30, 40, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    color: white;
    padding: 16px 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
}

.glass-toast.show {
    transform: translateX(0);
}

.glass-toast.success {
    border-left: 4px solid #00f2aa;
}

.glass-toast.error {
    border-left: 4px solid #ff3b3b;
}

.toast-icon {
    font-size: 20px;
}

.toast-icon.success {
    color: #00f2aa;
}

.toast-icon.error {
    color: #ff3b3b;
}

.toast-content {
    display: flex;
    flex-direction: column;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.toast-msg {
    font-size: 12px;
    color: #94a3b8;
}

:root {
    --primary: #10f48b;
    --primary-glow: rgba(16, 244, 139, 0.4);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main: 'Prompt', 'Outfit', sans-serif;

    /* Default (Dark Mode) */
    --bg-dark: #0a0a0a;
    --bg-body: #0a0a0a;
    --bg-card: rgba(28, 28, 28, 0.7);
    --text-white: #ffffff;
    /* Main text */
    --text-main: #ffffff;
    --text-gray: #9ca3af;
    --text-muted: rgba(255, 255, 255, 0.5);
    --input-border: rgba(16, 244, 139, 0.3);
    --input-bg: #171717;
    --input-focus: #2a2d36;
    --border-color: rgba(255, 255, 255, 0.1);
    --nav-bg: #141414;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --card-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] {
    --bg-dark: #f0f2f5;
    --bg-body: #ffffff;
    --bg-card: #ffffff;
    --text-white: #111827;
    /* Swapped for logic consistency */
    --text-main: #111827;
    --text-gray: #4b5563;
    --text-muted: rgba(0, 0, 0, 0.5);
    --input-border: rgba(16, 244, 139, 0.5);
    --input-bg: #f9fafb;
    --input-focus: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --nav-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(0, 0, 0, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Prompt', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-body);
    /* Darker outer background for desktop */
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 900px;
    /* Increased from 450px to 900px as per original dashboard */
    background-color: var(--bg-body);
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px var(--shadow-color);
    padding: 0;
    /* Base padding controlled by children */
}

/* Landing/Auth page specific container tweaks */
.landing-container {
    padding: 40px 20px;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Center login/register forms within the container */
.auth-page {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Align to top instead of center */
    align-items: center;
    min-height: 100vh;
    padding: 12vh 20px 40px 20px;
    /* Add top spacing (12% of viewport height) */
    position: relative;
}

@media (max-width: 480px) {
    .auth-page {
        padding-top: 5vh;
        /* Less padding on mobile to push content higher */
    }
}

.auth-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Background Animation */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 244, 139, 0.05) 0%, transparent 70%);
    z-index: -1;
    animation: drift 15s linear infinite;
}

@keyframes drift {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Logo Section */
.logo-container {
    margin-bottom: 30px;
    /* Reduced to match reference spacing */
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Logo Styles - Using Real Logo Image */
.logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 100%;
}

.logo-image {
    width: 100%;
    max-width: 280px;
    /* Responsive size for the main logo */
    height: auto;
    filter: drop-shadow(0 0 15px rgba(16, 244, 139, 0.2));
    transition: var(--transition);
}

.logo-image:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 0 20px rgba(16, 244, 139, 0.4));
}

[data-theme="light"] .logo-image {
    filter: invert(1) hue-rotate(180deg) drop-shadow(0 0 2px rgba(0, 0, 0, 0.1));
}

.logo-icon,
.logo-text,
.logo-brand-large {
    display: none !important;
}

.logo-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}

.logo-brand img {
    height: 24px;
    width: auto;
}

[data-theme="light"] .logo-brand img {
    filter: invert(1) hue-rotate(180deg);
}

.logo-brand span {
    display: none;
    /* Hide text if the logo image already has it */
}

.logo-text {
    font-size: 42px;
    font-weight: 600;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--text-white), #808080);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Button UI */
.nav-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}

.hint-text {
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 8px;
}

.btn-primary {
    background: var(--primary);
    color: #12141a;
    border: none;
    padding: 16px;
    border-radius: 20px;
    font-size: 18px;
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: block;
    width: 100%;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--primary-glow);
    background: #14ffa0;
    /* Slightly brighter on hover */
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-dark {
    background: var(--glass-bg);
    /* Stays uniform in dark/light for button logic or use variable if needed */
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 20px;
    font-size: 18px;
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: block;
    width: 100%;
    text-align: center;
}

.btn-dark:hover {
    background: rgba(128, 128, 128, 0.1);
    transform: translateY(-3px);
}

/* Page Transition Overlay */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s cubic-bezier(0.86, 0, 0.07, 1);
    pointer-events: none;
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.page-transition.active {
    transform: translateY(0);
}

.page-transition.exit {
    transform: translateY(-100%);
}

.page-transition.enter {
    transform: translateY(100%);
}

.transition-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader-bar {
    width: 150px;
    height: 2px;
    background: rgba(16, 244, 139, 0.1);
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.loader-bar::after {
    content: '';
    position: absolute;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary);
    animation: load-progress 1.5s infinite;
}

@keyframes load-progress {
    0% {
        left: -100%;
    }

    50% {
        left: 0%;
    }

    100% {
        left: 100%;
    }
}

.transition-logo {
    width: 80px;
    opacity: 0.8;
}

[data-theme="light"] .transition-logo {
    filter: invert(1) hue-rotate(180deg);
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 30px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.divider span {
    background: var(--bg-dark);
    padding: 0 15px;
    color: var(--text-gray);
    font-size: 14px;
    position: relative;
    z-index: 1;
}

/* App Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    position: relative;
    /* Changed from absolute to relative to push content down */
    background: var(--bg-dark);
    z-index: 100;
    height: 70px;
}


/* Form Styles */
.form-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 28px;
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow), 0 0 20px rgba(16, 244, 139, 0.05);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(20px);
}

.form-header {
    text-align: center;
    margin-bottom: 25px;
}

.form-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
    font-family: 'Prompt', sans-serif;
    letter-spacing: -0.5px;
}

.form-subtitle {
    font-size: 14px;
    color: var(--text-gray);
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 8px;
    margin-left: 5px;
}

.input-control {
    width: 100%;
    padding: 16px 20px;
    background: #171717;
    /* Darker background */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-white);
    font-size: 16px;
    font-family: var(--font-main);
    transition: var(--transition);
    outline: none;
}

.input-control:focus {
    background: var(--input-focus);
    border-color: rgba(0, 255, 186, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 186, 0.1);
}

.back-link {
    display: block;
    margin-top: 20px;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary);
}

.back-link span {
    color: var(--primary);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 900px;
    height: calc(65px + env(safe-area-inset-bottom));
    /* Balanced height */
    background: var(--nav-bg);
    /* Semi-transparent */
    backdrop-filter: blur(15px);
    /* Glassmorphism */
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -5px 20px var(--shadow-color);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-gray);
    font-size: 11px;
    transition: var(--transition);
}

.nav-item i {
    font-size: 20px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:hover {
    color: var(--primary);
}

/* Dashboard Content */
.dashboard-container {
    padding: 0 20px 100px 20px;
    flex: 1;
    /* Space for bottom nav */
}

.header-simple {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    margin-bottom: 20px;
}

.header-simple h1 {
    font-size: 20px;
    font-weight: 600;
}

.balance-card {
    background: linear-gradient(135deg, var(--primary), #0cb66b);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(16, 244, 139, 0.2);
}

.balance-card::after {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.balance-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    /* Always white on green card */
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    background: var(--bg-card);
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.action-icon {
    width: 45px;
    height: 45px;
    background: rgba(16, 244, 139, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
}

.action-item span {
    font-size: 12px;
    color: var(--text-gray);
    text-align: center;
}

.action-item:hover .action-icon {
    transform: translateY(-3px);
}

/* Price Animations (New: Pop & Glow) */
/* Price Animations (Premium Smooth Flash) */
.text-up {
    color: var(--primary) !important;
}

.text-down {
    color: #ff4d4d !important;
}

@keyframes smooth-green {
    0% {
        color: #ffffff;
        text-shadow: 0 0 8px rgba(16, 244, 139, 0.8);
        background-color: rgba(16, 244, 139, 0.1);
        /* Subtle bg flash */
        border-radius: 4px;
    }

    100% {
        color: var(--primary);
        text-shadow: none;
        background-color: transparent;
    }
}

@keyframes smooth-red {
    0% {
        color: #ffffff;
        text-shadow: 0 0 8px rgba(255, 77, 77, 0.8);
        background-color: rgba(255, 77, 77, 0.1);
        /* Subtle bg flash */
        border-radius: 4px;
    }

    100% {
        color: #ff4d4d;
        text-shadow: none;
        background-color: transparent;
    }
}

.flash-up {
    animation: smooth-green 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    padding: 0 4px;
    /* Prevent text clipping from shadow */
    margin: 0 -4px;
    /* Compensate for padding to keep layout stable */
}

.flash-down {
    animation: smooth-red 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    padding: 0 4px;
    margin: 0 -4px;
}

/* Premium Percent Badge */
.percent-badge {
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    min-width: 55px;
    text-align: center;
    display: inline-block;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.percent-badge.up {
    background: linear-gradient(180deg, rgba(16, 244, 139, 0.15) 0%, rgba(16, 244, 139, 0.05) 100%);
    color: #10f48b;
    border: 1px solid rgba(16, 244, 139, 0.25);
}

.percent-badge.down {
    background: linear-gradient(180deg, rgba(255, 77, 77, 0.15) 0%, rgba(255, 77, 77, 0.05) 100%);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.25);
}