/* ==========================================================================
   uDOGE Cyberpunk Design System & Styling
   Pure Vanilla CSS, Extreme Premium Aesthetics
   ========================================================================== */

/* --- Root Variables & Colors --- */
:root {
    --bg-dark: #050508;
    --bg-card: rgba(10, 11, 18, 0.65);
    --bg-card-hover: rgba(16, 19, 35, 0.8);
    --primary: #10b981;      /* Aurora Green */
    --primary-glow: rgba(16, 185, 129, 0.35);
    --primary-dim: rgba(16, 185, 129, 0.15);
    --accent: #fbbf24;       /* Cyberpunk Yellow */
    --accent-glow: rgba(251, 191, 36, 0.4);
    --accent-dim: rgba(251, 191, 36, 0.15);
    --text-main: #e4e4e7;    /* Zinc 200 */
    --text-muted: #71717a;   /* Zinc 500 */
    --text-bright: #ffffff;
    --border-color: rgba(16, 185, 129, 0.15);
    --border-hover: rgba(16, 185, 129, 0.4);
    
    --font-cyber: 'Orbitron', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', monospace;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Global Reset & Basics --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-mono);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* --- Retro CRT Scanlines & Cyber Background --- */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 99999;
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    opacity: 0.35;
}

/* Cyber Background Grid Overlay */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: 50px 50px;
    background-image: 
        linear-gradient(to right, rgba(16, 185, 129, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(16, 185, 129, 0.04) 1px, transparent 1px);
    pointer-events: none;
    z-index: -2;
    animation: gridPulse 20s infinite alternate ease-in-out;
}

/* Glowing Ambient Sphere */
.glow-sphere {
    position: fixed;
    top: -15%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.09) 0%, rgba(16, 185, 129, 0) 70%);
    pointer-events: none;
    z-index: -3;
    filter: blur(80px);
    animation: glowFloat 10s infinite alternate ease-in-out;
}

/* --- Animations --- */
@keyframes gridPulse {
    0% { opacity: 0.7; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.02); }
}

@keyframes glowFloat {
    0% { transform: translate(-50%, -5%) scale(0.9); }
    100% { transform: translate(-50%, 5%) scale(1.1); }
}

@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; text-shadow: 0 0 10px var(--primary); }
    100% { opacity: 0.4; }
}

@keyframes neonBlink {
    0%, 100% { opacity: 1; box-shadow: 0 0 15px var(--primary-glow); }
    50% { opacity: 0.8; box-shadow: 0 0 5px rgba(16, 185, 129, 0.1); }
}

/* --- Layout Container --- */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

/* --- App Header --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo-text {
    font-family: var(--font-cyber);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-bright);
    background: linear-gradient(90deg, #ffffff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.3));
}

.badge {
    font-size: 10px;
    background-color: var(--primary-dim);
    color: var(--primary);
    border: 1px solid var(--primary-glow);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    letter-spacing: 1px;
    vertical-align: middle;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 10px;
    background: rgba(10, 11, 18, 0.8);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.08);
    backdrop-filter: blur(10px);
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-cyber);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.nav-btn:hover {
    color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
}

.nav-btn.active {
    color: #ffffff;
    background: var(--primary-dim);
    border: 1px solid var(--primary-glow);
    text-shadow: 0 0 8px var(--primary-glow);
}

/* --- Web3 Button Custom --- */
.cyber-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-family: var(--font-cyber);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.cyber-btn:hover {
    background: var(--primary);
    color: #000000;
    box-shadow: 0 0 20px var(--primary-glow);
}

.cyber-btn:active {
    transform: scale(0.98);
}

/* --- Main Layout and Tabs --- */
.app-main {
    flex-grow: 1;
    margin-bottom: 60px;
}

.tab-content {
    display: none;
    animation: tabFadeIn 0.4s ease forwards;
}

.tab-content.active {
    display: block;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Cyber Glassmorphism Card --- */
.cyber-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(16, 185, 129, 0.02);
    transition: var(--transition-smooth);
    position: relative;
}

.cyber-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(16, 185, 129, 0.06), transparent 40%);
    pointer-events: none;
    z-index: 1;
}

.cyber-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.08), inset 0 0 20px rgba(16, 185, 129, 0.04);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-header h2 {
    font-family: var(--font-cyber);
    font-size: 18px;
    letter-spacing: 1px;
    color: var(--text-bright);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

.card-desc {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

/* Status Indicator Dot */
.status-indicator {
    font-size: 11px;
    font-weight: bold;
    font-family: var(--font-cyber);
    letter-spacing: 0.5px;
}

.status-indicator.live {
    color: var(--primary);
    animation: pulse 2s infinite ease-in-out;
}

.status-indicator.deprecated {
    color: var(--accent);
}

/* --- Swap Grid Layout --- */
.swap-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 900px) {
    .swap-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Input Groups --- */
.swap-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    margin-bottom: 24px;
}

.input-group {
    background: rgba(5, 5, 8, 0.7);
    border: 1px solid rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    padding: 16px;
    transition: var(--transition-smooth);
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.input-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.balance {
    cursor: pointer;
    transition: var(--transition-smooth);
}

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

/* MAX Button Styling */
.max-btn {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid var(--border-color);
    color: var(--primary);
    font-family: var(--font-cyber);
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-shadow: 0 0 5px var(--primary-glow);
    line-height: 1;
}

.max-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #000000;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    text-shadow: none;
}

.max-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    background: transparent;
    text-shadow: none;
    box-shadow: none;
}

.input-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-row input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-bright);
    font-family: var(--font-mono);
    font-size: 24px;
    width: 65%;
    font-weight: 700;
}

/* Hide number input spin buttons globally */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

.input-row input::placeholder {
    color: #27272a;
}

.token-select {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-family: var(--font-cyber);
    font-weight: bold;
    color: var(--text-bright);
}

.token-icon {
    font-size: 16px;
}

/* Swap Direction Switch Button */
.swap-divider {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.switch-btn {
    background: #09090b;
    border: 1px solid var(--border-color);
    color: var(--primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}

.switch-btn:hover {
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 15px var(--primary-glow);
    transform: rotate(180deg) scale(1.05);
}

/* --- Price Info Panel --- */
.price-info-panel {
    background: rgba(5, 5, 8, 0.4);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.info-row span:first-child {
    color: var(--text-muted);
}

.info-row span:last-child {
    color: var(--text-main);
    font-weight: 600;
}

.cyan-text {
    color: #22d3ee !important;  /* Sky Cyan */
    text-shadow: 0 0 8px rgba(34, 211, 238, 0.3);
}

.green-text {
    color: var(--primary) !important;
}

.yellow-text {
    color: var(--accent) !important;
    text-shadow: 0 0 8px var(--accent-glow);
}

/* --- Large Action Button --- */
.action-btn {
    width: 100%;
    background: var(--primary-dim);
    border: 1px solid var(--primary-glow);
    color: var(--primary);
    padding: 16px;
    border-radius: 12px;
    font-family: var(--font-cyber);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.05);
}

.action-btn:not(:disabled):hover {
    background: var(--primary);
    color: #000000;
    box-shadow: 0 0 25px var(--primary-glow);
    border-color: var(--primary);
}

.action-btn:disabled {
    background: rgba(24, 24, 27, 0.4);
    border: 1px solid #27272a;
    color: #3f3f46;
    cursor: not-allowed;
}

/* --- Progress Card Specifics --- */
.progress-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.progress-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.stat-box {
    flex: 1;
    background: rgba(5, 5, 8, 0.5);
    border: 1px solid rgba(16, 185, 129, 0.05);
    border-radius: 12px;
    padding: 14px;
}

.stat-box .label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.stat-box .value {
    display: block;
    font-family: var(--font-cyber);
    font-size: 18px;
    font-weight: 700;
}

/* Glowing Progress Bar */
.progress-container {
    height: 28px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    margin-bottom: 28px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
}

.progress-bar-glow {
    height: 100%;
    width: 0%;  /* Dynamic default */
    background: linear-gradient(90deg, #059669 0%, var(--primary) 70%, #34d399 100%);
    box-shadow: 0 0 15px var(--primary);
    border-radius: 20px;
    position: relative;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-bar-glow::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: progressShimmer 2s infinite linear;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percentage {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-cyber);
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 5px var(--primary);
}

/* Bullet Items */
.curve-stats-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bullet-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: var(--text-main);
}

.bullet {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
    margin-top: 8px;
    flex-shrink: 0;
    box-shadow: 0 0 6px var(--primary);
}

.bullet-item strong {
    color: #ffffff;
}

/* --- SECTION: WHITEPAPER (Academic Typography) --- */
.whitepaper-container {
    max-width: 800px;
    margin: 0 auto;
}

.paper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 50px;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

@media (max-width: 600px) {
    .paper {
        padding: 24px;
    }
}

.paper-title {
    font-family: var(--font-cyber);
    font-size: 28px;
    text-align: center;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.paper-subtitle {
    font-size: 13px;
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.paper-section {
    margin-bottom: 35px;
    border-left: 2px solid rgba(16, 185, 129, 0.15);
    padding-left: 20px;
}

.paper-section h3 {
    font-family: var(--font-cyber);
    font-size: 15px;
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.paper-section p {
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 12px;
    text-align: justify;
}

.paper-section ul, .paper-section ol {
    margin-left: 20px;
    margin-bottom: 12px;
    font-size: 13px;
}

.paper-section li {
    margin-bottom: 8px;
}

/* Scientific Mathematics Blocks */
.math-block {
    background: rgba(5, 5, 8, 0.7);
    border: 1px solid rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    padding: 18px;
    text-align: center;
    margin: 20px 0;
    font-family: var(--font-mono);
    color: #ffffff;
    font-size: 14px;
    letter-spacing: 0.5px;
    overflow-x: auto;
}

/* --- SECTION: STATS --- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.full-width {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .full-width {
        grid-column: span 1;
    }
}

/* SVG Chart Design */
.chart-container {
    background: rgba(5, 5, 8, 0.7);
    border: 1px solid rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    padding: 14px;
    position: relative;
    overflow: visible; /* Allow tooltip to float outside boundaries if necessary */
}

.visual-chart {
    width: 100%;
    height: auto;
    display: block;
}

#chartPath {
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

/* Axis text style */
#chartLabels text {
    fill: var(--text-muted);
    font-size: 10px;
    font-family: var(--font-mono);
    user-select: none;
}

/* Premium Frosted Glass Tooltip */
.chart-tooltip {
    position: absolute;
    background: rgba(10, 11, 18, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    font-family: var(--font-mono);
    color: var(--text-main);
    font-size: 11px;
    pointer-events: none; /* Prevents hovering flickering */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8), 0 0 15px rgba(16, 185, 129, 0.1);
    z-index: 100;
    transition: opacity 0.15s ease, transform 0.15s ease;
    transform: translate(-50%, -115%); /* Center horizontally and lift above the cursor */
}

.chart-tooltip::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: rgba(10, 11, 18, 0.88);
    border-right: 1px solid rgba(16, 185, 129, 0.3);
    border-bottom: 1px solid rgba(16, 185, 129, 0.3);
}

.chart-tooltip .tooltip-title {
    font-family: var(--font-cyber);
    font-size: 12px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 8px;
    border-bottom: 1px dashed rgba(251, 191, 36, 0.2);
    padding-bottom: 4px;
    letter-spacing: 1px;
}

.chart-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 4px;
}

.chart-tooltip .tooltip-row:last-child {
    margin-bottom: 0;
}

.chart-tooltip .tooltip-label {
    color: var(--text-muted);
}

.chart-tooltip .tooltip-value {
    font-weight: bold;
    color: #ffffff;
}

/* Stats Parameter List */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 10px;
}

.stat-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.stat-val {
    font-size: 13px;
    font-weight: bold;
    color: #ffffff;
}

/* Bonding Curve Calculator */
.calc-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group.mini {
    padding: 12px;
}

.input-group.mini label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.input-group.mini input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-bright);
    font-family: var(--font-mono);
    font-size: 18px;
    width: 100%;
    font-weight: bold;
}

.calc-result-box {
    background: var(--primary-dim);
    border: 1px solid var(--primary-glow);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.05);
}

.calc-result-box .label {
    font-size: 12px;
    color: var(--text-main);
    font-weight: 600;
}

.calc-result-box .result-value {
    font-family: var(--font-cyber);
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 10px var(--primary-glow);
}

/* --- App Footer --- */
.app-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
}

.app-footer p {
    font-size: 11px;
    color: var(--text-muted);
}
