/* Reset e variabili */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --error: #ef4444;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.logo {
    width: 60px;
    height: auto;
    border-radius: 8px;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
    text-align: left;
}

.subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    text-align: left;
}

/* Drop Zone */
.drop-zone {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.drop-zone.dragover {
    transform: scale(1.02);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--primary);
}

.drop-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.drop-subtext {
    color: var(--text-light);
    font-size: 0.9rem;
}

.browse-btn {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* File List */
.file-list-container {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow);
}

.file-list-container h3 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 1rem;
}

.file-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

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

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    width: 24px;
    height: 24px;
    color: var(--error);
}

.file-name {
    font-weight: 500;
    color: var(--text);
}

.file-size {
    font-size: 0.85rem;
    color: var(--text-light);
}

.remove-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.remove-btn:hover {
    color: var(--error);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text-light);
    margin-top: 1rem;
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-download {
    background: var(--success);
    color: white;
    text-decoration: none;
    margin-top: 1rem;
}

.btn-download:hover {
    filter: brightness(1.1);
}

/* Actions */
.actions {
    margin-top: 1.5rem;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Progress */
.progress-container {
    margin-top: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.progress-bar {
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 0.75rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Result */
.result-container {
    margin-top: 1.5rem;
}

.result-success {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.success-icon {
    width: 64px;
    height: 64px;
    color: var(--success);
    margin-bottom: 1rem;
}

.result-success h3 {
    color: var(--success);
    margin-bottom: 0.5rem;
}

/* Error */
.error-container {
    margin-top: 1.5rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
}

#errorMessage {
    color: var(--error);
    font-weight: 500;
}

/* Footer */
footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
}

footer .admin-link {
    margin-top: 0.5rem;
}

footer .admin-link a {
    color: var(--text-light);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

footer .admin-link a:hover {
    opacity: 1;
    text-decoration: underline;
}

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

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }
}
