/* Menu Bar Styles */
.menu-bar {
  background-color: #f8f8f8;
  border-bottom: 1px solid #ddd;
  position: relative;
  height: 36px;
  user-select: none;
}

/* Error Toast Notification */
.error-toast {
  position: fixed;
  top: 50px;
  right: 20px;
  background-color: #f44336;
  color: white;
  padding: 15px 20px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 9999;
  max-width: 300px;
  animation: fadeInOut 5s forwards;
}

/* Success Toast Notification */
.success-toast {
  position: fixed;
  top: 50px;
  right: 20px;
  background-color: #4caf50;
  color: white;
  padding: 15px 20px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 9999;
  max-width: 300px;
  animation: fadeInOut 5s forwards;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-20px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}

.menu-items {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}

.menu-item {
  position: relative;
  height: 100%;
}

.menu-trigger {
  display: inline-block;
  padding: 0 1rem;
  line-height: 36px;
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
}

.menu-trigger:hover,
.menu-item.active .menu-trigger {
  background-color: #e0e0e0;
}

.dropdown-menu,
.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  min-width: 200px;
  background: white;
  border: 1px solid #ccc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 1000;
  padding: 4px 0;
}

.menu-item:hover > .dropdown-menu,
li:hover > .submenu {
  display: block;
}

.dropdown-menu li {
  position: relative;
  display: flex;
  align-items: center;
}

.dropdown-menu a {
  flex: 1;
  display: block;
  padding: 0.5rem 1rem;
  padding-right: 3rem; /* Make room for shortcuts */
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
}

.dropdown-menu a:hover {
  background-color: #f0f0f0;
}

.dropdown-menu li:hover {
  background-color: #f0f0f0;
}

.shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 0.8rem;
  pointer-events: none;
}

.submenu {
  left: 100%;
  top: 0;
  position: absolute;
  display: none;
  background-color: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  min-width: 150px;
  z-index: 1001;
  padding: 4px 0;
}

.submenu-trigger::after {
  content: "›";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.menu-separator {
  height: 1px;
  background-color: #e0e0e0;
  margin: 4px 0;
}

/* Disabled menu items */
a.disabled {
  color: #aaa;
  pointer-events: none;
}

/* Admin only items */
.admin-only {
  display: none; /* Hidden by default, JS will show for admin users */
}

/* App container */
#app-wrapper {
  display: flex;
  flex-direction: column;
}

/* List type icon */
.list-type-icon {
  font-size: 1.5rem;
  margin-left: 0.75rem;
}

/* User badge */
.user-badge {
  padding: 0.25rem 0.5rem;
  background: #f0f0f0;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
}

/* Tool-specific styles */
/* Modal dialogs */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.4);
  overflow: auto;
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 0;
  border: 1px solid #888;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  width: 80%;
  max-width: 600px;
  border-radius: 4px;
}

.wide-modal {
  max-width: 80%;
}

.modal-header {
  padding: 1rem;
  background-color: #f8f8f8;
  border-bottom: 1px solid #ddd;
  position: relative;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-body {
  padding: 1rem;
}

.modal-footer {
  padding: 1rem;
  border-top: 1px solid #ddd;
  text-align: right;
}

.close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Modal Dialog */
.modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  z-index: 1002;
  min-width: 400px;
  max-width: 80vw;
  max-height: 80vh;
  overflow: auto;
}

.modal-header {
  padding: 12px 20px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 12px 20px;
  background-color: #f5f5f5;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
}

.close-btn:hover {
  color: #333;
}

.primary-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.primary-btn:hover {
  background-color: #0069d9;
}

.secondary-btn {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.secondary-btn:hover {
  background-color: #5a6268;
}

/* New Field Dialog Styles */
.success-btn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.success-btn:hover {
  background-color: #218838;
}

.cancel-btn {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.cancel-btn:hover {
  background-color: #5a6268;
}

#new-field-dialog .form-group {
  margin-bottom: 1rem;
}

#new-field-dialog .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

#new-field-dialog .form-group input,
#new-field-dialog .form-group select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

#new-field-dialog .form-group input:focus,
#new-field-dialog .form-group select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Enhanced field dialog styles */
.field-dialog .form-group {
  margin-bottom: 15px;
}

.field-dialog .form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.field-dialog .form-group input,
.field-dialog .form-group select,
.field-dialog .form-group textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}

.field-dialog .form-group small {
  display: block;
  margin-top: 5px;
  color: #666;
  font-size: 0.85em;
}

.field-dialog .form-group.mutually-exclusive {
  border-left: 3px solid #007acc;
  padding-left: 10px;
  margin-left: 5px;
}

.field-dialog .form-group.mutually-exclusive label {
  color: #007acc;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
}

.btn {
  padding: 0.5rem 1rem;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
}

.btn-primary {
  background-color: #4a90e2;
  border-color: #3672b0;
  color: white;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab.active {
  border-bottom: 2px solid #4a90e2;
  font-weight: bold;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Tables */
.fields-table,
.totals-table,
.rasci-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.fields-table th,
.fields-table td,
.totals-table th,
.totals-table td,
.rasci-table th,
.rasci-table td {
  padding: 0.5rem;
  border: 1px solid #ddd;
}

.fields-table th,
.totals-table th,
.rasci-table th {
  background-color: #f8f8f8;
  text-align: left;
}

.total-value {
  text-align: right;
  font-weight: bold;
}

/* Color picker */
.color-picker-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.color-preview {
  width: 100%;
  height: 2rem;
  border: 1px solid #ddd;
  margin-bottom: 0.5rem;
}

.color-sliders {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.color-slider {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.color-swatch {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 3px;
  border: 1px solid #ddd;
  cursor: pointer;
}

.color-swatch.transparent {
  background-image: linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%), 
                    linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%);
  background-size: 10px 10px;
  background-position: 0 0, 5px 5px;
}

/* RASCI Matrix */
.task-column {
  min-width: 200px;
}

.rasci-cell {
  text-align: center;
  font-weight: bold;
}

.rasci-cell.has-role {
  background-color: #e6f3ff;
}

.rasci-legend {
  margin-top: 2rem;
  padding: 1rem;
  background-color: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 4px;
}

/* Timeline */
.timeline-container {
  position: relative;
  width: 100%;
  height: 300px;
  margin: 2rem 0;
  border: 1px solid #ddd;
  background-color: #fafafa;
  overflow-x: auto;
}

.timeline {
  position: relative;
  height: 250px;
  padding: 20px 0;
}

.timeline-item {
  position: absolute;
  transform: translateX(-50%);
}

.timeline-item-content {
  position: relative;
  padding: 0.5rem;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 150px;
}

.timeline-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #999;
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
}

.timeline-months {
  position: relative;
  height: 30px;
  border-top: 1px solid #ddd;
}

.month-marker {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: #666;
  padding-top: 4px;
}

.timeline-date {
  font-size: 0.8rem;
  color: #666;
  margin: 0;
}

.timeline-label {
  font-weight: bold;
  margin: 0.25rem 0;
}

.timeline-status {
  font-size: 0.8rem;
  color: #333;
  margin: 0;
}

.status-complete {
  background-color: #4caf50;
}

.status-progress {
  background-color: #2196f3;
}

.status-pending {
  background-color: #ff9800;
}

.status-delayed {
  background-color: #f44336;
}

.timeline-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.legend-items {
  display: flex;
  gap: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Progress bar */
.progress-bar-container {
  width: 100%;
  height: 1.5rem;
  background-color: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar {
  height: 100%;
  background-color: #4caf50;
}

.progress-info {
  margin-bottom: 2rem;
}

.progress-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

/* About dialog */
.about-content {
  max-width: 500px;
  margin: 0 auto;
}

/* Shortcuts dialog */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
}

.shortcuts-table td {
  padding: 0.25rem 0;
}

.shortcuts-table td:first-child {
  font-family: monospace;
  white-space: nowrap;
  padding-right: 1rem;
}

/* Checklists Dropdown Menu */
.checklists-dropdown {
  background: white;
  border: 1px solid #ccc;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  border-radius: 4px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1001;
}

.checklists-dropdown .dropdown-header {
  padding: 8px 10px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 2;
}

.checklists-dropdown .dropdown-search {
  padding: 8px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 35px;
  background: white;
  z-index: 2;
}

.checklists-dropdown .checklist-item {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.checklists-dropdown .checklist-item:hover {
  background-color: #f0f7ff;
}

.checklists-dropdown .checklist-item:active {
  background-color: #e0e0e0;
}

.checklists-dropdown #checklist-search {
  width: 100%;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 3px;
  box-sizing: border-box;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .menu-trigger {
    padding: 0 0.5rem;
  }
  
  .shortcut {
    display: none;
  }
  
  .modal-content {
    width: 95%;
    margin: 5% auto;
  }
  
  .wide-modal {
    max-width: 95%;
  }
}

/* New field dialog specific styles */
#new-field-dialog {
  max-height: 90vh;
  overflow-y: auto;
  width: 500px;
  max-width: 90vw;
}

#new-field-dialog .modal-body {
  max-height: 70vh;
  overflow-y: auto;
  padding: 20px;
}

#new-field-dialog .form-group {
  margin-bottom: 15px;
}

#new-field-dialog .form-group:last-child {
  margin-bottom: 0;
}

#new-field-dialog textarea {
  resize: vertical;
  min-height: 80px;
}
