:root {
    --bg-darker: #f4f3f9;
    --bg-dark: #ebe9f3;
    --bg-card: #ffffff;
    --border-card: rgba(139, 92, 246, 0.12);
    --border-glow: rgba(139, 92, 246, 0.25);
    
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.15);
    --primary-light: #6d28d9;
    --secondary: #6366f1;
    --secondary-glow: rgba(99, 102, 241, 0.15);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.1);
    
    --text-main: #111827;
    --text-muted: #374151;
    --text-dim: #6b7280;

    --font-display: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-smooth: all 0.2s ease;

    /* Dynamic Variables for Theme Support */
    --bg-input: rgba(139, 92, 246, 0.05);
    --bg-overlay: rgba(243, 244, 246, 0.5);
    --bg-modal: #ffffff;
    --bg-modal-footer: rgba(139, 92, 246, 0.02);
    --bg-toast: #ffffff;
    --bg-glow-opacity: 0;

    /* Shadows (Flat Layout for Light Mode Default) */
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --modal-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: none;
    --btn-shadow: none;
    --btn-hover-shadow: none;
}

body.dark-mode {
    --bg-darker: #050409;
    --bg-dark: #0c0a17;
    --bg-card: #13111c;
    --border-card: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(139, 92, 246, 0.15);
    
    --primary-glow: rgba(139, 92, 246, 0.2);
    --primary-light: #a78bfa;
    --secondary-glow: rgba(99, 102, 241, 0.2);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    --bg-input: rgba(0, 0, 0, 0.2);
    --bg-overlay: rgba(5, 4, 9, 0.6);
    --bg-modal: #161327;
    --bg-modal-footer: rgba(0, 0, 0, 0.1);
    --bg-toast: #161327;
    --bg-glow-opacity: 0;

    /* Shadows */
    --box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --modal-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

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

/* Background dynamic glow shapes */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background-color: var(--bg-dark);
    display: none; /* Disabled for layout speed */
}

.glow-bg .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: var(--bg-glow-opacity);
}

.glow-bg .shape-1 {
    top: -10%;
    left: 10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--primary) 0%, rgba(0,0,0,0) 70%);
    transform: translate3d(0,0,0);
}

.glow-bg .shape-2 {
    bottom: -10%;
    right: 5%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--secondary) 0%, rgba(0,0,0,0) 70%);
    transform: translate3d(0,0,0);
}

.glow-bg .shape-3 {
    top: 30%;
    right: 30%;
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, #ec4899 0%, rgba(0,0,0,0) 75%);
    opacity: 0.08;
    transform: translate3d(0,0,0);
}

@keyframes floatShape {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(8%, 10%) scale(1.1); }
}

/* APP CONTAINER */
.app-container {
    width: 100%;
    max-width: 1200px;
    min-height: 100vh;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
        gap: 1rem;
    }
}

/* HEADER */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 20px;
    box-shadow: var(--box-shadow);
}

@media (max-width: 600px) {
    .app-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem;
        align-items: flex-start;
    }
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

.brand h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #111827, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    border-radius: 50px;
}

@media (max-width: 600px) {
    .user-profile {
        width: 100%;
    }
}

.device-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-light);
    flex-shrink: 0;
}

.device-avatar.large {
    width: 64px;
    height: 64px;
    background: rgba(139, 92, 246, 0.15);
    border: 2px solid var(--primary);
    color: var(--primary-light);
}

.device-info {
    display: flex;
    flex-direction: column;
}

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

.device-name {
    font-weight: 600;
    font-size: 0.95rem;
}

/* MAIN LAYOUT */
.app-main {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
    flex-grow: 1;
}

@media (max-width: 900px) {
    .app-main {
        grid-template-columns: 1fr;
    }
}

/* PANELS */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    box-shadow: var(--box-shadow);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: var(--transition-smooth);
}

.panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 600px) {
    .panel {
        padding: 1.25rem;
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
}

.panel-header h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
}

.panel-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* LEFT PANEL SPECIFICS */
.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.015);
    border: 1px dashed var(--border-card);
    border-radius: 20px;
}

.qr-box {
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.qr-image.loading {
    opacity: 0;
}

.qr-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(12, 10, 23, 0.8);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.url-copy-box {
    display: flex;
    width: 100%;
    gap: 0.5rem;
}

.url-copy-box input {
    flex-grow: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--primary-light);
    font-family: monospace;
    font-size: 0.85rem;
    outline: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.peer-action-btn {
    width: 100%;
    margin-top: 0.5rem;
    background: rgba(139, 92, 246, 0.08);
    border-color: var(--border-glow);
    color: var(--primary-light);
    pointer-events: none; /* Let clicks pass through to the parent card */
}

.peer-card:hover .peer-action-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: white;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0 !important; /* Prevent icon squeezing from button padding */
    background: rgba(139, 92, 246, 0.06);
    border-color: rgba(139, 92, 246, 0.15);
    color: var(--primary-light);
}

.btn-icon:hover {
    background: rgba(139, 92, 246, 0.12) !important;
    border-color: var(--primary) !important;
    color: var(--primary-light) !important;
}

body.dark-mode .btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-card);
    color: var(--text-main);
}

body.dark-mode .btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-card);
    color: var(--text-main);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-light);
    border-color: var(--primary);
}

.btn-icon:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--btn-shadow);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: var(--btn-hover-shadow);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-card);
    color: var(--text-main);
}

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

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: var(--danger);
}

.btn-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--success);
}

.btn-wide {
    width: 100%;
    padding: 0.85rem 1.5rem;
}

.btn-half {
    width: 48%;
    padding: 0.85rem;
}

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

.instruction-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid var(--border-glow);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-light);
    flex-shrink: 0;
}

.instruction-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* RIGHT PANEL SPECIFICS */
.peer-count-badge {
    align-self: flex-start;
    padding: 0.25rem 0.75rem;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid var(--border-glow);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-light);
}

.peers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    flex-grow: 1;
    min-height: 250px;
}

@media (max-width: 600px) {
    .peers-grid {
        grid-template-columns: 1fr;
    }
}

/* Peer card */
.peer-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.peer-card:hover {
    background: rgba(139, 92, 246, 0.04);
    border-color: var(--primary);
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-4px);
}

.peer-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.peer-card:hover::after {
    transform: scaleX(1);
}

.peer-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    transition: var(--transition-smooth);
}

.peer-card:hover .peer-avatar {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.peer-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.peer-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
}

.peer-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.no-peers-card {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.pulse-radar {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem;
}

.radar-dot {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid var(--primary);
    color: var(--primary-light);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.ring {
    position: absolute;
    border: 1px solid var(--primary-glow);
    border-radius: 50%;
    opacity: 0;
    z-index: 1;
}

.ring-1 {
    width: 44px;
    height: 44px;
    animation: pulseRadar 3s infinite linear;
}

.ring-2 {
    width: 44px;
    height: 44px;
    animation: pulseRadar 3s infinite linear 1s;
}

.ring-3 {
    width: 44px;
    height: 44px;
    animation: pulseRadar 3s infinite linear 2s;
}

@keyframes pulseRadar {
    0% {
        width: 44px;
        height: 44px;
        opacity: 0.8;
    }
    100% {
        width: 140px;
        height: 140px;
        opacity: 0;
    }
}

.no-peers-card h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--text-main);
}

.no-peers-card p {
    font-size: 0.85rem;
    max-width: 320px;
    line-height: 1.5;
}

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-overlay);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 1.5rem;
}

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

.modal-card {
    background: var(--bg-modal);
    border: 1px solid var(--border-card);
    border-radius: 28px;
    width: calc(100% - 2rem);
    max-width: 480px;
    box-shadow: var(--modal-shadow);
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    max-height: 88vh;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-card);
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
}

.highlight-text {
    background: linear-gradient(to right, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 0.5;
    transition: var(--transition-smooth);
}

.btn-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border-card);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--bg-modal-footer);
}

.modal-footer.flex-center {
    justify-content: space-between;
}

/* Drag and Drop Zone */
.drop-zone {
    width: 100%;
    height: 180px;
    border: 2px dashed var(--border-card);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    transition: var(--transition-smooth);
    position: relative;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.03);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.05);
}

.file-input-hidden {
    display: none;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.upload-icon-container {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    transition: var(--transition-smooth);
}

.drop-zone:hover .upload-icon-container {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary-light);
    transform: translateY(-2px);
}

.drop-text-primary {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.drop-text-secondary {
    font-size: 0.8rem;
}

.selected-file-details {
    margin-top: 1.25rem;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid var(--border-glow);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: rgba(139, 92, 246, 0.15);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-light);
}

.file-icon.large {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    margin: 0 auto;
}

.file-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
}

.file-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

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

/* TRANSFER PROGRESS CARD */
.transfer-card {
    max-width: 400px;
}

.text-center {
    text-align: center;
}

.transfer-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    margin-bottom: 1.75rem;
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.progress-bar-wrapper {
    flex-grow: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 10px;
    box-shadow: 0 0 10px var(--primary-glow);
    transition: width 0.1s linear;
}

.progress-percentage {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary-light);
    min-width: 40px;
    text-align: right;
}

.transfer-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.stat-box {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-val {
    font-size: 0.85rem;
    font-weight: 600;
}

/* PROMPT CARD */
.prompt-card {
    max-width: 400px;
}

.incoming-avatar-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.incoming-pulse {
    position: absolute;
    width: 64px;
    height: 64px;
    border: 2px solid var(--primary-glow);
    border-radius: 50%;
    animation: ping 2s infinite ease-in-out;
}

@keyframes ping {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

.incoming-prompt-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.incoming-file-info {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: 18px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.file-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    overflow: hidden;
}

/* TOAST NOTIFICATION System */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 320px;
    width: 100%;
}

.toast {
    background: var(--bg-toast);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    transform: translateY(20px);
    opacity: 0;
    animation: toastIn 0.3s forwards cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

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

.toast.removing {
    animation: toastOut 0.3s forwards ease-in;
}

@keyframes toastOut {
    to { transform: translateX(100px); opacity: 0; }
}

.toast-icon {
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success); }
.toast-danger .toast-icon { color: var(--danger); }
.toast-info .toast-icon { color: var(--primary-light); }

.toast-msg {
    font-size: 0.85rem;
    font-weight: 500;
}

/* FOOTER */
.app-footer {
    text-align: center;
    padding: 1rem 0;
    color: var(--text-dim);
    font-size: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
}

/* Theme Toggle Actions */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle-btn {
    width: 42px;
    height: 42px;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-card) !important;
    color: var(--text-main) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 0 !important;
}

.theme-toggle-btn:hover {
    background: rgba(139, 92, 246, 0.1) !important;
    border-color: var(--primary) !important;
    color: var(--primary-light) !important;
}

.sun-icon {
    display: none !important;
}

.moon-icon {
    display: block !important;
}

body.dark-mode .sun-icon {
    display: block !important;
}

body.dark-mode .moon-icon {
    display: none !important;
}

body.dark-mode .brand h1 {
    background: linear-gradient(to right, var(--primary), #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.qr-placeholder {
    background: rgba(243, 244, 246, 0.95);
}

body.dark-mode .qr-placeholder {
    background: rgba(12, 10, 23, 0.8);
}

/* Card-level Drag and Drop indicator */
.peer-card.dragover {
    background: rgba(139, 92, 246, 0.08) !important;
    border-color: var(--primary) !important;
    box-shadow: var(--card-hover-shadow) !important;
    transform: translateY(-4px) !important;
}

/* Quick Share Text Panel styles */
.text-share-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.text-share-header h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}

.text-share-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.text-share-body textarea {
    width: 100%;
    height: 90px;
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.85rem;
    resize: none;
    outline: none;
    transition: var(--transition-smooth);
}

.text-share-body textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

/* Text Receive Modal styles */
.text-receive-card {
    max-width: 450px !important;
}

.text-receive-card textarea {
    width: 100%;
    height: 180px;
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    resize: none;
    outline: none;
    line-height: 1.5;
    margin-top: 0.5rem;
}

/* Transfer Warning Banner */
.transfer-warning-banner {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1.25rem;
    color: #f59e0b;
    font-size: 0.75rem;
    text-align: left;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

body.light-mode .transfer-warning-banner {
    background: rgba(217, 119, 6, 0.05);
    border-color: rgba(217, 119, 6, 0.25);
    color: #b45309;
}

/* Multi-device progress items stack */
.progress-list-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    margin: 1rem 0;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.progress-list-container::-webkit-scrollbar {
    width: 4px;
}

.progress-list-container::-webkit-scrollbar-thumb {
    background: var(--border-card);
    border-radius: 2px;
}

.peer-progress-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

body.light-mode .peer-progress-item {
    background: rgba(139, 92, 246, 0.02);
}

.peer-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
}

.peer-progress-name {
    color: var(--text-main);
}

.peer-progress-status {
    color: var(--primary-light);
}

.batch-option-card {
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 1.25rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    transition: all 0.2s ease;
}

.batch-option-card:hover {
    border-color: var(--primary-light);
    background: rgba(139, 92, 246, 0.03);
}

.batch-option-card.active {
    border: 2px solid var(--primary) !important;
    background: var(--bg-input) !important;
}

/* Global Viewport Drag and Drop Overlay */
.drag-drop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(139, 92, 246, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    border: 4px dashed var(--primary);
    margin: 0;
    box-sizing: border-box;
}

.drag-drop-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drag-drop-overlay-content {
    text-align: center;
    color: var(--primary-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.drag-drop-overlay-content h2 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-main);
}

.drag-drop-overlay-content p {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
}
