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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 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: 800px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    animation: slideIn 0.3s ease-out;
}

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

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

#uploadForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-area {
    border: 2px dashed var(--primary-color);
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(236, 72, 153, 0.05));
}

.upload-area:hover {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.15));
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.3);
}

.upload-icon {
    width: 60px;
    height: 60px;
    color: var(--primary-color);
    margin-bottom: 15px;
    opacity: 0.8;
}

.drag-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.file-info {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 20px;
    animation: slideIn 0.3s ease-out;
}

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

.preview-container {
    margin-bottom: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.preview-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
}

.preview-img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.upload-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.upload-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.4);
}

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

.upload-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cancel-btn {
    background: var(--border-color);
    color: var(--text-primary);
    border: none;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #cbd5e1;
    transform: translateY(-2px);
}

.uploaded-files {
    margin-top: 30px;
}

.uploaded-files h2 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.file-item:hover {
    background: #f1f5f9;
    transform: translateX(5px);
}

.file-item-info {
    flex: 1;
}

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

.file-item-meta {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-item-actions {
    display: flex;
    gap: 10px;
}

.view-btn, .delete-btn, .download-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

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

.download-btn {
    background: #dbeafe;
    color: #0369a1;
}

.download-btn:hover {
    background: #bfdbfe;
}

.delete-btn {
    background: #fee2e2;
    color: var(--error-color);
}

.delete-btn:hover {
    background: #fecaca;
}

/* Loading Spinner */
.spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 1000;
}

.spinner.hidden {
    display: none;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    z-index: 999;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

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

.notification.error {
    background: var(--error-color);
}

.notification.warning {
    background: var(--warning-color);
}

/* Responsive */
@media (max-width: 768px) {
    .upload-section {
        padding: 25px;
    }

    h1 {
        font-size: 2rem;
    }

    .upload-area {
        padding: 30px 15px;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .file-item-actions {
        width: 100%;
    }

    .file-item-actions button {
        flex: 1;
    }

    .file-item-meta {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .upload-section {
        padding: 20px;
        border-radius: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .upload-icon {
        width: 40px;
        height: 40px;
    }

    .upload-btn, .cancel-btn {
        width: 100%;
    }
}