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

:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary: #a78bfa;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #fafafa;
    --bg-light: #ffffff;
    --bg-lighter: #f5f5f5;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --shadow: rgba(139, 92, 246, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
    color: var(--text);
    min-height: 100vh;
    padding: 2rem;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease;
}

.logo-container {
    margin-bottom: 1rem;
}

.logo {
    width: 100px;
    height: 100px;
    animation: float 3s ease-in-out infinite;
}

.header-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-light);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.btn-icon:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 8px var(--shadow);
}

.btn-donate {
    background: linear-gradient(135deg, #FFDD00, #FBB034);
    color: #000;
    border-color: #FFDD00;
}

.btn-donate:hover {
    background: linear-gradient(135deg, #FBB034, #FFDD00);
    border-color: #FBB034;
}

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

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.drop-zone {
    background: var(--bg-light);
    border: 3px dashed var(--border);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: fadeIn 0.6s ease 0.2s both;
    box-shadow: 0 4px 6px var(--shadow);
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--bg-lighter);
    transform: translateY(-2px);
    box-shadow: 0 8px 12px var(--shadow);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: var(--primary);
    animation: float 3s ease-in-out infinite;
}

.drop-text {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.drop-subtext {
    color: var(--text-muted);
    margin: 1rem 0;
}

.file-types {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.btn-primary, .btn-secondary, .btn-danger, .btn-success {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-lighter);
    border-color: var(--primary);
}

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

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

.files-section {
    margin-top: 2rem;
    animation: fadeIn 0.6s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.file-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    animation: slideIn 0.4s ease;
    box-shadow: 0 2px 4px var(--shadow);
}

.file-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.file-preview {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
}

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

.preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.preview-placeholder svg {
    width: 40px;
    height: 40px;
    opacity: 0.5;
}

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

.file-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    word-break: break-all;
}

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

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.file-actions button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.metadata-section {
    margin-top: 1rem;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
}

.metadata-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

.metadata-count {
    background: var(--warning);
    color: var(--bg);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    background: var(--bg-light);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: var(--bg-lighter);
    border-color: var(--primary);
}

.metadata-list {
    background: var(--bg);
    border-radius: 0.5rem;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

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

.metadata-checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.metadata-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.metadata-key {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.metadata-value {
    color: var(--text-muted);
    font-size: 0.9rem;
    word-break: break-word;
    text-align: right;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: 1rem;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
    animation: shimmer 2s infinite;
}

.status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.status.analyzing {
    background: var(--warning);
    color: var(--bg);
}

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

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

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

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

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

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

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .logo {
        width: 80px;
        height: 80px;
    }
    
    .header-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .file-header {
        flex-direction: column;
    }
    
    .file-preview {
        width: 100%;
        height: 200px;
    }
}
