:root {
    --bg-dark: #0d1117;
    --bg-card: rgba(22, 27, 34, 0.75);
    --bg-card-border: rgba(226, 106, 87, 0.18);
    --primary: #e26a57;
    --primary-hover: #d55945;
    --primary-glow: rgba(226, 106, 87, 0.4);
    --accent-gold: #df9b42;
    --accent-lime: #b6cd3b;
    --success: #b6cd3b;
    --success-hover: #a1b72e;
    --success-glow: rgba(182, 205, 59, 0.4);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #21262d;
    --radius-lg: 16px;
    --radius-md: 10px;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 20px;
}

/* Background animated glow tuned to logo colors - enlarged & smooth fade-out */
.background-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 950px;
    height: 950px;
    background: radial-gradient(
        circle,
        rgba(226, 106, 87, 0.25) 0%,
        rgba(223, 155, 66, 0.15) 30%,
        rgba(182, 205, 59, 0.07) 55%,
        rgba(13, 17, 23, 0) 75%
    );
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: glow-pulse 6s infinite ease-in-out;
    filter: blur(20px);
}

@keyframes glow-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.85;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.25);
        opacity: 0.45;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.85;
    }
}

.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 580px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.app-header {
    text-align: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-main);
}

.logo-img {
    height: 46px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 10px rgba(226, 106, 87, 0.35));
}

.logo strong {
    font-weight: 700;
    background: linear-gradient(135deg, #e26a57 0%, #df9b42 50%, #b6cd3b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    margin-top: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Cards (Glassmorphism with warm logo border accent) */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

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

/* Drop Zone */
.drop-zone {
    border: 2px dashed rgba(226, 106, 87, 0.3);
    border-radius: var(--radius-md);
    padding: 36px 20px;
    text-align: center;
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(226, 106, 87, 0.06);
    box-shadow: 0 0 24px var(--primary-glow);
}

.file-input {
    display: none;
}

.upload-icon {
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

.drop-zone h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.drop-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}

/* Buttons tuned to logo palette */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #e26a57, #df9b42);
    color: #ffffff;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #d55945, #cf8b32);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(226, 106, 87, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: linear-gradient(135deg, #df9b42, #b6cd3b);
    color: #0d1117;
    font-weight: 700;
    box-shadow: 0 4px 16px var(--success-glow);
}

.btn-success:hover {
    background: linear-gradient(135deg, #cf8b32, #a1b72e);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(182, 205, 59, 0.5);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.btn-lg {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
}

/* File Info Header */
.file-info-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.file-badge-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(226, 106, 87, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-meta {
    flex-grow: 1;
    overflow: hidden;
}

.truncate-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.badge {
    display: inline-block;
    background: rgba(223, 155, 66, 0.15);
    color: var(--accent-gold);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: 4px;
}

/* Share Box */
.share-box {
    margin-top: 20px;
}

.share-box label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group input {
    flex-grow: 1;
    background: rgba(13, 17, 23, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-main);
    font-family: monospace;
    font-size: 0.9rem;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.notice {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
    line-height: 1.4;
}

/* Active Transfers Section */
.transfer-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.transfer-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.transfer-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 16px;
    background: rgba(13, 17, 23, 0.4);
    border-radius: var(--radius-md);
}

.peer-transfer-item {
    background: rgba(13, 17, 23, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
}

.peer-transfer-item .peer-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

/* Receiver Status Box */
.receiver-status-box {
    text-align: center;
    padding: 10px 0;
}

.status-indicator-ring {
    width: 84px;
    height: 84px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(226, 106, 87, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.status-indicator-ring.pulse {
    animation: ring-pulse 2.2s infinite ease-out;
}

.status-indicator-ring.connected {
    background: rgba(182, 205, 59, 0.18);
    color: var(--accent-lime);
    animation: none;
}

@keyframes ring-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(226, 106, 87, 0.6);
        transform: scale(0.95);
    }
    70% {
        box-shadow: 0 0 0 40px rgba(226, 106, 87, 0);
        transform: scale(1.08);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(226, 106, 87, 0);
        transform: scale(0.95);
    }
}

.status-detail {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Progress Bar with Logo Gradient (Coral -> Gold -> Lime) */
.file-download-card {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.progress-wrapper {
    margin: 16px 0;
}

.progress-bar-bg {
    height: 12px;
    background: rgba(13, 17, 23, 0.8);
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #e26a57 0%, #df9b42 50%, #b6cd3b 100%);
    border-radius: 6px;
    transition: width 0.2s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.download-action-box {
    margin-top: 16px;
}

/* Footer */
.app-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.client-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
}

.client-badge code {
    font-family: monospace;
    color: var(--text-main);
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--accent-lime);
    border-radius: 50%;
}
