/* =========================================
   SolReclaim — Global Styles
   ========================================= */

:root {
    /* Solana brand colors */
    --sol-purple: #9945FF;
    --sol-green: #14F195;
    --sol-blue: #00D1FF;

    /* Surfaces */
    --bg-primary: #0b0e17;
    --bg-secondary: #111827;
    --bg-card: #151b2d;
    --bg-card-hover: #1a2240;
    --bg-input: #0d1220;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(153, 69, 255, 0.3);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Gradients */
    --gradient-sol: linear-gradient(135deg, #9945FF 0%, #14F195 100%);
    --gradient-sol-subtle: linear-gradient(135deg, rgba(153, 69, 255, 0.15) 0%, rgba(20, 241, 149, 0.15) 100%);
    --gradient-glow: radial-gradient(circle at 50% 0%, rgba(153, 69, 255, 0.12) 0%, transparent 60%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(153, 69, 255, 0.15);

    /* Spacing */
    --container-max: 1080px;
    --header-height: 72px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Animation */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* =========================================
   Reset & Base
   ========================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

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

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

img {
    display: block;
    max-width: 100%;
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* =========================================
   Background Particles
   ========================================= */

.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-particles::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 20%, rgba(153, 69, 255, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(20, 241, 149, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 60% 30%, rgba(0, 209, 255, 0.03) 0%, transparent 30%);
    animation: bgFloat 30s ease-in-out infinite alternate;
}

@keyframes bgFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(-2%, -2%) rotate(3deg);
    }
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--sol-purple);
    opacity: 0.15;
    animation: particleFloat 15s ease-in-out infinite;
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translate(0, 0);
        opacity: 0.1;
    }

    50% {
        transform: translate(30px, -40px);
        opacity: 0.25;
    }
}

/* =========================================
   Header
   ========================================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(11, 14, 23, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

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

.network-toggle {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.network-btn {
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    letter-spacing: 0.02em;
}

.network-btn.active {
    background: var(--gradient-sol-subtle);
    color: var(--text-primary);
}

.network-btn:hover:not(.active) {
    color: var(--text-secondary);
}

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

.logo-icon {
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-sol);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-connect {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    background: var(--gradient-sol);
    color: #000;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-base);
    box-shadow: 0 0 20px rgba(153, 69, 255, 0.3);
}

.btn-connect:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(153, 69, 255, 0.5);
}

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

.btn-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #000;
    opacity: 0.3;
    animation: dotPulse 2s ease infinite;
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }
}

.btn-connect.connected {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-connect.connected .btn-dot {
    background: var(--sol-green);
    opacity: 1;
}

/* =========================================
   Hero Section
   ========================================= */

.hero {
    position: relative;
    z-index: 1;
    padding: calc(var(--header-height) + 60px) 0 60px;
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 500px;
    background: var(--gradient-glow);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 100px;
    background: rgba(153, 69, 255, 0.1);
    border: 1px solid rgba(153, 69, 255, 0.2);
    color: var(--sol-purple);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sol-green);
    animation: pulse 2s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(20, 241, 149, 0.5);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(20, 241, 149, 0);
    }
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

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

.hero-description {
    max-width: 540px;
    margin: 0 auto 40px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    min-width: 160px;
    transition: all var(--transition-base);
}

.stat-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-sol);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================================
   Accounts Section
   ========================================= */

.accounts-section {
    position: relative;
    z-index: 1;
    padding: 20px 0 40px;
}

.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.section-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-sol);
    opacity: 0.4;
}

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

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.account-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 6px 14px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.accounts-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: var(--text-muted);
    gap: 16px;
}

.placeholder-icon {
    opacity: 0.4;
    margin-bottom: 8px;
}

.accounts-placeholder p {
    font-size: 0.95rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    background: var(--gradient-sol);
    color: #000;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-base);
    box-shadow: 0 0 20px rgba(153, 69, 255, 0.25);
    margin-top: 8px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(153, 69, 255, 0.45);
}

/* Account List */
.accounts-list-header {
    display: grid;
    grid-template-columns: 36px 2fr 2fr 120px;
    gap: 12px;
    padding: 12px 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.col-check {
    display: flex;
    align-items: center;
    justify-content: center;
}

.col-check input[type="checkbox"] {
    accent-color: var(--sol-purple);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.account-row {
    display: grid;
    grid-template-columns: 36px 2fr 2fr 120px;
    gap: 12px;
    padding: 14px 16px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.account-row:hover {
    background: rgba(153, 69, 255, 0.04);
}

.account-row.selected {
    background: rgba(153, 69, 255, 0.08);
}

.token-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.token-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-sol-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--sol-purple);
    flex-shrink: 0;
}

.token-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.token-address {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.col-balance,
.col-rent {
    font-size: 0.9rem;
}

.col-rent {
    color: var(--sol-green);
    font-weight: 600;
}

.check-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.account-row.selected .check-icon {
    background: var(--gradient-sol);
    border-color: transparent;
}

.account-row.selected .check-icon::after {
    content: '✓';
    font-size: 0.7rem;
    color: #000;
    font-weight: 700;
}

/* Action Bar */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    margin-top: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.action-bar-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.action-bar-amount {
    margin-left: 12px;
    color: var(--sol-green);
    font-weight: 600;
}

.action-bar-fee {
    margin-left: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.btn-reclaim {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 10px;
    background: var(--gradient-sol);
    color: #000;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-base);
}

.btn-reclaim:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(20, 241, 149, 0.3);
}

/* =========================================
   Referral Section
   ========================================= */

.referral-section {
    position: relative;
    z-index: 1;
    padding: 20px 0 40px;
}

.referral-card {
    background: var(--bg-card) !important;
}

.referral-content {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.referral-icon {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: var(--gradient-sol-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
}

.referral-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.referral-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.referral-link-box {
    display: flex;
    gap: 10px;
}

.referral-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: monospace;
    outline: none;
    transition: border-color var(--transition-base);
}

.referral-input:focus {
    border-color: var(--border-glow);
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn-copy:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
}

.btn-copy.copied {
    border-color: var(--sol-green);
    color: var(--sol-green);
}

/* =========================================
   FAQ Section
   ========================================= */

.faq-section {
    position: relative;
    z-index: 1;
    padding: 20px 0 60px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
}

.faq-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 720px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color var(--transition-base);
}

.faq-item:hover {
    border-color: rgba(153, 69, 255, 0.15);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    transition: color var(--transition-fast);
}

.faq-question:hover {
    color: var(--sol-purple);
}

.faq-chevron {
    flex-shrink: 0;
    transition: transform var(--transition-base);
    color: var(--text-muted);
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
    color: var(--sol-purple);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow), padding var(--transition-slow);
}

.faq-item.open .faq-answer {
    max-height: 300px;
}

.faq-answer p {
    padding: 0 20px 18px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* =========================================
   Footer
   ========================================= */

.footer {
    position: relative;
    z-index: 1;
    padding: 32px 0;
    border-top: 1px solid var(--border-color);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.logo-text-sm {
    font-weight: 700;
    font-size: 1rem;
    background: var(--gradient-sol);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-left p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    max-width: 480px;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--sol-purple);
}

/* =========================================
   Wallet Modal
   ========================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    margin: 16px;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-lg);
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

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

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wallet-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
    text-align: left;
    width: 100%;
}

.wallet-option:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
}

.wallet-option img {
    border-radius: 10px;
}

.wallet-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.wallet-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* =========================================
   Loading Spinner
   ========================================= */

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--sol-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   Toast Notification
   ========================================= */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    padding: 14px 20px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
    transform: translateY(20px);
    opacity: 0;
    transition: all var(--transition-base);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: rgba(20, 241, 149, 0.3);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.3);
}

/* Transaction Log */
.log-section {
    position: relative;
    z-index: 1;
    padding: 20px 0;
}

.tx-log {
    max-height: 300px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-input);
    border-radius: 10px;
    margin-top: 12px;
    font-family: monospace;
    font-size: 0.8rem;
    line-height: 1.8;
}

.tx-log-entry {
    color: var(--text-secondary);
}

.log-time {
    color: var(--text-muted);
    margin-right: 8px;
}

.wallet-icon-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.wallet-detected {
    color: var(--sol-green);
}

.wallet-not-installed {
    opacity: 0.5;
    text-decoration: none;
}

.wallet-not-installed:hover {
    opacity: 0.8;
}

.wallet-separator {
    padding: 10px 16px 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}

.wallet-no-wallets {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 768px) {
    .hero {
        padding: calc(var(--header-height) + 40px) 0 40px;
    }

    .hero-stats {
        gap: 12px;
    }

    .stat-card {
        min-width: 100px;
        padding: 16px 20px;
    }

    .accounts-list-header,
    .account-row {
        grid-template-columns: 2fr 1fr 80px;
    }

    .col-balance {
        display: none;
    }

    .referral-content {
        flex-direction: column;
        text-align: center;
    }

    .referral-link-box {
        flex-direction: column;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .section-card {
        padding: 24px 16px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-stats {
        flex-direction: column;
        align-items: center;
    }

    .stat-card {
        width: 100%;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .action-bar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}