* {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

:root {
    --bg: #f8fafc;
    --bg2: #eef2ff;
    --text: #111827;
    --muted: #6b7280;
    --card: rgba(255,255,255,0.95);
    --border: rgba(229,231,235,0.95);
    --primary: #111827;
    --primary2: #4f46e5;
    --danger: #991b1b;
    --soft: #eef2ff;
}

html, body {
    width: 100%;
    margin: 0;
    overflow-x: hidden;
}

body {
    background: linear-gradient(135deg, var(--bg), var(--bg2));
    color: var(--text);
    font-size: 16px;
}

a {
    color: inherit;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box,
.card,
.upload-card,
.file-card,
.storage-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 12px 35px rgba(15,23,42,0.08);
}

.login-box {
    width: 100%;
    max-width: 460px;
    padding: 42px;
    text-align: center;
}

.login-box h1 {
    margin: 0 0 10px;
    font-size: 38px;
}

.login-box p,
.container > p,
.upload-box small,
.limit-hint,
.storage-card span,
.user-row small,
.file-card small {
    color: var(--muted);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(12px);
    padding: 16px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 18px rgba(15,23,42,0.06);
}

.topbar strong {
    font-size: 22px;
}

.topbar span {
    margin-left: 12px;
    color: var(--muted);
    font-size: 14px;
}

.topbar a {
    margin-left: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    background: var(--soft);
    padding: 11px 14px;
    border-radius: 14px;
    display: inline-block;
}

.container {
    max-width: 1120px;
    margin: 34px auto;
    padding: 0 20px 44px;
}

.container h1 {
    font-size: 36px;
    margin-bottom: 6px;
}

.card,
.upload-card,
.storage-card {
    padding: 24px;
    margin: 20px 0;
}

input {
    width: 100%;
    padding: 17px;
    margin-bottom: 12px;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    font-size: 18px;
    background: white;
}

button {
    width: 100%;
    padding: 17px;
    border: none;
    border-radius: 16px;
    background: var(--primary);
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: #374151;
}

.upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px dashed #c7d2fe;
    border-radius: 24px;
    padding: 42px 24px;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    transition: 0.2s ease;
}

.upload-box:hover,
.upload-box.dragover {
    background: var(--soft);
    border-color: var(--primary2);
}

.upload-box input {
    display: none;
}

.upload-icon {
    font-size: 50px;
}

.upload-box strong {
    font-size: 20px;
}

.file-info {
    margin-top: 14px;
    width: 100%;
    text-align: left;
}

.selected-file,
.selected-more {
    background: white;
    padding: 12px;
    border-radius: 14px;
    margin-top: 8px;
    font-size: 15px;
    display: flex;
    gap: 8px;
    align-items: center;
    word-break: break-word;
}

.progress-wrap {
    margin: 16px 0;
    height: 16px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar,
.storage-bar div,
.usage div {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary2));
    transition: width 0.2s ease;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.file-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    word-break: break-word;
}

.thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 18px;
    background: #f3f4f6;
}

.video-preview {
    background: #000;
}

.clickable-image {
    cursor: pointer;
}

.file-icon {
    font-size: 46px;
}

.file-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.file-actions a {
    margin-top: 8px;
    background: var(--primary);
    color: white;
    padding: 14px;
    text-align: center;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
}

.file-actions .delete,
.delete-user-btn,
.folder-delete {
    background: var(--danger);
}

.notice {
    background: #dcfce7;
    color: #166534;
    padding: 14px;
    border-radius: 14px;
    margin: 16px 0;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 12px;
}

.folder-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.folder-btn {
    background: var(--soft);
    color: var(--text);
    padding: 14px 18px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 700;
}

.folder-delete {
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.folder-form,
.inline-form {
    display: grid;
    gap: 10px;
}

.storage-card div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.storage-bar,
.usage {
    margin-top: 12px;
    height: 14px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.user-row {
    background: #f8fafc;
    padding: 16px;
    border-radius: 16px;
}

.user-row small {
    display: block;
    margin-top: 4px;
}

.delete-user-btn {
    display: inline-block;
    margin-top: 12px;
    color: white;
    padding: 12px 16px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: bold;
}

.lightbox {
    display: none;
    position: fixed;
    z-index: 999;
    inset: 0;
    background: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    padding: 20px 76px;
}

.lightbox-media {
    max-width: 95%;
    max-height: 82vh;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    display: block;
    margin: auto;
}

.lightbox-title {
    color: white;
    text-align: center;
    margin-top: 14px;
    font-weight: bold;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 22px;
    width: auto;
    padding: 12px 16px;
    background: var(--danger);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 64px;
    height: 64px;
    border-radius: 999px;
    font-size: 44px;
    line-height: 1;
    background: rgba(255,255,255,0.22);
}

.lightbox-nav.left {
    left: 18px;
}

.lightbox-nav.right {
    right: 18px;
}

.lightbox-file {
    font-size: 86px;
    text-align: center;
    color: white;
}

.lightbox-download {
    display: block;
    margin: 18px auto 0;
    background: white;
    color: var(--text);
    padding: 14px 18px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    max-width: 260px;
}

.upload-warning {
    margin: 14px 0;
    background: #fef3c7;
    color: #92400e;
    padding: 14px;
    border-radius: 14px;
    font-weight: bold;
    text-align: center;
}

.upload-overlay {
    position: fixed;
    z-index: 2000;
    inset: 0;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.upload-modal {
    width: 100%;
    max-width: 480px;
    background: white;
    border-radius: 26px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0,0,0,0.35);
}

.upload-modal h2 {
    margin: 14px 0 8px;
}

.upload-modal p {
    color: #4b5563;
    line-height: 1.5;
}

.upload-modal small {
    display: block;
    margin-top: 14px;
    color: #92400e;
    background: #fef3c7;
    padding: 12px;
    border-radius: 14px;
    font-weight: bold;
}

.modal-progress {
    margin-top: 18px;
}

.spinner {
    width: 58px;
    height: 58px;
    margin: 0 auto;
    border-radius: 50%;
    border: 6px solid #e5e7eb;
    border-top-color: var(--primary2);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Nur leichte Handy-Anpassung: Desktop-Look bleibt erhalten */
@media only screen and (max-width: 900px) {
    .login-box {
        max-width: 480px;
        padding: 42px 30px;
    }

    .login-box h1 {
        font-size: 38px;
    }

    .login-box p {
        font-size: 18px;
    }

    input {
        font-size: 18px;
        padding: 18px;
        min-height: 58px;
    }

    button {
        font-size: 18px;
        padding: 18px;
        min-height: 58px;
    }

    .lightbox {
        padding: 12px 8px 110px;
    }

    .lightbox-media {
        max-width: 100%;
        max-height: 74vh;
        border-radius: 20px;
    }

    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 76px;
        height: 76px;
        font-size: 32px;
        border-radius: 22px;
    }

    .lightbox-nav {
        top: auto;
        bottom: 20px;
        transform: none;
        width: 96px;
        height: 96px;
        font-size: 66px;
        background: rgba(255,255,255,0.34);
    }

    .lightbox-nav.left {
        left: 22px;
    }

    .lightbox-nav.right {
        right: 22px;
    }
}
@media only screen and (max-width: 900px) {
    .file-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important;
        gap: 10px !important;
    }

    .file-card {
        padding: 8px !important;
        border-radius: 14px !important;
        gap: 6px !important;
    }

    .thumb {
        height: 95px !important;
        border-radius: 12px !important;
    }

    .file-card strong {
        font-size: 12px !important;
        line-height: 1.2 !important;
        max-height: 30px !important;
        overflow: hidden !important;
    }

    .file-card small {
        font-size: 11px !important;
    }

    .file-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 5px !important;
    }

    .file-actions a {
        font-size: 11px !important;
        padding: 7px !important;
        border-radius: 8px !important;
        margin-top: 0 !important;
    }

    .container {
        max-width: 1120px !important;
        margin: 20px auto !important;
        padding: 0 10px 30px !important;
    }

    .card,
    .upload-card,
    .storage-card {
        padding: 16px !important;
    }

    .login-box {
        max-width: 430px !important;
        padding: 34px !important;
    }

    .login-box h1 {
        font-size: 34px !important;
    }

    input,
    button {
        font-size: 18px !important;
        min-height: 56px !important;
        padding: 16px !important;
    }

    .lightbox-nav {
        width: 96px !important;
        height: 96px !important;
        font-size: 66px !important;
    }

    .lightbox-close {
        width: 76px !important;
        height: 76px !important;
        font-size: 32px !important;
    }
}
.active-folder {
    background: #16a34a !important;
    color: white !important;
    box-shadow: 0 8px 22px rgba(22, 163, 74, 0.28);
}
.select-field {
    width: 100%;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    font-size: 17px;
    background: white;
}

.dark-mode {
    --bg: #020617;
    --bg2: #111827;
    --text: #f9fafb;
    --muted: #cbd5e1;
    --card: rgba(15,23,42,0.96);
    --border: rgba(51,65,85,0.95);
    --primary: #4f46e5;
    --primary2: #818cf8;
    --soft: #1e293b;
    background: linear-gradient(135deg, #020617, #111827);
    color: var(--text);
}

.dark-mode .topbar {
    background: rgba(15,23,42,0.94);
}

.dark-mode input,
.dark-mode .select-field {
    background: #020617;
    color: #f9fafb;
    border-color: #334155;
}

.dark-mode .upload-box,
.dark-mode .user-row,
.dark-mode .selected-file,
.dark-mode .selected-more {
    background: #020617;
}

.dark-mode .storage-bar,
.dark-mode .usage,
.dark-mode .progress-wrap {
    background: #334155;
}

.dark-mode .upload-modal {
    background: #0f172a;
    color: #f9fafb;
}
.file-actions .favorite-btn {
    background: #facc15;
    color: #111827;
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-actions .favorite-btn.active {
    background: #111827;
    color: #facc15;
}
.file-actions a {
    white-space: nowrap;
}
.multi-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.multi-actions button {
    width: auto !important;
    padding: 10px 16px !important;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    flex: unset !important;
}
.multi-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    margin: 10px 0 16px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

.multi-actions button {
    width: auto !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    border-radius: 10px !important;
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.storage-form {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.storage-form input {
    width: 120px !important;
    min-height: auto !important;
    padding: 10px !important;
    margin: 0 !important;
}

.storage-form button {
    width: auto !important;
    min-height: auto !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
}
/* Papierkorb Buttons sauber nebeneinander */
.file-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.file-actions a {
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Papierkorb etwas kompakter */
.file-actions .delete {
    font-size: 13px;
    padding: 12px 10px;
}

.file-actions a:not(.delete) {
    font-size: 13px;
    padding: 12px 10px;
}