/* ========================================
   TransferHub.ch — Stylesheet
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-bg: #0a0e17;
    --color-surface: #111827;
    --color-surface-2: #1a2236;
    --color-border: #1e293b;
    --color-border-hover: #334155;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-text-dim: #64748b;
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-primary-glow: rgba(59, 130, 246, 0.15);
    --color-success: #10b981;
    --color-success-glow: rgba(16, 185, 129, 0.15);
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-warning: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --transition: 0.2s ease;
}

html { font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* --- Header --- */
.site-header {
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
}
.logo:hover { text-decoration: none; color: var(--color-primary); }
.logo-icon { width: 28px; height: 28px; color: var(--color-primary); }
.nav-info { font-size: 0.85rem; color: var(--color-text-muted); }

/* --- Main --- */
.site-main {
    flex: 1;
    padding: 2.5rem 0;
}

/* --- Footer --- */
.site-footer {
    padding: 1.5rem 0;
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-dim);
}
.site-footer .container { max-width: 1100px; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.btn-primary:hover { background: var(--color-primary-hover); }

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-border);
}
.btn-outline:hover { border-color: var(--color-primary); background: var(--color-primary-glow); }

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border-color: transparent;
}
.btn-ghost:hover { color: var(--color-text); background: var(--color-surface-2); }

.btn-danger {
    background: transparent;
    color: var(--color-danger);
    border-color: transparent;
}
.btn-danger:hover { background: rgba(239,68,68,0.1); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; }

/* --- Inputs --- */
.input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color var(--transition);
}
.input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}
.input-lg { padding: 0.85rem 1rem; font-size: 1.05rem; }
select.input { cursor: pointer; }
textarea.input { resize: vertical; min-height: 60px; }

/* --- Upload Hero --- */
.upload-hero {
    text-align: center;
    margin-bottom: 2rem;
}
.upload-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.upload-hero .subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

/* --- Upload Card --- */
.upload-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

/* --- Drop Zone --- */
.drop-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--color-primary);
    background: var(--color-primary-glow);
}
.drop-zone.dragover .drop-icon { color: var(--color-primary); transform: translateY(-4px); }
.drop-icon {
    width: 48px;
    height: 48px;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    transition: all var(--transition);
}
.drop-text { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.3rem; }
.drop-subtext { font-size: 0.9rem; color: var(--color-text-dim); }
.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* --- File List --- */
.file-list {
    margin-top: 1.5rem;
}
.file-list h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    position: relative;
}
.file-list-header .file-input {
    position: absolute;
    right: 0;
    top: 0;
    width: 100px;
    height: 36px;
}
.file-items {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--color-surface-2);
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.file-item:hover { background: var(--color-border); }
.file-icon {
    width: 28px;
    height: 28px;
    color: var(--color-primary);
    flex-shrink: 0;
}
.file-icon svg { width: 100%; height: 100%; }
.file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-size {
    font-size: 0.8rem;
    color: var(--color-text-dim);
}
.file-remove {
    background: none;
    border: none;
    color: var(--color-text-dim);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all var(--transition);
}
.file-remove:hover { color: var(--color-danger); background: rgba(239,68,68,0.1); }
.file-remove svg { width: 18px; height: 18px; }
.file-list-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* --- Transfer Mode Tabs --- */
.transfer-mode {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}
.mode-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--color-surface-2);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}
.mode-tab svg { width: 20px; height: 20px; flex-shrink: 0; }
.mode-tab:hover {
    border-color: var(--color-border-hover);
    color: var(--color-text);
}
.mode-tab.active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-glow);
}

/* --- Email Fields --- */
.email-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.form-group { display: flex; flex-direction: column; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 0.35rem;
}
.input-hint {
    font-size: 0.78rem;
    color: var(--color-text-dim);
    margin-top: 0.3rem;
}

/* --- Collapsible Options --- */
.upload-options-wrapper {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
}
.options-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: color var(--transition);
}
.options-toggle:hover { color: var(--color-text); }
.options-toggle .chevron {
    width: 18px;
    height: 18px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}
.options-toggle.open .chevron { transform: rotate(90deg); }
.options-summary {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--color-text-dim);
    font-weight: 400;
}
.options-content {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
    padding-top: 0;
}
.options-content.open {
    max-height: 300px;
    opacity: 1;
    padding-top: 1rem;
}
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.option-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 0.35rem;
}
.option-full { grid-column: 1 / -1; }

/* --- Upload Progress --- */
.upload-progress {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}
.upload-progress h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.progress-bar {
    flex: 1;
    height: 12px;
    background: var(--color-surface-2);
    border-radius: 6px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), #60a5fa);
    border-radius: 6px;
    transition: width 0.3s ease;
}
.progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 45px;
    text-align: right;
}
.progress-detail {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* --- Upload Actions --- */
.upload-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
}
.upload-actions .btn-lg { width: 100%; justify-content: center; }

/* --- Success Card --- */
.success-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.success-icon {
    width: 64px;
    height: 64px;
    color: var(--color-success);
    margin: 0 auto 1rem;
}
.success-icon svg { width: 100%; height: 100%; }
.success-card h1 { font-size: 1.75rem; margin-bottom: 1.5rem; }

.transfer-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--color-surface-2);
    border-radius: var(--radius);
}
.summary-item { text-align: center; }
.summary-label {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.summary-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.share-section {
    margin: 2rem 0;
    text-align: left;
}
.share-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}
.link-box {
    display: flex;
    gap: 0.5rem;
}
.link-box .input {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
}
.copy-feedback {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-success);
    font-weight: 500;
}

.qr-section {
    margin: 2rem 0;
}
.qr-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.qr-container {
    display: inline-block;
    background: #fff;
    padding: 1rem;
    border-radius: var(--radius);
}
.qr-container svg { display: block; }

.new-transfer { margin-top: 2rem; }

/* --- Download Card --- */
.download-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.download-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.download-icon {
    width: 48px;
    height: 48px;
    color: var(--color-primary);
    margin: 0 auto 1rem;
}
.download-header h1 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.transfer-meta {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.meta-sep { margin: 0 0.4rem; }

.transfer-message {
    padding: 1rem 1.25rem;
    background: var(--color-surface-2);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--color-primary);
}
.transfer-message p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    font-style: italic;
}

.download-all {
    text-align: center;
    margin-bottom: 1.5rem;
}
.download-all .btn { width: 100%; justify-content: center; }

.download-file-list { border-top: 1px solid var(--color-border); padding-top: 1.5rem; }
.download-file-list h3 { font-size: 1rem; margin-bottom: 0.75rem; }

/* --- Password Card --- */
.password-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 440px;
    margin: 0 auto;
    box-shadow: var(--shadow);
}
.password-icon {
    width: 48px;
    height: 48px;
    color: var(--color-warning);
    margin: 0 auto 1rem;
}
.password-icon svg { width: 100%; height: 100%; }
.password-card h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.password-card p { color: var(--color-text-muted); margin-bottom: 1.5rem; }
.password-form .form-group { margin-bottom: 1rem; }
.password-form .btn { width: 100%; justify-content: center; }

/* --- Expired/Error Cards --- */
.expired-card, .error-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: var(--shadow);
}
.expired-icon, .error-icon {
    width: 56px;
    height: 56px;
    color: var(--color-text-dim);
    margin: 0 auto 1rem;
}
.expired-icon svg, .error-icon svg { width: 100%; height: 100%; }
.expired-card h1, .error-card h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.expired-card p, .error-card p { color: var(--color-text-muted); margin-bottom: 2rem; }
.expired-actions, .error-actions { margin-top: 1rem; }

/* --- Alert --- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .upload-hero h1 { font-size: 1.5rem; }
    .upload-card { padding: 1.25rem; }
    .options-grid { grid-template-columns: 1fr; }
    .option-full { grid-column: auto; }
    .drop-zone { padding: 2rem 1rem; }
    .mode-tabs { flex-direction: column; }
    .mode-tab { justify-content: center; }
    .transfer-meta { font-size: 0.8rem; }
    .transfer-meta .meta-sep { display: none; }
    .transfer-meta span { display: block; }
    .link-box { flex-direction: column; }
    .success-card, .download-card { padding: 1.5rem 1.25rem; }
    .transfer-summary { grid-template-columns: 1fr 1fr; }
}
