/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  background-color: #f8f9fa;
  color: #212529;
  padding: 1rem;
}
.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

/* Container & Grid */
.container {
  max-width: 960px;
  margin: auto;
  padding: 1rem;
}
.row {
  display: flex;
  flex-wrap: wrap;
  margin: -0.5rem;
}
.col {
  flex: 1;
  padding: 0.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5rem;
  font-weight: 600;
}
p {
  margin-bottom: 1rem;
}

/* Buttons */
/* ========================================================================================================================= */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.btn-primary { background: #007bff; color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-danger { background: #dc3545; color: #fff; }
.btn:hover { opacity: 0.9; }
.btn-success { background-color: #28a745; color: #fff;}
.btn-success:hover {background-color: #218838;}

.btn-warning { background-color: #ffc107; color: #212529; }
.btn-warning:hover { background-color: #e0a800; color: #212529; }
.btn-info { background-color: #17a2b8; color: #fff; }
.btn-info:hover { background-color: #138496; color: #fff; }
.btn-dark { background-color: #343a40; color: #fff; }
.btn-dark:hover { background-color: #23272b; color: #fff; }


/* Forms */
input, select, textarea {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
  background: #fff;
  color: #212529;
}
.dark-mode input, .dark-mode textarea, .dark-mode select {
  background: #1e1e1e;
  color: #e0e0e0;
  border-color: #444;
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
}
.alert-success { background: #d4edda; color: #155724; }
.alert-danger  { background: #f8d7da; color: #721c24; }
.alert-info    { background: #d1ecf1; color: #0c5460; }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.15em 0.5em;
  font-size: 0.75rem;
  border-radius: 0.25rem;
  background: #007bff;
  color: #fff;
}
.badge-primary {
  background: #007bff;
  color: #fff;
}
.badge-secondary {
  background: #6c757d;
  color: #fff;
}
.badge-success {
  background: #28a745;
  color: #fff;
}
.badge-danger {
  background: #dc3545;
  color: #fff;
}
.badge-warning {
  background: #ffc107;
  color: #212529;
}
.badge-info {
  background: #17a2b8;
  color: #fff;
}
.badge-dark {
  background: #343a40;
  color: #fff;
}


/* Cards */
.card {
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fff;
}
.dark-mode .card {
  background: #1e1e1e;
  border-color: #444;
}

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.d-flex { display: flex; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }


/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  background-color: #fff;
}
th, td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid #dee2e6;
}
th {
  background-color: #f1f1f1;
  font-weight: 600;
}
.dark-mode table {
  background-color: #1e1e1e;
}
.dark-mode th {
  background-color: #2c2c2c;
  color: #e0e0e0;
}
.dark-mode td {
  color: #ccc;
  border-color: #444;
}


/* Modal Overlay */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0, 0, 0, 0.5);
}

/* Modal Content */
.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 1rem;
  border-radius: 0.25rem;
  max-width: 500px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
.dark-mode .modal-content {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

/* Close Button */
.modal-close {
  float: right;
  font-size: 1.25rem;
  font-weight: bold;
  cursor: pointer;
}
.modal-close:hover {
  color: #dc3545;
}

.context-menu {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 1000;
}
.context-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.context-menu li {
  padding: 0.5rem 1rem;
  cursor: pointer;
}
.context-menu li:hover {
  background-color: #f1f1f1;
}

.dark-mode .context-menu {
  background: #1e1e1e;
  border-color: #444;
}

/* Base UL/LI Reset */
ul {
  padding-left: 1.25rem;
   margin-bottom: 1rem; 
}
li {
  margin-bottom: 0.5rem;
}

ul li:hover {
  background-color: #f1f1f1;
  cursor: pointer;
}
.dark-mode ul li:hover {
  background-color: #2a2a2a;
}



/* Item-style List */
.item-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  background-color: #fff;
}
.item-list li {
  padding: 0.55rem 1rem;
  margin-top: 0.25rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.item-list li:last-child {
  border-bottom: none;
}
.item-list .item-name {
  font-weight: 500;
}
.item-list .item-meta {
  font-size: 0.875rem;
  color: #6c757d;
}

.item-list li:hover {
  background-color: #f9f9f9;
}
.dark-mode .item-list li:hover {
  background-color: #2c2c2c;
}



/* Inline List (e.g. nav pills) */
.inline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1rem;
}
.inline-list li {
  display: inline;
}

/* Menu-style List */
.menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.menu-list li {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
}
.menu-list li:hover {
  background-color: #f1f1f1;
}


.dark-mode .menu-list li:hover {
  background-color: #333;
}

/* Dark Mode Support */
.dark-mode .file-list {
  background-color: #1e1e1e;
  border-color: #444;
}
.dark-mode .file-list li {
  border-bottom: 1px solid #333;
}
.dark-mode .file-meta {
  color: #aaa;
}
.dark-mode .menu-list li {
  border-color: #333;
}
.dark-mode .menu-list li:hover {
  background-color: #2a2a2a;
}



/* Dropdown Section */
.dropdown-section {
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
  background-color: #fff;
  overflow: hidden;
  transition: border-color 0.3s ease;
}
.dropdown-header {
  padding: 0.75rem 1rem;
  font-weight: 600;
  cursor: pointer;
  background-color: #f8f9fa;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dropdown-header:hover {
  background-color: #e9ecef;
}

/* Arrow Indicator */
.dropdown-arrow {
  transition: transform 0.3s ease;
}
.dropdown-section.active .dropdown-arrow {
  transform: rotate(90deg);
}

/* Dropdown Content with Smooth Transition */
.dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  padding: 0 1rem;
}
.dropdown-section.active .dropdown-content {
  max-height: 500px; /* enough to show full content */
  padding: 0.5rem 1rem;
}

/* Dark Mode */
.dark-mode .dropdown-section {
  background-color: #1e1e1e;
  border-color: #444;
}
.dark-mode .dropdown-header {
  background-color: #2a2a2a;
  color: #e0e0e0;
  border-bottom-color: #333;
}
.dark-mode .dropdown-header:hover {
  background-color: #3a3a3a;
}
.dark-mode .dropdown-content {
  color: #ccc;
}