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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --success-dark: #059669;
    --secondary: #8b5cf6;
    --accent: #f59e0b;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(15, 23, 42, 0.08);
    --shadow-lg: rgba(15, 23, 42, 0.15);
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0f172a;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.2) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.2) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px),
        linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 50px;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    text-shadow: 0 0 40px rgba(99, 102, 241, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    color: #cbd5e1;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 45px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    overflow: hidden;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

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

/* Upload Area */
.upload-area {
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 70px 40px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: rgba(99, 102, 241, 0.02);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    border-radius: 50%;
}

.upload-area:hover::before,
.upload-area.drag-over::before {
    width: 500px;
    height: 500px;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2);
}

.upload-icon {
    font-size: 5rem;
    margin-bottom: 25px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3));
    position: relative;
    z-index: 1;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    25% { 
        transform: translateY(-15px) rotate(-5deg); 
    }
    75% { 
        transform: translateY(-10px) rotate(5deg); 
    }
}

.upload-area h2 {
    font-size: 1.75rem;
    margin-bottom: 12px;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
}

.upload-area p {
    color: #94a3b8;
    margin-bottom: 30px;
    font-size: 1.05rem;
    position: relative;
    z-index: 1;
}

.upload-area p strong {
    color: #a5b4fc;
    font-weight: 700;
}

/* Buttons */
.btn {
    padding: 16px 40px;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    position: relative;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    width: 100%;
    margin-top: 25px;
    font-size: 1.1rem;
    padding: 18px 40px;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 14px 28px;
}

/* File Info */
.file-info {
    margin-top: 35px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.file-info h3 {
    margin-bottom: 20px;
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

#fileList {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
}

.file-count-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.file-count-badge i {
    font-size: 1.1rem;
}

.total-size-info {
    margin-top: 20px;
    padding: 14px 18px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    color: #94a3b8;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.total-size-info i {
    color: #6366f1;
    font-size: 1rem;
}

.total-size-info strong {
    color: #ffffff;
    font-weight: 700;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 18px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-icon {
    font-size: 2.5rem;
    margin-right: 18px;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.3));
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 6px;
    font-size: 1.05rem;
}

.file-size {
    font-size: 0.95rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Share Section */
.share-section {
    margin-top: 35px;
    padding: 30px;
    background: rgba(99, 102, 241, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
    animation: fadeIn 0.5s ease-out;
}

.share-section h3 {
    margin-bottom: 20px;
    color: #a5b4fc;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.link-container {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.link-container input {
    flex: 1;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: #ffffff;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    transition: all 0.3s ease;
}

.link-container input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.link-container input::selection {
    background: rgba(99, 102, 241, 0.3);
}

.info-text {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Status Box */
.status-box {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.label {
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.value {
    font-weight: 700;
    color: #ffffff;
    font-size: 1.05rem;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.value.connected {
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.value.error {
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #6366f1 50%, #8b5cf6 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 20px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

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

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

/* Received Files */
.received-files {
    margin-top: 35px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.file-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.file-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(99, 102, 241, 0.4);
}

.file-preview {
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.file-preview::after {
    content: 'Click to enlarge';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: 'Font Awesome 6 Free';
}

.file-preview::before {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.2rem;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.file-preview:hover::before {
    opacity: 1;
}

.file-preview:hover::after {
    opacity: 1;
}

.file-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.file-card:hover .file-preview img {
    transform: scale(1.1);
}

.file-preview-icon {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    position: relative;
    overflow: hidden;
}

.file-preview-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.large-icon {
    font-size: 5rem;
    filter: drop-shadow(0 4px 16px rgba(99, 102, 241, 0.4));
    position: relative;
    z-index: 1;
}

.file-card-footer {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.02);
}

.file-card-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.3));
}

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

.file-card-name {
    font-weight: 600;
    margin-bottom: 6px;
    color: #ffffff;
    word-break: break-word;
    font-size: 1rem;
    line-height: 1.3;
}

.file-card-type {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.download-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.download-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 25px;
    opacity: 0.95;
}

footer p {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Receiver Section */
.section h2 {
    color: #ffffff;
    font-size: 1.8rem;
    margin-bottom: 25px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    header h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .section {
        padding: 30px 20px;
    }

    .upload-area {
        padding: 50px 25px;
    }

    .upload-area h2 {
        font-size: 1.4rem;
    }

    .upload-icon {
        font-size: 4rem;
    }

    .link-container {
        flex-direction: column;
    }

    .btn-secondary {
        width: 100%;
    }

    .received-files {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .file-card-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .download-btn {
        width: 100%;
    }

    .status-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .value {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }

    .section {
        padding: 25px 15px;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 18px 28px;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    font-weight: 600;
    font-size: 1rem;
}

.toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

@keyframes slideIn {
    from {
        transform: translateX(400px) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: #ffffff;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Image Lightbox */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    animation: fadeIn 0.3s ease;
}

.image-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    z-index: 10000;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: zoomIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 300;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(239, 68, 68, 1);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

#lightboxImage {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

.lightbox-filename {
    margin-top: 20px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    max-width: 80vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    #lightboxImage {
        max-height: 80vh;
    }

    .lightbox-filename {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
}

