:root {
    --md-sys-color-primary: #005fb0;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d4e3ff;
    --md-sys-color-on-primary-container: #001c3b;
    --md-sys-color-secondary: #565e71;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-surface: #fdfbff;
    --md-sys-color-on-surface: #1a1b1f;
    --md-sys-color-surface-variant: #e0e2ec;
    --md-sys-color-on-surface-variant: #44474e;
    --md-sys-color-outline: #74777f;
    --md-sys-color-background: #fdfbff;
    --md-sys-color-on-background: #1a1b1f;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Minimalist Header */
header {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    z-index: 2;
}

.logo {
    font-size: 24px;
    font-weight: 400;
    color: var(--md-sys-color-primary);
    letter-spacing: -0.5px;
}

/* Centered Layout */
.app-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    overflow: hidden;
    padding: 0 16px;
}

main {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Centered Upload Action */
.action-area {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    gap: 24px;
}

/* Prominent New Button */
.btn-fab {
    height: 64px;
    padding: 0 32px;
    border-radius: 20px;
    font-size: 16px;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* File List Area */
.file-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 24px 24px 0 0;
    border: 1px solid var(--md-sys-color-surface-variant);
    overflow: hidden;
}

.file-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.file-header {
    display: grid;
    grid-template-columns: 1fr 100px 120px 120px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--md-sys-color-surface-variant);
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-row {
    display: grid;
    grid-template-columns: 1fr 100px 120px 120px;
    padding: 12px 24px;
    align-items: center;
    border-bottom: 1px solid var(--md-sys-color-surface-variant);
    cursor: pointer;
    transition: background-color 0.1s;
}

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

.file-row.hidden {
    display: none;
}

.search-container {
    display: flex;
    align-items: center;
    background: var(--md-sys-color-surface-variant);
    padding: 4px 12px;
    border-radius: 8px;
    gap: 8px;
}

.search-container input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--md-sys-color-on-surface);
    width: 150px;
}

.title-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 15px;
    font-weight: 400;
    min-width: 0; /* Important for flex truncation */
}

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

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    min-width: 220px;
    box-shadow: 0px 8px 24px rgba(0,0,0,0.15);
    z-index: 10;
    border-radius: 12px;
    padding: 8px 0;
    margin-top: 12px;
    border: 1px solid var(--md-sys-color-surface-variant);
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: var(--md-sys-color-surface-variant);
}

/* Breadcrumbs */
#breadcrumb {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
}

.breadcrumb-item {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.breadcrumb-item:hover {
    color: var(--md-sys-color-primary);
    background: var(--md-sys-color-primary-container);
}

/* Utility */
.material-icons { font-size: 20px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    height: 48px;
    padding: 0 24px;
    border-radius: 12px;
    font-size: 14px;
}

.btn-primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.btn-primary:hover {
    background-color: #004a8a;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.btn-secondary {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface-variant);
}

.btn-secondary:hover {
    background-color: #d0d2dc;
}

/* Footer Links */
footer {
    padding: 16px;
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 12px;
}

footer a {
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Auth Overlay */
.auth-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--md-sys-color-background);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
}

/* Upload Progress Panel */
.upload-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
    border: 1px solid var(--md-sys-color-surface-variant);
    overflow: hidden;
}

.upload-panel.active { display: flex; }

.upload-panel-header {
    padding: 12px 16px;
    background: var(--md-sys-color-on-surface);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.upload-items-list {
    max-height: 300px;
    overflow-y: auto;
}

.upload-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--md-sys-color-surface-variant);
}

.upload-item-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
    gap: 8px;
}

.upload-item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-bar-container {
    height: 4px;
    background: var(--md-sys-color-surface-variant);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--md-sys-color-primary);
    width: 0%;
    transition: width 0.2s ease;
}

/* Drop Hint */

.drop-hint {

    font-size: 15px;

    color: var(--md-sys-color-outline);

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 0 24px;

    height: 48px;

    border: 1px dashed var(--md-sys-color-outline);

    border-radius: 20px;

    background: var(--md-sys-color-surface);

    box-sizing: border-box;

}



.drop-hint .material-icons {

    font-size: 24px;

    color: var(--md-sys-color-primary);

}



#dropzone {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 95, 176, 0.05);
    border: 4px dashed var(--md-sys-color-primary);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--md-sys-color-primary);
    pointer-events: none;
}

body.dragging #dropzone {
    display: flex;
}

/* Legal Pages */
.legal-page {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #fff;
    z-index: 3000;
    display: none;
    overflow-y: auto;
    padding: 40px 24px;
}

.legal-content {
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.legal-page.show { display: block; }

@media (max-width: 600px) {
    header { height: 60px; }
    .action-area { 
        flex-direction: column;
        padding: 20px 0; 
    }
    .drop-hint {
        display: none;
    }
    .file-header, .file-row {
        grid-template-columns: 1fr 80px;
        padding: 12px 16px;
    }
    .file-name {
        overflow: hidden;
    }
    .file-header span:nth-child(2),
    .file-header span:nth-child(3),
    .file-row div:nth-child(2),
    .file-row div:nth-child(3) {
        display: none;
    }
}
