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

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --success: #10b981;
    --success-dark: #059669;
    --secondary: #6366f1;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(15, 23, 42, 0.08);
    --shadow-lg: rgba(15, 23, 42, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.section {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px var(--shadow-lg);
    margin-bottom: 30px;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--border);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: #f5f7ff;
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.upload-area h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* Buttons */
.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
    width: 100%;
    margin-top: 20px;
}

.btn-success:hover {
    background: var(--success-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    padding: 12px 24px;
}

/* File Info */
.file-info {
    margin-top: 30px;
}

.file-info h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

#fileList {
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px var(--shadow);
}

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

.file-icon {
    font-size: 2rem;
    margin-right: 15px;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.file-size {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Share Section */
.share-section {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f5f7ff 0%, #e8ecff 100%);
    border-radius: 15px;
    border: 2px solid var(--primary);
}

.share-section h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.link-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.link-container input {
    flex: 1;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    background: white;
}

.info-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Status Box */
.status-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px var(--shadow);
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

.label {
    font-weight: 600;
    color: var(--text-secondary);
}

.value {
    font-weight: 700;
    color: var(--text-primary);
}

.value.connected {
    color: var(--success);
}

.value.error {
    color: #ef4444;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--bg-primary);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px var(--shadow);
}

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

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

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

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

.file-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow);
    transition: transform 0.3s ease;
}

.file-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px var(--shadow-lg);
}

.file-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.file-preview-icon {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7ff 0%, #e8ecff 100%);
}

.large-icon {
    font-size: 5rem;
}

.file-card-footer {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-card-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

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

.file-card-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
    word-break: break-word;
    font-size: 0.95rem;
}

.file-card-type {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.download-btn {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.download-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

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

footer p {
    font-size: 0.95rem;
}

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

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .section {
        padding: 25px;
    }

    .upload-area {
        padding: 40px 20px;
    }

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

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

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--success);
    color: white;
    padding: 16px 24px;
    border-radius: 10px;
    box-shadow: 0 6px 25px var(--shadow-lg);
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

.toast.error {
    background: #ef4444;
}

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

