/* Files App Styles */

:root {
    --sidebar-width: 280px;
    --transition-speed: 0.2s;
}

body {
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-top: 64px; /* Account for fixed topbar */
}

#app {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

/* Sidebar */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--workspace-sidebar-bg, var(--md-sys-color-surface-container));
    display: flex;
    flex-direction: column;
    padding: 16px;
    height: calc(100vh - 64px); /* Account for topbar */
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    z-index: 900;
}

/* Main content area */
#main-content {
    margin-left: var(--sidebar-width);
    margin-top: 0;
    height: calc(100vh - 64px);
    overflow-y: auto;
    flex: 1;
}

/* When sidebar is collapsed */
body.sidebar-collapsed #main-content {
    margin-left: 0;
}

.sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    cursor: pointer;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    transition: background-color var(--transition-speed);
}

.nav-item:hover {
    background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}

.nav-item.active {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.nav-item .material-symbols-rounded {
    font-size: 24px;
}

/* Sidebar Footer Buttons */
.sidebar-footer {
    padding-top: 8px;
    border-top: 1px solid var(--md-sys-color-outline-variant, #e0e0e0);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 100px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    width: 100%;
    text-align: left;
    transition: background-color 0.2s;
}

.sidebar-btn:hover {
    background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}

.sidebar-btn .material-symbols-rounded {
    font-size: 22px;
}


/* Main Content */
#main-content {
    flex-grow: 1;
    overflow-y: auto;
    background-color: var(--md-sys-color-surface);
}

.files-container {
    padding: 32px 48px;
    max-width: 1400px;
    margin: 0 auto;
}

.files-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}

.files-header h1 {
    font-family: 'Kumbh Sans', sans-serif;
    font-size: 2.5rem;
    font-weight: 400;
    margin: 0;
    color: var(--md-sys-color-on-surface);
}

.files-search-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.files-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--md-sys-color-surface-container-high);
    border-radius: 100px;
    padding: 12px 16px;
    min-width: 480px;
    box-shadow: 0 1px 3px color-mix(in srgb, var(--md-sys-color-shadow) 12%, transparent);
    transition: box-shadow 0.2s, background-color 0.2s;
}

.files-search:focus-within {
    background: var(--md-sys-color-surface-container-lowest);
    box-shadow: 0 2px 6px color-mix(in srgb, var(--md-sys-color-shadow) 20%, transparent);
}

.files-new-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 16px;
    border: none;
    background: var(--md-sys-color-surface-container-lowest);
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    box-shadow: 0 1px 2px 0 color-mix(in srgb, var(--md-sys-color-shadow) 30%, transparent), 0 1px 3px 1px color-mix(in srgb, var(--md-sys-color-shadow) 15%, transparent);
    transition: box-shadow 0.2s, background-color 0.2s;
    white-space: nowrap;
}

.files-new-btn:hover {
    background-color: var(--md-sys-color-surface-container-low);
    box-shadow: 0 1px 3px 0 color-mix(in srgb, var(--md-sys-color-shadow) 30%, transparent), 0 4px 8px 3px color-mix(in srgb, var(--md-sys-color-shadow) 15%, transparent);
}

.files-new-btn .material-symbols-rounded {
    font-size: 24px;
    color: var(--md-sys-color-primary);
}

.files-search input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font: inherit;
    font-size: 16px;
    color: var(--md-sys-color-on-surface);
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
}

.files-card {
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--md-sys-color-shadow) 6%, transparent);
}

.files-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    margin-bottom: 10px;
}

.files-card-header h2 {
    margin: 0;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--md-sys-color-on-surface);
}

.files-card-meta {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.9rem;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 520px;
    overflow: auto;
    padding-right: 4px;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    color: var(--md-sys-color-on-surface);
}

.file-row:hover {
    background: var(--md-sys-color-surface-container-high);
    border-color: var(--md-sys-color-outline-variant);
}

.file-row .material-symbols-rounded {
    color: var(--md-sys-color-primary);
}

.file-row-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.file-row-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-row-subtitle {
    font-size: 0.85rem;
    color: var(--md-sys-color-on-surface-variant);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.files-empty {
    color: var(--md-sys-color-on-surface-variant);
    font-style: italic;
    padding: 12px;
}
