/* Base styles and variables */
:root {
    /* Colors */
    --bg-main: #0a0b10;
    --bg-secondary: rgba(20, 22, 30, 0.6);
    --bg-card: rgba(30, 32, 45, 0.4);
    --bg-input: rgba(14, 15, 23, 0.8);
    --bg-hover: rgba(45, 48, 68, 0.8);
    --text-main: #ffffff;
    --text-muted: #9499ab;
    --accent-primary: #8b5cf6;
    --accent-secondary: #06b6d4;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --accent-gradient-hover: linear-gradient(135deg, #9d70ff, #08c8e8);
    --accent-glow: rgba(139, 92, 246, 0.4);
    --danger: #ef4444;
    --success: #10b981;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-border-highlight: 1px solid rgba(255, 255, 255, 0.2);

    /* Typography */
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Effects */
    --shadow-glow: 0 0 40px var(--accent-glow);
    --glass-blur: blur(16px);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --border-radius-xl: 32px;
}

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

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

/* Background Gradients for Glassmorphism Context  */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.5;
    pointer-events: none;
}

body::before {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-primary), transparent 70%);
}

body::after {
    bottom: -10%;
    right: -5%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-secondary), transparent 70%);
}

/* Utility Classes */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--border-radius-xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
}

input {
    font-family: inherit;
    border: none;
    outline: none;
    background: none;
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1.5rem 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: top var(--transition-normal);
}

.announcement-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--accent-gradient);
    color: white;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 110;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

.announcement-banner.active {
    display: block;
}

body.has-announcement .header {
    top: 36px; /* Approximate height of the banner */
}

body.has-announcement .hero-section {
    padding-top: calc(10rem + 36px);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-gradient);
    box-shadow: var(--shadow-glow);
}

.main-nav {
    display: flex;
    gap: 2.5rem;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    transition: var(--transition-fast);
}

.nav-toggle:hover {
    background: var(--bg-hover);
}

.nav-toggle-bars {
    position: relative;
    width: 18px;
    height: 14px;
}

.nav-toggle-bars span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform var(--transition-fast), opacity var(--transition-fast), top var(--transition-fast);
}

.nav-toggle-bars span:nth-child(1) {
    top: 0;
}

.nav-toggle-bars span:nth-child(2) {
    top: 6px;
}

.nav-toggle-bars span:nth-child(3) {
    top: 12px;
}

.nav-toggle.is-open .nav-toggle-bars span:nth-child(1) {
    top: 6px;
    transform: rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-bars span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-open .nav-toggle-bars span:nth-child(3) {
    top: 6px;
    transform: rotate(-45deg);
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

.nav-link.active {
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

/* Hero Section */
.hero-section {
    padding: 10rem 0 6rem;
    min-height: calc(100vh - 80px); /* 80px approximate header height */
    display: flex;
    align-items: center;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 90%;
}

.hero-stats {
    display: flex;
    gap: 3rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-widget {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.swap-widget {
    width: 100%;
    max-width: 480px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}

.widget-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.swap-input-group {
    background: var(--bg-input);
    border-radius: var(--border-radius-lg);
    padding: 1rem 1.25rem;
    border: 1px solid transparent;
    transition: var(--transition-fast);
}

.swap-input-group:focus-within {
    border-color: var(--accent-primary);
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.2);
}

.swap-input-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.swap-input-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.swap-address-body {
    display: flex;
    align-items: center;
}

.amount-input {
    flex: 1;
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--text-main);
    width: 100%;
}

.amount-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

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

.address-input {
    width: 100%;
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--text-main);
    word-break: break-all;
}

.address-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.coin-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-hover);
    padding: 0.5rem 0.75rem 0.5rem 0.5rem;
    border-radius: var(--border-radius-xl);
    transition: var(--transition-fast);
    color: var(--text-main);
}

.coin-selector:hover {
    background: rgba(55, 58, 78, 0.8);
    transform: translateY(-1px);
}

.coin-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.coin-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.coin-symbol {
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
}

.coin-info-selected {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.coin-network-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chevron {
    color: var(--text-muted);
}

.swap-divider {
    position: relative;
    height: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -0.25rem 0;
    z-index: 2;
}

.swap-switch-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: var(--glass-border);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.swap-switch-btn:hover {
    background: var(--bg-hover);
    transform: rotate(180deg);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.swap-details {
    padding: 1rem 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.swap-address-group {
    gap: 0.4rem;
}

.swap-helper-text {
    margin-top: 0.7rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.swap-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-block {
    width: 100%;
}

.btn-large {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border-radius: var(--border-radius-lg);
}

.mt-4 {
    margin-top: 1rem;
}

/* Base Utilities */
.text-center {
    text-align: center;
}

/* Features Section */
.features-section {
    padding: 6rem 0 8rem;
    position: relative;
    z-index: 2;
}

.section-header {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    transition: var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(139, 92, 246, 0.3);
}

.feature-icon-wrapper {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: var(--shadow-glow);
}

.feature-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.feature-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: rgba(10, 11, 16, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 4rem 0 0;
    margin-top: auto;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand {
    max-width: 300px;
}

.footer-desc {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    gap: 4rem;
    flex-wrap: wrap;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-column h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.footer-column a {
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.footer-column a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
    transform: scale(0.95);
    transition: var(--transition-normal);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-search {
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.search-input:focus {
    border-color: var(--accent-primary);
}

.coin-list {
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-right: -0.5rem;
    padding-right: 0.5rem;
}

.coin-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    color: var(--text-main);
    font-family: var(--font-main);
}

.coin-item:hover {
    background: var(--bg-hover);
}

.coin-item-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.coin-item-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.coin-item-info {
    display: flex; flex-direction: column;
}

.coin-item-symbol {
    font-weight: 600; font-size: 1rem; color: var(--text-main);
}

.coin-item-name {
    font-size: 0.875rem; color: var(--text-muted);
}

.coin-item-network {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.coin-list::-webkit-scrollbar {
    width: 6px;
}
.coin-list::-webkit-scrollbar-track {
    background: transparent;
}
.coin-list::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-subtitle {
        margin: 0 auto 3rem;
    }
    
    .hero-stats {
        justify-content: center;
        margin-bottom: 3rem;
    }
    
    .hero-widget {
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .container {
        padding: 0 1rem;
    }

    .hero-section {
        padding: 8.5rem 0 5rem;
    }

    .hero-container {
        gap: 2rem;
    }

    .hero-widget {
        order: -1;
        width: 100%;
    }

    .hero-content {
        order: 1;
    }

    .header {
        padding: 1rem 0;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .main-nav {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .nav-link {
        font-size: 0.92rem;
    }

    .footer {
        padding-top: 3rem;
    }

    .address-input {
        font-size: 16px;
    }

    .footer-container {
        flex-direction: column;
        gap: 2rem;
        margin-bottom: 2.5rem;
    }

    .footer-brand {
        max-width: none;
    }

    .footer-links {
        gap: 2rem;
        justify-content: space-between;
    }
}

@media (max-width: 560px) {
    .logo {
        font-size: 1.08rem;
    }

    .main-nav {
        gap: 0.75rem;
    }

    .nav-link {
        font-size: 0.9rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1.5rem;
    }
}

@media (max-width: 680px) {
    .header {
        padding: 0.9rem 0;
    }

    .header-container {
        position: relative;
        gap: 0.75rem;
    }

    .nav-toggle {
        display: inline-flex;
        flex-shrink: 0;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: calc(100% + 0.75rem);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0.3rem;
        padding: 0.55rem;
        border-radius: 22px;
        background: rgba(12, 14, 22, 0.96);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 22px 45px rgba(0, 0, 0, 0.32);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .main-nav.is-open {
        display: flex;
    }

    .nav-link {
        display: block;
        width: 100%;
        font-size: 0.95rem;
        padding: 0.85rem 1rem;
        border-radius: 16px;
        white-space: nowrap;
    }

    .nav-link.active {
        background: rgba(255, 255, 255, 0.08);
        text-shadow: none;
    }
}
