:root {
    --page-bg: #ffffff;
    --primary-bg: #c5d6e8;
    --secondary-bg: #d9d9d9;
    --text-main: #1b2026;
    --text-muted: #5f6469;
    --border-color: #dee2e6;

    --accent: #73ff84;
    --accent-hover: #21b43c;

    --link: var(--text-muted);
    --link-hover: #6078ff;

    --radius: 8px;
    --gap: 15px;
}

body {
    font-family: 'JetBrains Mono';
    font-size: 1rem;
}
input, textarea, button, select {
    font-family: inherit;
    font-size: inherit;
}
/* all links should be styled like this, unless explicitly styled differently (example: navbar) */
a {
    text-decoration: none;
    color: var(--link);
}
a:hover {
    color: var(--link-hover);
    cursor: pointer;
}
form {
    gap: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
form hr {
    width: 100%;
    display: block;
}

#err {
    color: red;
}

/* take up as much (horizontal) space as possible */
.max-fill {
    margin-left: auto;
}

.flex-col {
    display: flex;
    flex-direction: column;
}
.flex-row {
    display: flex;
    flex-direction: row;
}

.navbar {
    display: flex;
    background-color: var(--accent);
    align-items: center;
    margin-bottom: 10px;
}
.navitem {
    padding: 6px 12px;
    text-decoration: none;
    color: var(--text-main);
    white-space: nowrap;
}
.navitem:hover {
    background-color: var(--accent-hover);
    color: var(--text-main);
}
#nav-user {
    display: flex;
    align-items: center;
}

/* generic items */

/* will try to be on the right (by taking up all remaining horizontal space */
.date {
    margin-left: auto;
    font-weight: normal;
    color: var(--text-muted);
}

.link {
    text-decoration: none;
    color: var(--link);
}
.link:hover {
    color: var(--link-hover);
}

.text { /* maybe also make p do this */
    color: var(--text-main);
}

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

/* project banner */

.project-banner {
    font-size: 2em;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 15px 25px;
    border-bottom: 2px solid var(--border-color);
    
}

.project-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
}

/* update/log listings */

.update-listing {
    padding: 5px;
    gap: 10px;
    align-items: center;
    display: flex;
    background-color: var(--secondary-bg);
    margin-top: 10px;
}

.log-listing {
    padding: 5px;
    gap: 10px;
    align-items: center;
    display: flex;
    background-color: var(--primary-bg);
    margin-top: 10px;
}

/* these might not need to even exist, but... */

.log-listing-thumbnail {
    border-radius: var(--radius);
    width: 40px;
    height: 40px;
    object-fit: cover;
}

/* project list */

.project-list {
    margin: 5px;
    display: flex;
    flex-direction: column;
    /* background-color: var(--secondary-bg); */
}

.project-listing {
    padding: 5px;
    gap: 10px;
    align-items: center;
    display: flex;
    flex-direction: row;
    /* background-color: var(--secondary-bg); */
}

.project-listing:hover {
    background-color: var(--primary-bg);
}

.project-listing-thumb {
    width: 4rem;
    height: 4rem;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
}

/* Project */

.view-project-thumb {
    width: 8rem;
    height: 8rem;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
}

/* Log */

.log-content img {
    max-width: 100%;
    height: auto;
    max-height: 70vh;
    display: block;
    margin: 1.5rem /* auto */;
}
.log-content video {
    max-width: 70%;
    height: auto;
    max-height: 70vh;
    display: block;
    margin: 1.5rem auto;
}

/* EditLog */

.editor-layout-wrapper {
    display: grid;
    grid-template-columns: 1fr auto; /* 300px = sidebar width */
    gap: 20px;
    height: calc(100vh - 120px); /* 120px = magic number */
    box-sizing: border-box;
    overflow: hidden;
}
.main-editor-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
.editor-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

#uploaded-files {
    flex-grow: 1;
    overflow-y: auto; /* Scrollbar appears only when list overflows */
    padding-right: 5px;
}

/* Split screen layout */
.workspace-split {
    display: flex;
    gap: 20px;
    position: relative;
    flex-grow: 1; /* Tells workspace to eat up all vertical space left */
    height: 0;    /* Classic flexbox hack to force children to respect parent height constraint */
}

/* Force both panes to be exactly 50% width and match parent height */
.pane { 
    display: flex; 
    flex-direction: column; 
    width: 50%;
    height: 100%;
}

.pane label {
    margin-bottom: 5px;
    flex-shrink: 0;
}

/* Force textarea and preview box to handle their own scrolling */
.pane textarea, .preview-box {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 15px;
    border: 1px solid #ccc;
    background-color: var(--page-bg);
    border-radius: 4px;
    resize: none; /* Disables manual resizing handles which would break layout */
    overflow-y: auto; /* Separate individual scrollbars */
}

.preview-box { 
    background: #fafafa; 
}

/* Drag overlay fix */
.drag-overlay {
    display: none;
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 122, 204, 0.15); border: 2px dashed #007acc;
    justify-content: center; align-items: center; font-size: 1.5rem; color: #007acc;
    pointer-events: none; border-radius: 4px;
}
.workspace-split.drag-active .drag-overlay { display: flex; }

/* Sidebar Styles */
#media-sidebar {
    border-left: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    
    /* Animate the width and padding changes */
    width: 300px; 
    padding-left: 20px;
    transition: width 0.3s ease, padding 0.3s ease, border-color 0.3s ease;
}

/* Keeps elements from squishing or wrapping mid-animation */
.sidebar-inner-content {
    width: 280px; /* Width minus left padding */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

/* Collapsed State */
#media-sidebar.collapsed {
    width: 0px;
    padding-left: 0px;
    border-left-color: transparent; /* Smoothly hide the border line */
}

/* Comments */
.comment {
    padding: 10px;
    margin-bottom: 15px;
    background-color: var(--primary-bg);
}