/* Light mode (default) */
:root {
    --bg: #e0f7fa;
    --topbar-bg: #80a4c7;
    --text-color: #333333;
    --input-bg: #ffffff;
    --file-item-bg: #b5b5b5;
    --files-bg: #b7cece;
    --link-color: #007bff;
}

/* Dark mode override */
.dark-theme {
    --bg: #1e1e1e;
    --topbar-bg: #353535;
    --text-color: #f5f5f5;
    --input-bg: #2c2c2c;
    --file-item-bg: #3c3c3c;
    --files-bg: #3c3c3c;
    --link-color: #007bff;
}

body {
    font-family: system-ui, Arial, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
    min-height: 100vh;
}
input:not([type="file"]), select, textarea {
    border: 1px solid #ccc;
    padding: 5px;
    background-color: var(--input-bg);
    color: var(--text-color);
    border-radius: 5px;
}
button, input::file-selector-button {
    background-color: var(--input-bg);
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    color: var(--text-color);
}
a {
    color: var(--link-color);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
.content {
    padding: 20px;
}
#logo {
    font-weight: bold;
    background: linear-gradient(to right, #709aac, #0588ce);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.top-bar {
    background-color: var(--topbar-bg);
    padding: 5px;
    display: flex;
    align-items: center;
    height: 50px;
    gap: 20px;
}
.top-bar a {
    text-decoration: none;
    color: var(--link-color);
    font-weight: bold;
}
.file-item-name {
    display: flex;
    align-items: center;
    gap: 5px;
}
.file-item-name a {
    text-decoration: none;
    border: none;
    color: var(--text-color);
}
.file-item {
    border: 1px solid #ccc;
    padding: 0 0 0 5px;
    margin: 5px 0;
    border-radius: 8px;
    background-color: var(--file-item-bg);
    height: 30px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}
.file-item p {
    text-overflow: ellipsis;
    margin: 0;
}
.file-item p, .file-actions {
    display: flex;
}
.file-actions {
    height: 100%;
    align-items: center;
}
.file-item button {
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    cursor: pointer;
}
.file-item a {
    color: var(--text-color);
    text-decoration: none;
    border-left: 1px solid #ccc;
    background: none;
    cursor: pointer;
    height: 100%;
    padding: 0 5px;
    display: flex;
    align-items: center;
    background-color: var(--input-bg);
}
.file-item a:hover {
    background-color: #676767;
}
.file-item-link-corner {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}
.file-filtering, .file-upload-box {
    margin: 5px;
    background-color: var(--file-item-bg);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
}
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 20%;
    height: fit-content;
    float: left;
}
.sidebar * {
    padding-bottom: 5px;
}
.sidebar input:not([type="checkbox"]) {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.files {
    background-color: var(--files-bg);
    border-radius: 5px;
    margin: 5px;
    padding: 10px;
    float: right;
    width: 75%;
}

.flashes {
    list-style-type: none;
    padding: 5px;
    width: fit-content;
    border: 1px solid #ccc;
    background-color: var(--file-item-bg);
}
#file-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}
#file-viewer-content {
    background-color: rgb(41, 41, 41);
    border-radius: 10px;
    min-width: 15%;
    min-height: 15%;
    max-width: 80%;
    max-height: 80%;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#close-file-viewer {
    color: white;
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 20px;
}
#file-viewer-img {
    border-radius: 10px;
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    margin: 0 auto;
}
#file-viewer-text {
    display: none;
    background-color: rgb(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px;
    color: white;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    max-height: 100%;
}
#file-viewer-audio {
    display: none;
    min-width: 500px;
}

@media (max-width: 700px) {
    .sidebar {
        width: 100%;
        float: none;
    }
    .files {
        width: 100%;
        float: none;
    }
}