/* DateiHub - Nextcloud-Style Design */
:root {
    --primary-color: #1A73E8;
    --primary-hover: #1557B0;
    --secondary-color: #6B7280;
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-color: #202124;
    --text-muted: #6B7280;
    --border-color: #DADCE0;
    --error-color: #EF4444;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
    --shadow-lg: 0 8px 24px rgba(60, 64, 67, 0.16);
    --radius: 8px;
    --radius-lg: 12px;
    --sidebar-width: 250px;
    --top-nav-height: 60px;
}

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

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

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

/* ========== LOGIN SCREEN ========== */
#login-screen {
      display: flex;
      align-items: center;
      justify-content: center;
    justify-content: center;
    padding: 20px;
    min-height: 100vh;
}

.login-box {
      background: var(--card-bg);
      padding: 40px;
      margin: 0 auto;
      max-width: 400px;
      width: 90%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-box h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.login-box .subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ========== FORM ELEMENTS ========== */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--card-bg);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

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

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

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

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
}

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

.btn-icon {
    padding: 8px;
    font-size: 18px;
    background: transparent;
    border: 1px solid transparent;
}

.btn-icon:hover {
    background: var(--bg-color);
    border-color: var(--border-color);
}

/* ========== ERROR MESSAGES ========== */
.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 12px;
    padding: 10px;
    background: #FEF2F2;
    border-radius: var(--radius);
    border: 1px solid #FECACA;
}

/* ========== TOP NAVIGATION ========== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-nav-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.top-nav-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-icon {
    font-size: 1.5rem;
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    color: var(--text-muted);
    font-size: 14px;
}

/* ========== SETTINGS MENU ========== */
.settings-wrapper {
    position: relative;
}

.settings-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1001;
}

.settings-menu-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: background 0.2s;
}

.settings-menu-item:hover {
    background: var(--bg-color);
}

/* ========== APP CONTAINER ========== */
.app-container {
    display: flex;
    margin-top: var(--top-nav-height);
    min-height: calc(100vh - var(--top-nav-height));
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    position: fixed;
    top: var(--top-nav-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-section {
    padding: 0 12px;
}

.nav-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 12px 8px;
    margin-bottom: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--text-color);
}

.nav-item:hover {
    background: var(--bg-color);
}

.nav-item.active {
    background: rgba(26, 115, 232, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* ========== FOLDER TREE ========== */
.folder-tree {
    padding-left: 8px;
}

.folder-tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: all 0.2s;
}

.folder-tree-item:hover {
    background: var(--bg-color);
}

.folder-tree-item.active {
    background: rgba(26, 115, 232, 0.1);
    color: var(--primary-color);
}

.folder-tree-toggle {
    font-size: 12px;
    width: 16px;
    text-align: center;
    cursor: pointer;
}

.folder-tree-icon {
    font-size: 16px;
}

.folder-tree-children {
    padding-left: 24px;
    border-left: 1px solid var(--border-color);
    margin-left: 12px;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: calc(100vh - var(--top-nav-height));
}

/* ========== TOOLBAR ========== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--primary-color);
    transition: background 0.2s;
}

.breadcrumb-item:hover {
    background: rgba(26, 115, 232, 0.1);
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    color: var(--text-muted);
    margin-left: 8px;
}

.breadcrumb-item:last-child {
    color: var(--text-color);
    font-weight: 600;
    cursor: default;
}

.breadcrumb-item:last-child:hover {
    background: none;
}

/* ========== VIEW TOGGLE ========== */
.view-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.view-btn {
    padding: 8px 12px;
    background: var(--card-bg);
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.view-btn:hover {
    background: var(--bg-color);
}

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

/* ========== BATCH BAR ========== */
.batch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.batch-info {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.batch-actions {
    display: flex;
    gap: 8px;
}

/* ========== FILE GRID ========== */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.file-grid-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.file-grid-item:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.file-grid-item.selected {
    border-color: var(--primary-color);
    background: rgba(26, 115, 232, 0.05);
}

.file-grid-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.file-grid-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 12px;
}

.file-grid-name {
    font-size: 14px;
    text-align: center;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.file-grid-meta {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
}

/* ========== FILE LIST VIEW ========== */
.file-list-view {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.file-list-header {
    display: grid;
    grid-template-columns: 40px 1fr 120px 120px 100px;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-list-item {
    display: grid;
    grid-template-columns: 40px 1fr 120px 120px 100px;
    gap: 12px;
    padding: 12px 16px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

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

.file-list-item:hover {
    background: var(--bg-color);
}

.file-list-item.selected {
    background: rgba(26, 115, 232, 0.05);
}

.file-list-icon {
    font-size: 20px;
    text-align: center;
}

.file-list-name {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list-size,
.file-list-date {
    font-size: 13px;
    color: var(--text-muted);
}

.file-list-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-list-item:hover .file-list-actions {
    opacity: 1;
}

/* ========== UPLOAD AREA ========== */
.upload-area {
    margin-bottom: 20px;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: rgba(26, 115, 232, 0.02);
}

.upload-text {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 8px;
}

.upload-subtext {
    font-size: 14px;
    color: var(--text-muted);
}

/* ========== PROGRESS BAR ========== */
.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 16px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state .subtitle {
    font-size: 14px;
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.modal-content h3 {
    margin-bottom: 16px;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 15px;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ========== ADMIN PANEL ========== */
.admin-panel {
    margin-bottom: 24px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.admin-card h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

/* ========== TOASTS ========== */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.toast.success {
    background: #DEF7EC;
    color: #03543F;
    border: 1px solid #31C48D;
}

.toast.error {
    background: #FDE8E8;
    color: #9B1C1C;
    border: 1px solid #F98080;
}

.toast.warning {
    background: #FDF6B2;
    color: #8E4B10;
    border: 1px solid #FACA15;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== LOADING ========== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .file-list-header,
    .file-list-item {
        grid-template-columns: 40px 1fr 80px;
    }
    
    .file-list-date,
    .file-list-actions {
        display: none;
    }
}
