/* P2P File Transfer - Modern Professional Design */

:root {
    /* Professional Color Palette */
    --primary-color: #6366f1;        /* Modern indigo */
    --primary-hover: #5b21b6;        /* Purple hover */
    --primary-light: #e0e7ff;        /* Light indigo background */
    --success-color: #10b981;        /* Emerald green */
    --success-light: #d1fae5;        /* Light emerald */
    --warning-color: #f59e0b;        /* Amber */
    --warning-light: #fef3c7;        /* Light amber */
    --error-color: #ef4444;          /* Red */
    --error-light: #fee2e2;          /* Light red */

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Base Styles */
.p2p-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    font-family: var(--font-sans);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--primary-light) 100%);
    min-height: calc(100vh - 100px);
}

/* Header Section */
.p2p-container h1 {
    color: var(--gray-900);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.p2p-container .text-muted {
    color: var(--gray-600);
    font-size: 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

/* Alert Styles */
.alert {
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    font-weight: 500;
}

.alert-info {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--gray-800);
}

.alert-success {
    background: var(--success-light);
    border-color: var(--success-color);
    color: var(--gray-800);
}

.alert-warning {
    background: var(--warning-light);
    border-color: var(--warning-color);
    color: var(--gray-800);
}

.alert-danger {
    background: var(--error-light);
    border-color: var(--error-color);
    color: var(--gray-800);
}

/* File Drop Zone */
.file-drop-zone {
    background: white;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.file-drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.file-drop-zone:hover::before,
.file-drop-zone.dragover::before {
    opacity: 0.05;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.file-drop-zone * {
    position: relative;
    z-index: 1;
}

.file-drop-zone h4 {
    color: var(--gray-900);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
}

.file-drop-zone p {
    color: var(--gray-600);
    font-size: 1rem;
    margin: 0.5rem 0;
}

.file-drop-zone .text-muted.small {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.file-drop-zone.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.file-input {
    display: none;
}

/* File Info Section */
.file-info {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.file-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
}

.file-info h4 {
    margin: 0 0 1.5rem 0;
    color: var(--gray-900);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.file-info h4::before {
    content: '📁';
    font-size: 1.25rem;
}

.file-details {
    color: var(--gray-700);
    margin-bottom: 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

/* Professional Accept/Decline Button Section */
.file-info .text-center {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.file-info .btn {
    min-width: 140px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.file-info .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.file-info .btn:hover::before {
    left: 100%;
}

.file-info .btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    border: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transform: translateY(0);
}

.file-info .btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669, #047857);
}

.file-info .btn-secondary {
    background: linear-gradient(135deg, var(--gray-500), var(--gray-600));
    border: none;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
    margin-left: 1rem;
}

.file-info .btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
    background: linear-gradient(135deg, var(--gray-600), var(--gray-700));
}

.file-info .text-muted.small {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
    font-style: italic;
}

/* Connection Status */
.connection-status {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-icon.connecting {
    background: var(--warning-color);
    animation: pulse 2s infinite;
}

.status-icon.connected {
    background: var(--success-color);
    animation: none;
}

.status-icon.waiting {
    background: var(--primary-color);
    animation: pulse 2s infinite;
}

.status-icon.success {
    background: var(--success-color);
    animation: none;
}

.status-icon.error {
    background: var(--error-color);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.connection-status span {
    color: var(--gray-700);
    font-weight: 500;
    font-size: 1rem;
}

/* Share Link Container */
.share-link-container {
    background: white;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: var(--shadow-md);
}

/* File Info Header */
.file-info-header {
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.file-info-header h4 {
    color: var(--gray-900);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.file-details {
    color: var(--gray-600);
    font-size: 0.875rem;
    background: var(--gray-50);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.file-size {
    font-weight: 500;
}

/* Share Section */
.share-section {
    margin-bottom: 1rem;
}

.share-section h5 {
    color: var(--gray-800);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Grid Layout for Share & QR */
.share-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.share-link-box,
.qr-code-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.share-link-box h5,
.qr-code-box h5 {
    color: var(--gray-800);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

/* Left Box: Share Link */
.share-link-box .share-link {
    margin-bottom: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.share-link-box .share-link input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: white;
    font-size: 0.875rem;
    font-family: ui-monospace, 'Fira Code', monospace;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.share-buttons .copy-btn,
.share-buttons .btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Right Box: QR Code */
.qr-code-box {
    text-align: center;
    justify-content: space-between;
}

.qr-code-box .qr-code {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}

.qr-code-box button {
    margin-top: auto;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.share-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.share-link input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-family: ui-monospace, 'Fira Code', monospace;
    background: var(--gray-50);
    color: var(--gray-800);
    font-size: 0.875rem;
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
}

.copy-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.copy-btn.copied {
    background: var(--success-color);
}

.qr-code {
    text-align: center;
    margin-top: 1.5rem;
}

.qr-code canvas {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* Progress Container */
.progress-container {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.progress-container h4 {
    color: var(--gray-900);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.progress-bar-container {
    background: var(--gray-200);
    border-radius: var(--radius-lg);
    height: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    height: 100%;
    transition: width 0.3s ease;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Transfer Stats */
.transfer-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Transfer Summary */
.transfer-summary {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.transfer-summary .row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.transfer-summary .col-4 {
    text-align: center;
}

/* Professional Download Section */
.download-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--success-color);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    margin: 2rem 0;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.download-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color), var(--success-color));
    animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.download-section h4 {
    color: var(--gray-900);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.download-section h4::before {
    content: '✨';
    font-size: 1.5rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
}

.download-section p {
    font-size: 1.125rem;
    color: var(--gray-700);
    margin-bottom: 2rem;
    font-weight: 500;
}

/* Enhanced Download Button */
.download-btn {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    border: none;
    padding: 1.25rem 3rem;
    border-radius: var(--radius-xl);
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    min-width: 220px;
    justify-content: center;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.download-btn:hover::before {
    left: 100%;
}

.download-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.download-btn:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.download-btn:disabled {
    background: linear-gradient(135deg, var(--gray-400), var(--gray-500));
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 10px rgba(156, 163, 175, 0.3);
}

.download-btn svg {
    transition: transform 0.3s ease;
}

.download-btn:hover svg {
    transform: translateY(-2px);
}

/* Enhanced Transfer Summary in Download Section */
.download-section .transfer-summary {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.download-section .stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced Action Buttons Section */
.download-section .d-flex {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.download-section .btn-outline-primary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.1);
}

.download-section .btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* Professional Text Styling */
.download-section .text-muted {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--primary-color);
    margin-top: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

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

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-500);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
}

.btn-outline-secondary:hover {
    background: var(--gray-500);
    color: white;
    border-color: var(--gray-500);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Error Messages */
.error-message {
    background: var(--error-light);
    border: 1px solid var(--error-color);
    color: var(--gray-800);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.error-message h4 {
    margin: 0 0 1rem 0;
    color: var(--error-color);
    font-weight: 600;
}

.login-prompt {
    background: var(--warning-light);
    border: 1px solid var(--warning-color);
    color: var(--gray-800);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.login-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    display: inline-block;
    margin-top: 1rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.login-btn:hover {
    background: var(--primary-hover);
    text-decoration: none;
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Success Section */
.alert.alert-success {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border: 1px solid var(--success-color);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.alert.alert-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color), var(--success-color));
    animation: gradient-shift 3s ease-in-out infinite;
}

.alert.alert-success h4 {
    color: var(--gray-900);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.alert.alert-success .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.alert.alert-success .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.alert.alert-success .btn-primary:hover::before {
    left: 100%;
}

.alert.alert-success .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #4c1d95);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.4);
}

.alert.alert-success .transfer-summary {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.alert.alert-success .stat-value {
    font-size: 1.875rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--success-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.alert.alert-success .text-muted {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 1rem;
    background: var(--success-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--success-color);
    margin-top: 1.5rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }

.d-flex { display: flex; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; }

.small { font-size: 0.875rem; }

/* Responsive Design */
@media (max-width: 768px) {
    .p2p-container {
        padding: 0.75rem;
        margin: 0 0.5rem;
    }

    .p2p-container h1 {
        font-size: 1.75rem;
    }

    .file-drop-zone {
        padding: 1.5rem 1rem;
    }

    .progress-details {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .share-link {
        flex-direction: column;
        align-items: stretch;
    }

    .share-grid-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .share-link-box,
    .qr-code-box {
        min-height: auto;
        padding: 1rem;
    }

    .share-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .transfer-stats-compact {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        max-width: 300px;
    }

    .stat-item-compact {
        padding: 1rem 0.75rem;
    }

    /* Mobile responsive for progress section */
    .progress-in-grid {
        padding: 0.175rem;
        margin: 0.25rem 0;
    }

    .transfer-warning {
        padding: 0.625rem;
        gap: 0.375rem;
    }

    .transfer-warning p {
        font-size: 0.8rem;
    }

    .transfer-title {
        font-size: 1.125rem;
    }

    .progress-info {
        gap: 0.5rem;
    }

    .progress-stat {
        padding: 0.625rem 0.25rem;
    }

    .progress-value {
        font-size: 0.9rem;
    }

    .transfer-stats-simple {
        gap: 0.375rem;
    }

    .stat-simple {
        padding: 0.625rem 0.125rem;
    }

    .stat-simple .stat-value {
        font-size: 0.8rem;
    }

    .transfer-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .transfer-summary .row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .btn {
        justify-content: center;
        width: 100%;
    }

    .d-flex.gap-2 {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .transfer-stats {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .file-drop-zone h4 {
        font-size: 1.25rem;
    }

    .progress-container,
    .share-link-container,
    .download-section {
        padding: 1.5rem;
    }

    /* Ultra-mobile styles for very small screens */
    .progress-in-grid {
        padding: 0.75rem;
        margin: 0.125rem 0;
    }

    .transfer-warning {
        padding: 0.5rem;
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }

    .transfer-warning svg {
        width: 20px;
        height: 20px;
    }

    .transfer-warning p {
        font-size: 0.75rem;
    }

    .transfer-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .progress-info {
        flex-direction: column;
        gap: 0.375rem;
    }

    .progress-stat {
        padding: 0.5rem 0.25rem;
    }

    .progress-label {
        font-size: 0.7rem;
    }

    .progress-value {
        font-size: 0.85rem;
    }

    .transfer-stats-simple {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .stat-simple {
        padding: 0.5rem 0.25rem;
    }

    .stat-simple .stat-label {
        font-size: 0.65rem;
    }

    .stat-simple .stat-value {
        font-size: 0.75rem;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .p2p-container {
        background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    }

    .file-drop-zone,
    .file-info,
    .connection-status,
    .share-link-container,
    .progress-container,
    .download-section,
    .stat-item {
        background: var(--gray-800);
        border-color: var(--gray-700);
        color: var(--gray-100);
    }

    .p2p-container h1,
    .file-info h4,
    .progress-container h4,
    .download-section h4 {
        color: var(--gray-100);
    }

    .text-muted,
    .file-details,
    .progress-details,
    .stat-label {
        color: var(--gray-400);
    }
}

/* Share Actions */
.share-actions {
    text-align: center;
    padding: 1rem;
}

.share-actions .btn {
    min-width: 140px;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
}

/* Toast Notifications */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.share-toast {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Simple Mobile-First Progress Section */
.progress-in-grid {
    background: white;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin: 0.5rem 0;
    width: 100%;
    box-sizing: border-box;
}

.transfer-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--error-light);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border-left: 3px solid var(--error-color);
}

.transfer-warning p {
    margin: 0;
    color: var(--error-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.transfer-title {
    text-align: center;
    color: var(--gray-900);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
}

.progress-bar-container {
    background: var(--gray-200);
    border-radius: var(--radius-md);
    height: 8px;
    overflow: hidden;
    margin: 1rem 0;
    width: 100%;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin: 1rem 0;
    gap: 1rem;
}

.progress-stat {
    flex: 1;
    text-align: center;
    background: var(--gray-50);
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.progress-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.progress-value {
    display: block;
    font-size: 1rem;
    color: var(--gray-900);
    font-weight: 700;
}

.transfer-stats-simple {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.stat-simple {
    text-align: center;
    background: var(--gray-50);
    padding: 0.75rem 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.stat-simple .stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-simple .stat-value {
    display: block;
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 700;
    word-break: break-all;
}