/* ===============================================
   VELO Design System v2.0
   Psychologically Optimized & Emotional UI
   =============================================== */

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

:root {
    /* THEME: LIGHT (Default/Air)
       Psychology: Fresh, Open, Professional, New Beginnings!
    */
    --bg-main: #F3F4F6;
    --bg-surface: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-strong: rgba(255, 255, 255, 0.9);

    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;

    --border-light: rgba(0, 0, 0, 0.05);
    --border-hover: rgba(124, 58, 237, 0.3);

    --primary: #7C3AED;
    /* Electric Violet */
    --primary-glow: rgba(124, 58, 237, 0.2);
    --accent: #34D399;
    /* Neon Mint */
    --accent-glow: rgba(52, 211, 153, 0.2);
    --danger: #EF4444;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 8px 16px rgba(124, 58, 237, 0.06);
    --shadow-lg: 0 12px 32px rgba(124, 58, 237, 0.12);

    --font-body: 'Outfit', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
}

[data-theme="dark"] {
    /* THEME: DARK (Void/Night)
       Psychology: Infinite, Immersive, Tech-Forward, Relaxing
    */
    --bg-main: #05050A;
    --bg-surface: #0E0E16;
    --bg-glass: rgba(14, 14, 22, 0.7);
    --bg-glass-strong: rgba(14, 14, 22, 0.9);

    --text-primary: #ffffff;
    --text-secondary: #9CA3AF;
    --text-muted: #4B5563;

    --border-light: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(124, 58, 237, 0.5);

    --primary: #8B5CF6;
    /* Lighter Violet for Dark Mode */
    --primary-glow: rgba(139, 92, 246, 0.3);
    --accent: #10B981;
    --accent-glow: rgba(16, 185, 129, 0.2);
    --danger: #F87171;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(139, 92, 246, 0.15);
}

/* ==================== CORE RESET & TYPOGRAPHY ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global scrollbar styling so every scroll area (including in-app panes) stays branded */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-main);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Custom scrollbar for a cleaner, branded feel */
*::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

*::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-left: 1px solid var(--border-light);
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 999px;
    border: 3px solid var(--bg-main);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent), var(--primary));
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

/* ==================== UTILS ==================== */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-light);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hero-section {
    padding: 7rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before,
.hero-section::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    z-index: 0;
}

.hero-section::before {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, var(--primary-glow), transparent 60%);
    top: -80px;
    left: -120px;
}

.hero-section::after {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, var(--accent-glow), transparent 65%);
    bottom: -120px;
    right: -80px;
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    align-items: stretch;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-copy h1 {
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    line-height: 1.05;
    margin: 0.75rem 0 1rem;
}

.hero-copy p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 560px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0 0.75rem;
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pill {
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}

.hero-card {
    display: grid;
    gap: 1rem;
}

.dev-card,
.contact-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.dev-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.dev-subtitle {
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.status-chip {
    background: var(--primary-glow);
    color: var(--primary);
    padding: 0.35rem 0.8rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
}

.dev-intro {
    color: var(--text-secondary);
    margin: 0.75rem 0 1rem;
}

.dev-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dev-stack span {
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 0.4rem 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dev-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.dev-links a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-main);
    transition: all 0.2s ease;
    text-align: center;
    font-weight: 600;
}

.dev-links a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.contact-card {
    display: grid;
    gap: 1rem;
}

.contact-actions {
    display: grid;
    gap: 0.5rem;
}

.overline {
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.8rem;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
    background: var(--text-primary);
    /* Inverted look */
    color: var(--bg-main);
    padding: 0.8rem 2rem;
    border-radius: 99px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .btn-primary {
    background: white;
    color: black;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    padding: 0.8rem 2rem;
    border-radius: 99px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseSoft {

    0%,
    100% {
        box-shadow: 0 0 0 0 var(--primary-glow);
    }

    50% {
        box-shadow: 0 0 20px 0 var(--primary-glow);
    }
}

.animate-entrance {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    /* JS will trigger */
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

/* ==================== NAVBAR ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
}

.theme-toggle {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

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

/* ==================== FILE TRANSFER UI ==================== */
.transfer-card {
    background: var(--bg-surface);
    border-radius: 32px;
    padding: 3rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    text-align: center;
    transition: transform 0.3s ease;
}

.drop-zone {
    border: 3px dashed var(--border-light);
    border-radius: 24px;
    padding: 3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-main);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.speed-gauge-lg {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 3rem;
    color: var(--primary);
    text-shadow: 0 0 30px var(--primary-glow);
}

/* ==================== FOOTER ==================== */
footer {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-light);
    margin-top: 4rem;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.2s;
}

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

.page-shell {
    max-width: 1100px;
    margin: 7rem auto;
    padding: 0 1.5rem 4rem;
    display: grid;
    gap: 2rem;
}

.page-hero {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    display: grid;
    gap: 1rem;
}

.page-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3rem);
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

.info-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0.5rem;
}

.info-card p {
    color: var(--text-secondary);
}

.legal-section {
    display: grid;
    gap: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.legal-section h2 {
    font-size: 1.25rem;
}

.legal-section p,
.legal-section li {
    color: var(--text-secondary);
    line-height: 1.7;
}

.legal-section ul {
    padding-left: 1.25rem;
    display: grid;
    gap: 0.35rem;
}

.section {
    padding: 4rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.section.surface {
    background: var(--bg-surface);
    border-radius: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    margin-top: 3rem;
}

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

.section-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0.6rem;
}

.feature-card p {
    color: var(--text-secondary);
}

.icon-chip {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    color: var(--text-primary);
}

.icon-chip.primary {
    color: var(--primary);
    background: var(--primary-glow);
}

.icon-chip.accent {
    color: var(--accent);
    background: var(--accent-glow);
}

.icon-chip.warm {
    color: #FBBF24;
    background: rgba(251, 191, 36, 0.15);
}

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

.step-card {
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 1.25rem;
    display: grid;
    gap: 0.5rem;
    text-align: center;
}

.step-card p {
    color: var(--text-secondary);
}

.step-number {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--primary);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

/* ==================== MODAL ==================== */
#setupModal.active {
    display: flex !important;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }

    .transfer-card {
        padding: 1.5rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .dev-meta {
        flex-direction: column;
    }

    .section {
        padding: 3rem 1.25rem;
    }
}

/* ===============================================
   NEW TRANSFER UI (REDESIGN)
   =============================================== */

.room-layout {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 2rem;
    height: 80vh;
    width: 100%;
    max-width: 1400px;
}

/* Side Panels */
.floating-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.floating-panel:hover {
    border-color: var(--primary-glow);
    box-shadow: var(--shadow-md);
}

.panel-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Center Stage - Portal */
.center-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 2rem;
}

.velo-portal {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 2px dashed var(--border-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    cursor: pointer;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.velo-portal::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, var(--primary), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: rotateBin 4s linear infinite;
}

.velo-portal:hover {
    transform: scale(1.05);
    border-color: transparent;
    box-shadow: 0 0 60px var(--primary-glow);
}

.velo-portal:hover::before {
    opacity: 0.5;
}

.portal-icon {
    width: 64px;
    height: 64px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.velo-portal:hover .portal-icon {
    color: var(--primary);
}

.portal-text {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.portal-subtext {
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

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

/* Queue List Container */
.queue-container {
    width: 100%;
    max-height: 40%;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Modern File Card */
.file-card-modern {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-card-modern .progress-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--border-light);
    width: 100%;
}

.file-card-modern .progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.2s linear;
    box-shadow: 0 0 10px var(--primary-glow);
}

.file-icon-box {
    width: 40px;
    height: 40px;
    background: var(--bg-main);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.file-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    margin-top: 0.2rem;
}

/* Peer List Item */
.peer-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: var(--bg-surface);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
}

.peer-item.connected {
    border-color: var(--accent);
    background: rgba(52, 211, 153, 0.05);
}

.peer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-main, linear-gradient(135deg, #7C3AED, #34D399));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .room-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .center-stage {
        order: -1;
        padding: 4rem 0;
    }

    .velo-portal {
        width: 250px;
        height: 250px;
    }
}

/* ==================== NEW FEATURE STYLES ==================== */

/* Peer Selection */
.peer-pill.selected {
    border-color: var(--accent);
    background: rgba(52, 211, 153, 0.1);
}

.peer-select-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.peer-select-checkbox:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.peer-select-checkbox:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Queue Control Buttons */
.queue-ctrl-btn {
    transition: all 0.2s ease;
}

.queue-ctrl-btn:hover {
    background: var(--primary-glow) !important;
    color: var(--primary) !important;
}

/* Speed Test Button */
.speed-test-btn {
    transition: all 0.2s ease;
}

.speed-test-btn:hover {
    background: var(--accent-glow) !important;
    color: var(--accent) !important;
}

/* Spin Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

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

/* Desktop Only */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

/* Share Modal Social Buttons */
.share-social-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-family: var(--font-body);
}

.share-social-btn:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
}

/* Transfer Card Cancel Button */
.transfer-cancel-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.transfer-cancel-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.btn-ghost.tight {
    padding: 0.55rem 1.1rem;
    border-radius: 12px;
}