/*
  assets/css/style.css
  Reverted Stable Version: 2025-02-12 (Original)
  Minimal Updated Version: 2025-02-24

  PURPOSE:
    - Provides complete styling for the web-based text editor.
    - Original layout includes a header, an editor panel (with tab container, editor area,
      line numbers, and status bar), and a history (document list) panel.
    - This version adds only minimal modifications:
         1. Dark mode support: When the body has the "dark-mode" class, backgrounds, borders, 
            and text colors are adjusted accordingly.
         2. Optional styling for a drag & drop zone.
    - All other styles remain as in your original working version.
*/

/* RESET & BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: Arial, sans-serif;
}

/* DARK MODE STYLES (ADDED) */
body.dark-mode {
    background-color: #333;
    color: #fff;
}
body.dark-mode .header {
    background-color: #444;
    border-bottom: 1px solid #555;
}
body.dark-mode .editor-panel {
    background-color: #2f2f2f;
    border-right: 1px solid #555;
}
body.dark-mode .history-panel {
    background-color: #2f2f2f;
    color: #fff;
}
body.dark-mode input.header-title {
    color: #fff;
}

/* HEADER */
.header {
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
    position: relative;
}

.header-title {
    font-size: 24px;
    font-weight: bold;
    width: 60%;
}

/* MAIN CONTAINER: TWO PANELS */
.main-container {
    display: flex;
    height: calc(100vh - 70px); /* Leaves space for the header */
}

/* EDITOR PANEL (LEFT) */
.editor-panel {
    width: 80%;
    padding: 15px;
    border-right: 1px solid #e9ecef;
    overflow: hidden; /* Scrolling is handled within the editor area */
    position: relative;
}

/* TAB CONTAINER INSIDE THE EDITOR PANEL */
.tab-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

#documentTabs {
    flex-grow: 1;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

#documentTabs li {
    margin-right: 2px;
}

#tabActions {
    margin-left: auto;
}

.tab-content {
    position: relative;
}

#placeholderMessage {
    padding: 20px;
    color: #888;
}

/* HISTORY PANEL (RIGHT) */
.history-panel {
    width: 22%;
    min-width: 385px;
    padding: 10px;
    overflow: auto;
    box-sizing: border-box;
}

.history-item {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.history-item .open-document {
    flex-grow: 1;
    text-align: left;
    cursor: pointer;
}

.history-versions {
    margin-top: 10px;
}

.version-item {
    border-bottom: 1px solid #e9ecef;
    padding: 5px 0;
}

.open-version {
    cursor: pointer;
}

/* EDITOR CONTAINER (Within each Tab) */
.editor-container {
    display: flex;
    height: calc(80vh - 140px);  /* Adjust height as needed */
    overflow: auto;
    border: 1px solid #ddd;
    position: relative;
}

/* LINE NUMBERS COLUMN */
.line-numbers {
    width: 60px;               /* Increased from 40px to support larger numbers */
    background: #eee;
    padding: 5px;
    text-align: right;
    border-right: 1px solid #ccc;
    font-family: monospace;
    overflow: hidden;
}

/* TEXT AREA COLUMN */
.editor-textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    padding: 5px;
    font-family: monospace;
    overflow: auto;
}

/* STATUS BAR BELOW THE EDITOR */
.editor-status {
    padding: 5px;
    font-size: 0.9em;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    text-align: right;
}

/* DRAG & DROP ZONE (OPTIONAL) */
#dropZone {
    border: 2px dashed #ccc;
    background-color: #fafafa;
    margin-top: 10px;
    padding: 20px;
    text-align: center;
}

/* Additional styles for modals, context menus, etc., remain as originally provided */
