/**
 * BAT Torrent — Main UI Stylesheet
 *
 * Advanced dark glassmorphism UI with particle effects, gradients,
 * animations, and responsive design. Matches Zero Theme design tokens.
 *
 * @package BAT_Torrent
 * @version 1.0.0
 * @copyright BAT Torrent v1.0 — All rights reserved.
 */

/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bat-bg: #050816;
    --bat-bg-card: rgba(15, 22, 45, 0.65);
    --bat-bg-card-hover: rgba(15, 22, 45, 0.85);
    --bat-border: rgba(255, 255, 255, 0.06);
    --bat-border-light: rgba(255, 255, 255, 0.1);
    --bat-border-accent: rgba(0, 212, 170, 0.2);
    --bat-text: #e2e8f0;
    --bat-text-secondary: #94a3b8;
    --bat-text-muted: #64748b;
    --bat-accent: #00d4aa;
    --bat-accent-rgb: 0, 212, 170;
    --bat-accent-dim: rgba(0, 212, 170, 0.12);
    --bat-accent-glow: rgba(0, 212, 170, 0.25);
    --bat-purple: #8b5cf6;
    --bat-purple-rgb: 139, 92, 246;
    --bat-blue: #3b82f6;
    --bat-orange: #f59e0b;
    --bat-pink: #ec4899;
    --bat-red: #ef4444;
    --bat-green: #22c55e;
    --bat-radius: 16px;
    --bat-radius-sm: 10px;
    --bat-radius-lg: 24px;
    --bat-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bat-spring: cubic-bezier(0.22, 1, 0.36, 1);
    --bat-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --bat-glass: rgba(255, 255, 255, 0.03);
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE (standalone mode)
   ═══════════════════════════════════════════════════════════════ */

/* body styles moved to v6 section below */

/* ═══════════════════════════════════════════════════════════════
   APP WRAPPER
   ═══════════════════════════════════════════════════════════════ */

.bat-app {
    position: relative;
    min-height: 100vh;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATED BACKGROUND
   ═══════════════════════════════════════════════════════════════ */

.bat-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bat-grid-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0.6;
}

.bat-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: bat-orb-float 20s ease-in-out infinite;
}

.bat-bg-orb--1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--bat-accent) 0%, transparent 70%);
    top: -200px; right: -100px;
    animation-delay: 0s;
}

.bat-bg-orb--2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, var(--bat-purple) 0%, transparent 70%);
    bottom: -150px; left: -100px;
    animation-delay: -7s;
}

.bat-bg-orb--3 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, var(--bat-blue) 0%, transparent 70%);
    top: 40%; left: 50%;
    transform: translateX(-50%);
    animation-delay: -14s;
}

@keyframes bat-orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(30px, -20px) scale(1.05); }
    50%      { transform: translate(-20px, 30px) scale(0.95); }
    75%      { transform: translate(20px, 20px) scale(1.02); }
}

/* ═══════════════════════════════════════════════════════════════
   CONTAINER
   ═══════════════════════════════════════════════════════════════ */

.bat-container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(20px, 4vw, 60px) clamp(16px, 3vw, 40px);
}

/* ═══════════════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════════════ */

.bat-page-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 32px;
    animation: bat-fade-in-up 0.6s var(--bat-spring) both;
}

.bat-page-header__icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bat-bg-card);
    border: 1px solid var(--bat-border);
    border-radius: var(--bat-radius);
    backdrop-filter: blur(16px);
    box-shadow: 0 0 30px rgba(var(--bat-accent-rgb), 0.1);
}

.bat-page-header__title {
    font-size: clamp(22px, 3.5vw, 32px);
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #fff 30%, var(--bat-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.bat-page-header__sub {
    font-size: 13px;
    color: var(--bat-text-muted);
    font-weight: 400;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   DEVICE STATUS BAR
   ═══════════════════════════════════════════════════════════════ */

.bat-device-bar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 10px 20px;
    background: var(--bat-bg-card);
    border: 1px solid var(--bat-border);
    border-radius: var(--bat-radius);
    backdrop-filter: blur(20px);
    margin-bottom: 32px;
    overflow-x: auto;
    animation: bat-fade-in-up 0.6s var(--bat-spring) 0.1s both;
}

.bat-device-bar__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.bat-device-bar__item svg {
    color: var(--bat-text-muted);
    flex-shrink: 0;
}

.bat-device-bar__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--bat-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bat-device-bar__value {
    font-size: 12px;
    font-weight: 600;
    color: var(--bat-text-secondary);
    font-variant-numeric: tabular-nums;
}

.bat-device-bar__value--accent {
    color: var(--bat-accent);
}

.bat-device-bar__sep {
    width: 1px;
    height: 20px;
    background: var(--bat-border);
    flex-shrink: 0;
    margin: 0 4px;
}

.bat-device-bar__item--ai {
    position: relative;
}

.bat-ai-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bat-accent);
    box-shadow: 0 0 8px rgba(var(--bat-accent-rgb), 0.5);
    animation: bat-pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes bat-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.8); }
}

/* ═══════════════════════════════════════════════════════════════
   INPUT SECTION
   ═══════════════════════════════════════════════════════════════ */

.bat-input-section {
    margin-bottom: 32px;
    animation: bat-fade-in-up 0.6s var(--bat-spring) 0.2s both;
}

.bat-input-card {
    position: relative;
    background: var(--bat-bg-card);
    border: 1px solid var(--bat-border);
    border-radius: var(--bat-radius-lg);
    padding: clamp(20px, 3vw, 32px);
    backdrop-filter: blur(24px);
    overflow: hidden;
    transition: border-color var(--bat-transition);
}

.bat-input-card:hover {
    border-color: var(--bat-border-light);
}

.bat-input-card__glow {
    position: absolute;
    top: -1px; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--bat-accent), var(--bat-purple), transparent);
    opacity: 0.6;
}

/* Tabs */
.bat-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--bat-radius-sm);
    padding: 4px;
}

.bat-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: none;
    color: var(--bat-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all var(--bat-transition);
    font-family: inherit;
}

.bat-tab:hover {
    color: var(--bat-text-secondary);
    background: rgba(255, 255, 255, 0.04);
}

.bat-tab--active {
    color: var(--bat-accent);
    background: var(--bat-accent-dim);
    box-shadow: 0 0 20px rgba(var(--bat-accent-rgb), 0.08) inset;
}

.bat-tab svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.bat-tab--active svg {
    opacity: 1;
    stroke: var(--bat-accent);
}

/* Tab Panels */
.bat-tab-panel {
    display: none;
}

.bat-tab-panel--active {
    display: block;
    animation: bat-fade-in 0.3s ease;
}

@keyframes bat-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bat-fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Magnet Input */
.bat-magnet-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--bat-border);
    border-radius: var(--bat-radius-sm);
    padding: 4px 4px 4px 16px;
    transition: border-color var(--bat-transition), box-shadow var(--bat-transition);
}

.bat-magnet-input-wrap:focus-within {
    border-color: rgba(var(--bat-accent-rgb), 0.3);
    box-shadow: 0 0 0 3px rgba(var(--bat-accent-rgb), 0.08), 0 0 20px rgba(var(--bat-accent-rgb), 0.06);
}

.bat-magnet-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.bat-magnet-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--bat-text);
    font-size: 14px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace, 'Inter', sans-serif;
    padding: 12px 0;
    outline: none;
    min-width: 0;
}

.bat-magnet-input::placeholder {
    color: var(--bat-text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
}

.bat-paste-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--bat-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--bat-text-muted);
    cursor: pointer;
    transition: all var(--bat-transition);
    flex-shrink: 0;
}

.bat-paste-btn:hover {
    color: var(--bat-accent);
    border-color: rgba(var(--bat-accent-rgb), 0.3);
    background: var(--bat-accent-dim);
}

/* Drop Zone */
.bat-drop-zone {
    position: relative;
    border: 2px dashed var(--bat-border-light);
    border-radius: var(--bat-radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--bat-transition);
}

.bat-drop-zone:hover,
.bat-drop-zone--active {
    border-color: rgba(var(--bat-accent-rgb), 0.4);
    background: rgba(var(--bat-accent-rgb), 0.03);
}

.bat-drop-zone__content {
    pointer-events: none;
}

.bat-drop-zone__icon {
    margin-bottom: 12px;
    opacity: 0.6;
}

.bat-drop-zone__text {
    font-size: 15px;
    color: var(--bat-text-secondary);
    margin-bottom: 4px;
}

.bat-drop-zone__sub {
    font-size: 12px;
    color: var(--bat-text-muted);
}

.bat-drop-zone__input {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Start Button */
.bat-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 32px;
    margin-top: 20px;
    border: none;
    border-radius: var(--bat-radius-sm);
    background: linear-gradient(135deg, var(--bat-accent), #00b894);
    color: #050816;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--bat-transition);
    position: relative;
    overflow: hidden;
}

.bat-start-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s;
}

.bat-start-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(var(--bat-accent-rgb), 0.3);
}

.bat-start-btn:not(:disabled):hover::before {
    left: 100%;
}

.bat-start-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    filter: saturate(0.5);
}

.bat-start-btn__loader {
    display: none;
}

.bat-start-btn--loading .bat-start-btn__text { display: none; }
.bat-start-btn--loading .bat-start-btn__icon { display: none; }
.bat-start-btn--loading .bat-start-btn__loader { display: flex; align-items: center; gap: 8px; }

.bat-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(5, 8, 22, 0.2);
    border-top-color: #050816;
    border-radius: 50%;
    animation: bat-spin 0.6s linear infinite;
}

@keyframes bat-spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════
   SECTION HEADER
   ═══════════════════════════════════════════════════════════════ */

.bat-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.bat-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--bat-text);
    letter-spacing: -0.02em;
}

.bat-download-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--bat-accent);
    background: var(--bat-accent-dim);
    padding: 4px 12px;
    border-radius: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   DOWNLOAD CARDS
   ═══════════════════════════════════════════════════════════════ */

.bat-downloads-section {
    margin-bottom: 32px;
    animation: bat-fade-in-up 0.5s var(--bat-spring) both;
}

.bat-downloads-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bat-dl-card {
    background: var(--bat-bg-card);
    border: 1px solid var(--bat-border);
    border-radius: var(--bat-radius);
    padding: 20px;
    backdrop-filter: blur(16px);
    transition: all var(--bat-transition);
    animation: bat-card-in 0.4s var(--bat-spring) both;
}

@keyframes bat-card-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.bat-dl-card:hover {
    border-color: var(--bat-border-light);
    background: var(--bat-bg-card-hover);
}

.bat-dl-card--done {
    border-color: rgba(var(--bat-accent-rgb), 0.2);
    background: rgba(0, 212, 170, 0.03);
}

.bat-dl-card--removing {
    opacity: 0;
    transform: translateX(-30px) scale(0.95);
    transition: all 0.3s ease;
}

.bat-dl-card__header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.bat-dl-card__icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bat-accent-dim);
    border-radius: var(--bat-radius-sm);
    border: 1px solid rgba(var(--bat-accent-rgb), 0.1);
}

.bat-dl-card__info {
    flex: 1;
    min-width: 0;
}

.bat-dl-card__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--bat-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.bat-dl-card__size {
    font-size: 12px;
    color: var(--bat-text-muted);
    font-weight: 500;
}

.bat-dl-card__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.bat-dl-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--bat-border);
    background: var(--bat-glass);
    color: var(--bat-text-muted);
    cursor: pointer;
    transition: all var(--bat-transition);
}

.bat-dl-card__btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--bat-text);
    border-color: var(--bat-border-light);
}

.bat-dl-card__btn--remove:hover {
    color: var(--bat-red);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

/* Progress Bar */
.bat-dl-card__progress-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.bat-dl-card__progress {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.bat-dl-card__progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--bat-accent), #00e6b8);
    border-radius: 3px;
    transition: width 0.5s ease;
    position: relative;
    z-index: 1;
}

.bat-dl-card__progress-glow {
    position: absolute;
    top: -2px;
    left: 0;
    height: 10px;
    width: 0%;
    background: linear-gradient(90deg, transparent, rgba(var(--bat-accent-rgb), 0.3));
    filter: blur(4px);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.bat-dl-card__percent {
    font-size: 13px;
    font-weight: 700;
    color: var(--bat-accent);
    min-width: 48px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Card Stats */
.bat-dl-card__stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.bat-dl-card__stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--bat-text-secondary);
    font-variant-numeric: tabular-nums;
}

.bat-dl-card__stat-icon {
    font-size: 14px;
    font-weight: 700;
    color: var(--bat-accent);
}

.bat-dl-card__stat-icon--up {
    color: var(--bat-purple);
}

.bat-dl-card__stat-label {
    color: var(--bat-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.05em;
}

/* File List in download card */
.bat-dl-files {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--bat-border);
}

.bat-dl-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 12px;
}

.bat-dl-file__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.bat-dl-file__name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--bat-text-secondary);
}

.bat-dl-file__size {
    flex-shrink: 0;
    color: var(--bat-text-muted);
    font-variant-numeric: tabular-nums;
}

.bat-dl-file--more {
    color: var(--bat-text-muted);
    font-style: italic;
    font-size: 11px;
}

/* ═══════════════════════════════════════════════════════════════
   ANALYTICS SECTION
   ═══════════════════════════════════════════════════════════════ */

.bat-analytics-section {
    margin-bottom: 32px;
    animation: bat-fade-in-up 0.5s var(--bat-spring) 0.1s both;
}

.bat-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
}

.bat-analytics-card {
    background: var(--bat-bg-card);
    border: 1px solid var(--bat-border);
    border-radius: var(--bat-radius);
    padding: 20px;
    backdrop-filter: blur(16px);
}

.bat-analytics-card__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--bat-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.bat-chart-canvas {
    width: 100%;
    max-height: 180px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
}

.bat-analytics-card__stats {
    display: flex;
    gap: 20px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--bat-border);
}

.bat-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bat-stat__icon {
    font-size: 15px;
    font-weight: 700;
}

.bat-stat__icon--down { color: var(--bat-accent); }
.bat-stat__icon--up   { color: var(--bat-purple); }

.bat-stat__label {
    font-size: 10px;
    font-weight: 600;
    color: var(--bat-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bat-stat__value {
    font-size: 13px;
    font-weight: 600;
    color: var(--bat-text-secondary);
    font-variant-numeric: tabular-nums;
}

.bat-stat__value--accent {
    color: var(--bat-accent);
}

/* ═══════════════════════════════════════════════════════════════
   COMPLETED SECTION
   ═══════════════════════════════════════════════════════════════ */

.bat-completed-section {
    margin-bottom: 32px;
    animation: bat-fade-in-up 0.5s var(--bat-spring) both;
}

.bat-completed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bat-completed-card {
    background: var(--bat-bg-card);
    border: 1px solid rgba(var(--bat-accent-rgb), 0.15);
    border-radius: var(--bat-radius);
    padding: 20px;
    backdrop-filter: blur(16px);
    animation: bat-card-in 0.4s var(--bat-spring) both;
}

.bat-completed-card__header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.bat-completed-card__check {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bat-accent-dim);
    border-radius: var(--bat-radius-sm);
    animation: bat-check-pop 0.5s var(--bat-spring) both;
}

@keyframes bat-check-pop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.bat-completed-card__info {
    flex: 1;
    min-width: 0;
}

.bat-completed-card__info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--bat-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bat-completed-card__meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--bat-text-muted);
    margin-top: 4px;
    flex-wrap: wrap;
}

.bat-completed-card__save-all {
    flex-shrink: 0;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid rgba(var(--bat-accent-rgb), 0.3);
    background: var(--bat-accent-dim);
    color: var(--bat-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--bat-transition);
    white-space: nowrap;
}

.bat-completed-card__save-all:hover {
    background: rgba(var(--bat-accent-rgb), 0.2);
    box-shadow: 0 0 20px rgba(var(--bat-accent-rgb), 0.15);
}

.bat-completed-card__files {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bat-completed-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 12px;
    border-top: 1px solid var(--bat-border);
}

.bat-completed-file:first-child {
    border-top: none;
}

.bat-completed-file__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.bat-completed-file__name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--bat-text-secondary);
}

.bat-completed-file__size {
    flex-shrink: 0;
    color: var(--bat-text-muted);
    font-variant-numeric: tabular-nums;
}

.bat-completed-file__save {
    flex-shrink: 0;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--bat-border);
    background: var(--bat-glass);
    color: var(--bat-text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--bat-transition);
}

.bat-completed-file__save:hover {
    color: var(--bat-accent);
    border-color: rgba(var(--bat-accent-rgb), 0.3);
    background: var(--bat-accent-dim);
}

.bat-completed-file--more {
    color: var(--bat-text-muted);
    font-style: italic;
    font-size: 11px;
    border-top: 1px solid var(--bat-border);
}

/* ═══════════════════════════════════════════════════════════════
   PAGE FOOTER
   ═══════════════════════════════════════════════════════════════ */

.bat-page-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--bat-border);
    text-align: center;
}

.bat-page-footer__text {
    font-size: 12px;
    color: var(--bat-text-muted);
}

.bat-page-footer__text a {
    color: var(--bat-accent);
    text-decoration: none;
    transition: color var(--bat-transition);
}

.bat-page-footer__text a:hover {
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .bat-device-bar {
        gap: 0;
        padding: 8px 12px;
        flex-wrap: nowrap;
    }

    .bat-device-bar__item {
        padding: 4px 8px;
    }

    .bat-device-bar__label {
        display: none;
    }

    .bat-dl-card__stats {
        gap: 12px;
    }

    .bat-analytics-grid {
        grid-template-columns: 1fr;
    }

    .bat-completed-card__header {
        flex-wrap: wrap;
    }

    .bat-completed-card__save-all {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .bat-page-header {
        flex-direction: column;
        text-align: center;
    }

    .bat-tabs {
        flex-direction: column;
    }

    .bat-dl-card__header {
        flex-wrap: wrap;
    }

    .bat-completed-card__meta {
        flex-direction: column;
        gap: 2px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR (Only applies within .bat-app)
   ═══════════════════════════════════════════════════════════════ */

.bat-app ::-webkit-scrollbar { width: 6px; height: 6px; }
.bat-app ::-webkit-scrollbar-track { background: transparent; }
.bat-app ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.bat-app ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.bat-app ::selection {
    background: rgba(var(--bat-accent-rgb), 0.25);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   CONNECTION BADGE (standalone mode)
   ═══════════════════════════════════════════════════════════════ */

.bat-connection-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bat-bg-card);
    border: 1px solid var(--bat-border);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--bat-text-muted);
    margin-left: auto;
    flex-shrink: 0;
    backdrop-filter: blur(16px);
    transition: all var(--bat-transition);
}

.bat-connection-badge--connected {
    border-color: rgba(var(--bat-accent-rgb), 0.3);
    color: var(--bat-accent);
}

.bat-connection-badge--error {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--bat-red);
}

.bat-connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bat-text-muted);
    flex-shrink: 0;
    transition: all var(--bat-transition);
}

.bat-connection-badge--connected .bat-connection-dot {
    background: var(--bat-accent);
    box-shadow: 0 0 8px rgba(var(--bat-accent-rgb), 0.5);
}

.bat-connection-badge--error .bat-connection-dot {
    background: var(--bat-red);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

@media (max-width: 768px) {
    .bat-connection-badge {
        position: absolute;
        top: 16px;
        right: 16px;
    }
    .bat-page-header {
        padding-right: 140px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v1.0 LIVE PIPE — STANDALONE LAYOUT
   ═══════════════════════════════════════════════════════════════ */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bat-bg);
    color: var(--bat-text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    line-height: 1.7;
    margin: 0;
    padding: 0;
}

*, *::before, *::after { box-sizing: border-box; }

.bat-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

.bat-app {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(16px, 4vw, 48px) clamp(16px, 3vw, 32px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.bat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    animation: bat-fade-in-up 0.5s var(--bat-spring) both;
}

.bat-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bat-logo h1 {
    font-size: clamp(18px, 3vw, 26px);
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #fff 30%, var(--bat-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.2;
}

.bat-version {
    font-size: 11px;
    color: var(--bat-text-muted);
    font-weight: 500;
}

.bat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--bat-border);
    backdrop-filter: blur(16px);
    flex-shrink: 0;
    transition: all var(--bat-transition);
}

.bat-badge--ok {
    color: var(--bat-accent);
    border-color: rgba(var(--bat-accent-rgb), 0.3);
    background: var(--bat-accent-dim);
}

.bat-badge--err {
    color: var(--bat-red);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

/* Hero Section */
.bat-hero {
    margin-bottom: 28px;
    animation: bat-fade-in-up 0.5s var(--bat-spring) 0.05s both;
}

.bat-hero-inner {
    background: var(--bat-bg-card);
    border: 1px solid var(--bat-border);
    border-radius: var(--bat-radius);
    padding: 20px 24px;
    backdrop-filter: blur(20px);
}

.bat-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--bat-accent);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

.bat-hero-desc {
    margin: 0;
    font-size: 13px;
    color: var(--bat-text-muted);
    line-height: 1.6;
}

/* Main */
.bat-main { flex: 1; }

/* Input Section */
.bat-input-section {
    background: var(--bat-bg-card);
    border: 1px solid var(--bat-border);
    border-radius: var(--bat-radius-lg);
    padding: clamp(16px, 3vw, 28px);
    backdrop-filter: blur(24px);
    margin-bottom: 32px;
    animation: bat-fade-in-up 0.5s var(--bat-spring) 0.1s both;
}

.bat-input-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--bat-radius-sm);
    padding: 4px;
}

.bat-magnet-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--bat-border);
    border-radius: var(--bat-radius-sm);
    padding: 4px 4px 4px 14px;
    transition: border-color var(--bat-transition), box-shadow var(--bat-transition);
}

.bat-magnet-row:focus-within {
    border-color: rgba(var(--bat-accent-rgb), 0.3);
    box-shadow: 0 0 0 3px rgba(var(--bat-accent-rgb), 0.08);
}

.bat-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--bat-text);
    font-size: 14px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace, 'Inter', sans-serif;
    padding: 12px 0;
    outline: none;
    min-width: 0;
}

.bat-input::placeholder {
    color: var(--bat-text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
}

.bat-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--bat-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--bat-text-muted);
    cursor: pointer;
    transition: all var(--bat-transition);
    flex-shrink: 0;
}

.bat-icon-btn:hover {
    color: var(--bat-accent);
    border-color: rgba(var(--bat-accent-rgb), 0.3);
    background: var(--bat-accent-dim);
}

/* Results */
.bat-results-section {
    animation: bat-fade-in-up 0.4s var(--bat-spring) both;
}

.bat-results-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--bat-text);
}

.bat-results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Torrent Card */
.bat-torrent-card {
    background: var(--bat-bg-card);
    border: 1px solid var(--bat-border);
    border-radius: var(--bat-radius);
    padding: 20px;
    backdrop-filter: blur(16px);
    animation: bat-card-in 0.4s var(--bat-spring) both;
    transition: border-color var(--bat-transition);
}

.bat-torrent-card:hover {
    border-color: var(--bat-border-light);
}

.bat-torrent-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 10px;
}

.bat-torrent-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bat-accent-dim);
    border-radius: var(--bat-radius-sm);
    border: 1px solid rgba(var(--bat-accent-rgb), 0.1);
}

.bat-torrent-meta {
    flex: 1;
    min-width: 0;
}

.bat-torrent-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--bat-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.bat-torrent-stats {
    font-size: 12px;
    color: var(--bat-text-muted);
    margin-top: 3px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.bat-sep { opacity: 0.4; }

.bat-torrent-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.bat-download-all-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(var(--bat-accent-rgb), 0.4);
    background: var(--bat-accent-dim);
    color: var(--bat-accent);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.bat-download-all-btn:hover {
    background: rgba(var(--bat-accent-rgb), 0.2);
    box-shadow: 0 0 14px rgba(var(--bat-accent-rgb), 0.2);
    transform: translateY(-1px);
}

.bat-remove-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--bat-border);
    background: var(--bat-glass);
    color: var(--bat-text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: all var(--bat-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bat-remove-btn:hover {
    color: var(--bat-red);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

.bat-torrent-hint {
    font-size: 12px;
    color: var(--bat-text-muted);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(var(--bat-accent-rgb), 0.04);
    border-radius: 8px;
    border: 1px solid rgba(var(--bat-accent-rgb), 0.08);
}

/* File rows */
.bat-torrent-files {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bat-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--bat-border);
}

.bat-file-row:first-child { border-top: none; }

.bat-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.bat-file-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.bat-file-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    color: var(--bat-text-secondary);
}

.bat-file-size {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--bat-text-muted);
    font-variant-numeric: tabular-nums;
}

.bat-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(var(--bat-accent-rgb), 0.4);
    background: linear-gradient(135deg, rgba(var(--bat-accent-rgb), 0.15), rgba(var(--bat-accent-rgb), 0.05));
    color: var(--bat-accent);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.bat-download-btn:hover {
    background: linear-gradient(135deg, rgba(var(--bat-accent-rgb), 0.3), rgba(var(--bat-accent-rgb), 0.1));
    border-color: var(--bat-accent);
    box-shadow: 0 0 12px rgba(var(--bat-accent-rgb), 0.3);
    transform: translateY(-1px);
    color: var(--bat-accent);
}

.bat-download-btn--active {
    background: linear-gradient(135deg, rgba(var(--bat-accent-rgb), 0.25), rgba(var(--bat-accent-rgb), 0.1));
    animation: bat-pulse 1s ease-in-out infinite;
}

/* Error card */
.bat-error-card {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--bat-radius);
    padding: 16px 20px;
    color: var(--bat-red);
    font-size: 14px;
}

/* Footer */
.bat-footer {
    margin-top: auto;
    padding-top: 32px;
    text-align: center;
    font-size: 12px;
    color: var(--bat-text-muted);
}

/* Loading spinner on start button */
.bat-start-btn--loading {
    opacity: 0.7;
    pointer-events: none;
}

.bat-start-btn--loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(5, 8, 22, 0.2);
    border-top-color: #050816;
    border-radius: 50%;
    animation: bat-spin 0.6s linear infinite;
    margin-left: 8px;
}

/* ═══ v1.0 On-Demand Relay — File List ═══ */
.bat-dl-card__files-list {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,212,170,0.3) transparent;
}

.bat-file-row__icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.bat-file-row__name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    color: var(--bat-text-secondary, #b0b8c8);
}

.bat-file-row__size {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--bat-text-muted, #64748b);
    font-variant-numeric: tabular-nums;
}

.bat-file-row__save {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(0, 212, 170, 0.4);
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.15), rgba(0, 212, 170, 0.05));
    color: #00d4aa;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.bat-file-row__save:hover {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.3), rgba(0, 212, 170, 0.1));
    border-color: #00d4aa;
    box-shadow: 0 0 12px rgba(0, 212, 170, 0.3);
    transform: translateY(-1px);
}

.bat-file-row__save:disabled {
    opacity: 0.6;
    pointer-events: none;
}

.bat-file-row__save--active {
    animation: bat-pulse 1s ease-in-out infinite;
}

.bat-file-row__save--done {
    border-color: rgba(0, 212, 170, 0.6);
    background: rgba(0, 212, 170, 0.2);
}

.bat-file-row--more {
    font-size: 12px;
    color: var(--bat-text-muted, #64748b);
    justify-content: center;
    padding: 8px 0;
}

.bat-file-row--actions {
    justify-content: flex-end;
    padding-top: 12px;
    border-top: none;
}

.bat-dl-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    color: #8b5cf6;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.bat-dl-all-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(139, 92, 246, 0.1));
    border-color: #8b5cf6;
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
}

.bat-dl-card__peers {
    font-size: 12px;
    color: var(--bat-text-muted, #64748b);
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.bat-dl-card__status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
}

.bat-dl-card__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    flex-shrink: 0;
}

.bat-dl-card__status-text {
    color: var(--bat-text-secondary, #b0b8c8);
}

.bat-spinner-sm {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(0, 212, 170, 0.3);
    border-top-color: #00d4aa;
    border-radius: 50%;
    animation: bat-spin 0.6s linear infinite;
}

.bat-dl-card--removing {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 600px) {
    .bat-header { flex-direction: column; gap: 12px; text-align: center; }
    .bat-torrent-header { flex-direction: column; }
    .bat-torrent-actions { width: 100%; justify-content: flex-end; }
    .bat-file-row { flex-direction: column; align-items: stretch; gap: 8px; }
    .bat-file-row__save { align-self: stretch; justify-content: center; }
    .bat-download-btn { align-self: stretch; justify-content: center; }
    .bat-input-tabs { flex-direction: column; }
}
