/* ============================================
   BASE STYLES - Gemeinsam für alle Seiten
   ============================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border: #334155;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

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

html {
    width: 100%;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    color: var(--text-primary);
}

#app {
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    padding: 40px;
    animation: slideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

h1, h2 {
    color: var(--primary);
    font-weight: 700;
    text-align: center;
}

h1 {
    margin-bottom: 32px;
    font-size: 26px;
    letter-spacing: -0.5px;
}

h2 {
    margin-bottom: 24px;
    font-size: 20px;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 50px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 24px;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.upload-zone:hover {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
}

.upload-zone:hover::before {
    left: 100%;
}

.upload-zone.dragover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: var(--primary);
    color: white;
    transform: scale(1.02);
}

.upload-zone.dragover::before {
    left: 100%;
}

.upload-icon {
    font-size: 56px;
    margin-bottom: 16px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

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

.upload-text {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
}

.upload-zone.dragover .upload-text {
    color: white;
}

.file-selected-info {
    margin-top: 12px;
}

.file-selected-name {
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    word-break: break-word;
    margin-bottom: 8px;
}

.file-selected-size {
    color: var(--text-secondary);
    font-size: 13px;
}

input[type="file"] {
    display: none;
}

.file-info {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 32px;
    text-align: center;
    border: 1px solid var(--border);
}

.file-info p {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-name {
    font-size: 18px;
    color: var(--primary);
    font-weight: 700;
    margin: 12px 0;
    word-break: break-word;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-weight: 500;
}

input[type="password"]::placeholder,
input[type="text"]::placeholder {
    color: var(--text-secondary);
}

input[type="password"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

button {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.button-group button {
    width: auto;
    flex: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.4);
}

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

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

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

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

.status {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

.status.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status.loading {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.share-link {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.share-link a {
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.share-link a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.copy-hint {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 10px;
    display: none;
}

.password-input-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--primary);
}

.file-name-display {
    font-size: 18px;
    color: var(--primary);
    font-weight: 700;
    margin: 12px 0;
    word-break: break-word;
}

.theme-btn {
    flex: 1;
    min-width: 70px;
    padding: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

.theme-btn-icon {
    font-size: 24px;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.theme-btn-text {
    margin: 0;
    padding: 0;
    font-size: 12px;
    font-weight: bold;
}

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

.theme-btn:hover {
    transform: translateY(-2px);
}

.theme-close-btn {
    width: 100%;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 13px;
}

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

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.home-link {
    margin-top: 24px;
    text-align: center;
}

.home-link a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.home-link a:hover {
    color: var(--primary-dark);
    gap: 10px;
}

.fade-transition {
    animation: fadeOut 0.3s ease-out;
}

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

.result-container {
    animation: slideInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.share-section {
    animation: fadeInScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
}

.file-info-section {
    animation: fadeInScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.copy-link-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 12px 16px;
    border-radius: 0;
    transition: all 0.3s ease;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
}

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

.copy-link-btn.copied {
    background: var(--success);
}

.copy-action-btn {
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.copy-action-btn:hover {
    background: var(--border);
    border-color: var(--primary);
    color: var(--primary);
}

.copy-action-btn:active {
    transform: scale(0.98);
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin-top: 16px;
}

.warning-box strong {
    color: #f59e0b;
    font-weight: 700;
}

.success-checkmark {
    display: inline-block;
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.back-link {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--primary-dark);
    transform: translateX(-4px);
}

.info-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

.info-text p {
    margin-bottom: 16px;
}

/* ============================================
   APP LAYOUT (Main + History Sidebar)
   ============================================ */

.app-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

.main-column {
    width: 100%;
    max-width: 520px;
    flex-shrink: 0;
}

/* ============================================
   HISTORY SIDEBAR
   ============================================ */

.history-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.history-card {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    padding: 20px;
    animation: slideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.history-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    text-align: center;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.history-item:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.history-item-icon {
    font-size: 22px;
    flex-shrink: 0;
}

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

.history-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   CUSTOM CHECKBOX
   ============================================ */

.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.custom-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.custom-checkbox:hover {
    border-color: var(--primary);
}

/* ============================================
   RESPONSIVE: Mobile
   ============================================ */

@media (max-width: 900px) {
    #app {
        max-width: 520px;
    }

    .app-layout {
        flex-direction: column;
        align-items: center;
    }

    .main-column {
        max-width: 100%;
    }

    .history-sidebar {
        width: 100%;
        max-width: 520px;
    }
}
