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

:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --bg-hover: #1a1a25;
    --border: #2a2a3a;
    --text: #e4e4ef;
    --text-muted: #8888a0;
    --accent: #7c5cfc;
    --accent-hover: #9b80ff;
    --accent-glow: rgba(124, 92, 252, 0.3);
    --success: #34d399;
    --danger: #f87171;
    --radius: 12px;
}

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

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

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

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.header h1 span {
    color: var(--accent);
}

.header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

/* Drop Zone */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent);
    background: rgba(124, 92, 252, 0.05);
}

.dropzone-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.dropzone h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.dropzone p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* File List */
.file-list {
    list-style: none;
    margin-top: 1.5rem;
}

.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-progress {
    flex-wrap: wrap;
}

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

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

.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    color: var(--text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.file-pct {
    color: var(--text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
    min-width: 3rem;
    text-align: right;
}

.file-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.file-remove:hover {
    opacity: 1;
}

/* Per-file progress bar */
.file-progress-bg {
    width: 100%;
    height: 3px;
    background: var(--bg-hover);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.file-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s;
    width: 0%;
}

/* Options */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (max-width: 500px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

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

.btn-primary {
    background: var(--accent);
    color: white;
    width: 100%;
    margin-top: 1.5rem;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}

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

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

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

/* Progress */
.progress-container {
    display: none;
    margin-top: 1.5rem;
}

.progress-container.active {
    display: block;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Result */
.result {
    display: none;
    text-align: center;
}

.result.active {
    display: block;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.result h3 {
    margin-bottom: 1rem;
}

.link-box {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.link-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--accent);
    font-size: 0.9rem;
    font-family: monospace;
}

.btn-copy {
    padding: 0.75rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: var(--accent-hover);
}

/* Download Page */
.dl-header {
    text-align: center;
    margin-bottom: 2rem;
}

.dl-header h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.dl-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.dl-message {
    background: var(--bg);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: var(--text-muted);
}

.dl-files {
    list-style: none;
}

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

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

.dl-file-name {
    font-weight: 500;
}

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

.btn-dl {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-dl:hover {
    background: var(--accent);
    color: white;
}

/* Password overlay */
.password-overlay {
    text-align: center;
}

.password-overlay h3 {
    margin-bottom: 1rem;
}

.password-form {
    display: flex;
    gap: 0.5rem;
    max-width: 350px;
    margin: 0 auto;
}

.password-form input {
    flex: 1;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
}

.password-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

/* Login page */
.login-card {
    max-width: 400px;
    margin: 0 auto;
}

.login-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Status page */
.status-card {
    text-align: center;
    padding: 4rem 2rem;
}

.status-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.status-card h2 {
    margin-bottom: 0.5rem;
}

.status-card p {
    color: var(--text-muted);
}

/* Footer */
.footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 3rem;
    padding-bottom: 2rem;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

/* Animations */
/* History */
.history-toggle {
    text-align: center;
    margin: 1.5rem 0 0.5rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.btn-link:hover {
    color: var(--accent);
}

.history-section {
    display: none;
    margin-bottom: 1rem;
}

.history-section.active {
    display: block;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bg-tertiary);
    gap: 1rem;
}

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

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

.history-name {
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.history-actions a,
.history-actions button {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.history-actions a {
    background: var(--accent);
    color: #fff;
}

.history-actions a:hover {
    background: var(--accent-hover);
}

.btn-delete {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--bg-tertiary) !important;
}

.btn-delete:hover {
    color: #e74c3c;
    border-color: #e74c3c !important;
}

.history-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 1rem;
}

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

.card {
    animation: fadeIn 0.3s ease;
}

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