/* ---------------------------
   1. GLOBAL RESET & THEMES
---------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:focus {
  outline: 3px solid #5c9aed;
}

/* ---------------------------
   2. HEADER & THEME SWITCH
---------------------------- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #76b2fe, #b69efe);
  padding: 1rem 2rem;
  color: #fff;
}
.app-header h1 {
  font-size: 1.4rem;
  font-weight: 600;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  margin-right: 0.5rem;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  top: 0; left: 0; right: 0; bottom: 0;
  transition: .4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 4px; bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #555;
}
input:checked + .slider:before {
  transform: translateX(24px);
}
.switch-label {
  vertical-align: middle;
}

/* ---------------------------
   3. MAIN CONTAINER & TABS
---------------------------- */
.main-container {
  width: 90%;
  max-width: 900px;
  margin: 1rem auto;
  background-color: #fff;
  color: #333;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  transition: background-color 0.3s, color 0.3s;
}
.dark-mode .main-container {
  background-color: #2c2c2c;
  color: #fff;
}
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.tab-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background-color: #eee;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}
.tab-btn:hover {
  background-color: #ddd;
}
.tab-btn.active {
  background-color: #5c9aed;
  color: #fff;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* ---------------------------
   4. TASKS TAB
---------------------------- */
.category-board-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
#categoryFilterSelect {
  padding: 0.4rem 0.6rem;
}
#manageCategoriesBtn {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  border: none;
  background-color: #5c9aed;
  color: #fff;
  border-radius: 4px;
}
#manageCategoriesBtn:hover {
  background-color: #4a86d7;
}
.search-filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
#searchInput,
#filterSelect {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}
.dark-mode #searchInput,
.dark-mode #filterSelect {
  background-color: #3a3a3a;
  color: #fff;
  border: 1px solid #555;
}
.input-section {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}
#taskInput {
  flex: 2;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.dark-mode #taskInput {
  background-color: #3a3a3a;
  color: #fff;
  border: 1px solid #555;
}
#prioritySelect,
#newTaskCategorySelect,
#deadlineInput,
#recurrenceSelect {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.dark-mode #prioritySelect,
.dark-mode #newTaskCategorySelect,
.dark-mode #deadlineInput,
.dark-mode #recurrenceSelect {
  background-color: #3a3a3a;
  color: #fff;
  border: 1px solid #555;
}
#addBtn {
  padding: 0.5rem 1rem;
  cursor: pointer;
  background-color: #5c9aed;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-weight: 600;
}
#addBtn:hover {
  background-color: #4a86d7;
}
.bulk-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.bulk-actions button {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  background-color: #eee;
  color: #333;
  transition: background-color 0.2s;
}
.bulk-actions button:hover {
  background-color: #ddd;
}
.bulk-actions .danger {
  background-color: #dc3545;
  color: #fff;
}
.bulk-actions .danger:hover {
  background-color: #c82333;
}

/* Each task <li> is a row with two columns: subtasks left, main row right. */
#taskList li.task-item-row {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  background-color: #f7f7f7;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  position: relative;
  transition: background-color 0.2s;
}
.dark-mode #taskList li.task-item-row {
  background-color: #3a3a3a;
}
.subtasks-column {
  width: 200px;
  padding: 0.5rem;
  background-color: #fafafa;
  border-right: 1px solid #ddd;
}
.dark-mode .subtasks-column {
  background-color: #4a4a4a;
  border-right: 1px solid #666;
}
.subtask-list-left {
  list-style: none;
  margin: 0;
  padding: 0;
}
.subtask-item-left {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
}
.main-task-column {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.task-checkbox {
  transform: scale(1.2);
  margin-right: 0.5rem;
}
.task-text {
  flex: 1;
  cursor: pointer;
  word-wrap: break-word;
}
.completed {
  text-decoration: line-through;
  opacity: 0.7;
}
.priority-label {
  font-size: 0.75rem;
  margin-left: auto;
  margin-right: 0.5rem;
}
.high-priority {
  font-weight: 700;
  color: #dc3545;
}
.medium-priority {
  font-weight: 700;
  color: #ffc107;
}
.low-priority {
  font-weight: 700;
  color: #28a745;
}
.deadline {
  font-size: 0.75rem;
}
.deadline-warning {
  color: #dc3545;
}
.task-btn {
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
}
.details-btn {
  background-color: #17a2b8;
  color: #fff;
  margin-left: auto;
}
.details-btn:hover {
  background-color: #138496;
}
.delete-btn {
  background-color: #dc3545;
  color: #fff;
}
.delete-btn:hover {
  background-color: #c82333;
}
.dragging {
  opacity: 0.3;
}
.drag-over {
  outline: 2px dashed #5c9aed;
}

/* --- ANALYTICS TAB --- */
#analyticsTab {
  padding: 1rem 0;
}
.analytics-summary {
  margin-bottom: 1rem;
}
.analytics-summary p {
  margin-bottom: 0.5rem;
}
#categoryChartsContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.category-chart-block {
  width: 300px;
  text-align: center;
  background: #f2f2f2;
  border-radius: 6px;
  padding: 0.5rem;
}
.dark-mode .category-chart-block {
  background: #3a3a3a;
}

/* --- EXPORT/IMPORT TAB --- */
#exportImportTab {
  padding: 1rem 0;
}
.export-section,
.import-section {
  margin-bottom: 1rem;
}
#importFile {
  margin-left: 1rem;
}

/* --- MODALS (Categories, Task Details) --- */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; width: 100%; height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}
.modal.active {
  display: block;
}
.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 1rem;
  border-radius: 8px;
  width: 400px;
  position: relative;
}
.modal-large {
  width: 600px;
  max-width: 90%;
}
.dark-mode .modal-content {
  background-color: #2c2c2c;
  color: #fff;
}
.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Categories Modal */
#categoriesModal .new-category-row {
  display: flex;
  margin-top: 1rem;
  gap: 0.5rem;
}
#categoriesList {
  list-style: none;
  margin-top: 1rem;
}
#categoriesList li {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}
.category-delete-btn {
  margin-left: auto;
  background-color: #dc3545;
  color: #fff;
  border: none;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}
.category-delete-btn:hover {
  background-color: #c82333;
}

/* Task Details Modal */
.subtasks-section,
.dependencies-section,
.comments-attachments-section {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ccc;
}
.subtasks-section ul,
.dependencies-section ul,
.comments-attachments-section ul {
  list-style: none;
  margin-top: 0.5rem;
}
.new-subtask-row,
.new-attachment-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.new-subtask-row input,
.new-attachment-row input,
#newCommentInput {
  flex: 1;
  padding: 0.4rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.dark-mode .new-subtask-row input,
.dark-mode .new-attachment-row input,
.dark-mode #newCommentInput {
  background-color: #3a3a3a;
  color: #fff;
  border: 1px solid #555;
}
#addSubtaskBtn,
#addCommentBtn,
#addAttachmentBtn {
  padding: 0.4rem 0.6rem;
  border: none;
  border-radius: 4px;
  background-color: #5c9aed;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

/* Attachment link */
.attachment-link {
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
}

/* Dependencies List */
#dependenciesList li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dependency-checkbox {
  transform: scale(1.1);
}

/* =========================
   1) VIDEO BUTTON
   (top-right in header or wherever you placed it)
   ========================= */
   #openVideoBtn {
    background-color: #5c9aed;
    color: #fff;
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-left: 0.5rem; /* if you want a gap from theme toggle */
  }
  #openVideoBtn:hover {
    background-color: #4a86d7;
  }
  
  /* =========================
     2) FLOATING VIDEO CONTAINER
     ========================= */
  .hidden {
    display: none !important;
  }
  
  /* Floating Video Container */
.floating-video-container {
  position: fixed;
  top: 100px;
  left: 100px;
  width: 360px;
  height: 200px;
  background-color: #1f1f1f;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
}

/* Video and iframe */
#videoElement, #iframeElement {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  display: block;
  object-fit: contain;
}

/* Top bar for dragging */
.video-drag-handle {
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Buttons */
#muteVideoBtn, #closeVideoBtn {
  background: #444;
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}
#muteVideoBtn:hover, #closeVideoBtn:hover {
  background: #555;
}

  /* =========================
     3) FOUR CORNER HANDLES
     ========================= */
  /* The invisible corner handle */
.video-resize-handle {
  position: absolute;
  width: 6px;        /* small clickable area */
  height: 6px;
  background-color: transparent; /* no color, effectively invisible */
  z-index: 10;
  pointer-events: auto; /* ensure we can click it */
}

/* top-left corner */
.video-resize-handle.top-left {
  top: 0; 
  left: 0;
  cursor: nwse-resize;
  /* remove or minimize margins if you want 
     e.g. margin-top: 0.3rem; margin-left: 0.3rem; */
}

/* top-right corner */
.video-resize-handle.top-right {
  top: 0; 
  right: 0;
  cursor: nesw-resize;
}

/* bottom-left corner */
.video-resize-handle.bottom-left {
  bottom: 0; 
  left: 0;
  cursor: nesw-resize;
}

/* bottom-right corner */
.video-resize-handle.bottom-right {
  bottom: 0; 
  right: 0;
  cursor: nwse-resize;
}

/* optional hover effect 
   If you truly want it invisible, remove this 
*/
.video-resize-handle:hover {
  background-color: rgba(255,255,255,0.1);
}
#export-reminder {
  animation: fade-in 0.3s ease-in-out;
}

@keyframes fade-in {
  from {
      opacity: 0;
      transform: translateY(100%);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

#export-reminder button {
  border: none;
  background: none;
  cursor: pointer;
  font-weight: bold;
  color: inherit;
}
/* Shared Typography */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

:root {
  --background-color: #f4f4f4;
  --text-color: #333;
}

body.dark-mode {
  --background-color: #121212;
  --text-color: #e0e0e0;
}

/* Shared Section Styles */
section {
  padding: 20px;
  margin: 20px auto;
  max-width: 800px;
  background: var(--background-color);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

section h2 {
  color: var(--text-color);
  margin-bottom: 10px;
  border-bottom: 2px solid #007BFF;
  padding-bottom: 5px;
}

section p, section ul {
  margin-bottom: 20px;
  line-height: 1.6;
}

/* Navigation Bar */
.modern-nav {
  display: flex;
  justify-content: center;
  background: linear-gradient(45deg, #007BFF, #0056b3);
  padding: 10px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modern-nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  gap: 20px;
}

.modern-nav .nav-link {
  text-decoration: none;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 5px;
  transition: all 0.3s ease-in-out;
}

.modern-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.modern-nav .nav-link.active {
  background: #fff;
  color: #0056b3;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transform: scale(1.1);
}




