/* Classic Windows & VdS App Theme CSS */
:root {
  --bg-primary: #f0f0f0;      /* Standard Windows gray background */
  --bg-secondary: #e0e0e0;    /* Slightly darker gray for headers and panels */
  --bg-tertiary: #ffffff;     /* White background for inputs, grids, and cards */
  --text-primary: #000000;    /* Black text */
  --text-secondary: #555555;  /* Gray for labels */
  --accent-blue: #0066cc;     /* Classic Windows active/highlight blue */
  --accent-yellow: #ffffc0;   /* VdS signature warm yellow toolbar background */
  --border-color: #b0b0b0;    /* Classic thin gray borders */
  --border-light: #d4d0c8;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border: 1px solid var(--border-color);
}
::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

/* Application Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

/* Menu Bar */
.menu-bar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 4px 15px;
  display: flex;
  gap: 15px;
  font-size: 13px;
  box-sizing: border-box;
}

.menu-item-top {
  color: var(--text-primary);
  cursor: pointer;
  padding: 2px 6px;
}

.menu-item-top:hover {
  background-color: var(--accent-blue);
  color: white;
}

/* Yellow Toolbar */
.toolbar-vds {
  background-color: var(--accent-yellow);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.toolbar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-vds {
  background: #f0f0f0;
  color: #000000;
  border: 1px solid #707070;
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 2px;
  box-shadow: inset 0 1px 0 white, 0 1px 2px rgba(0,0,0,0.1);
}

.btn-vds:hover {
  background-color: #e5e5e5;
  border-color: #505050;
}

.btn-vds:active {
  background-color: #d8d8d8;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.btn-vds-accent {
  background-color: #e3f2fd;
  border-color: #1e88e5;
}
.btn-vds-accent:hover {
  background-color: #bbdefb;
}

/* VdS Logo Badge */
.vds-badge-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vds-logo-text {
  font-family: "Impact", "Arial Black", sans-serif;
  font-size: 26px;
  font-weight: bold;
  color: #002288;
  border: 2px solid #002288;
  padding: 0px 8px;
  border-radius: 4px;
  background-color: white;
  line-height: 1;
}

.vds-brand-text {
  font-size: 11px;
  font-weight: bold;
  color: #002288;
  text-align: right;
  line-height: 1.2;
}

/* VdS Folder Tabs Navigation */
.tabs-navigation {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 10px 0 10px;
  display: flex;
  gap: 2px;
  box-sizing: border-box;
}

.tab-btn {
  background-color: #e0e0e0;
  border: 1px solid var(--border-color);
  border-bottom: none;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  color: var(--text-secondary);
  position: relative;
  top: 1px;
  z-index: 1;
}

.tab-btn:hover {
  background-color: #eaeaea;
  color: var(--text-primary);
}

.tab-btn.active {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--bg-primary);
  color: var(--text-primary);
  font-weight: bold;
  z-index: 2;
}

/* Main Workspace Viewport */
.main-workspace {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.tab-content {
  flex: 1;
  display: none;
  width: 100%;
  height: 100%;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* Classic Form Card (Flat Panel) */
.vds-panel {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 18px;
  margin-bottom: 15px;
  box-sizing: border-box;
  width: 100%;
}

.panel-title {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 13px;
  font-weight: bold;
  color: #002288;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 5px;
  text-transform: uppercase;
}

/* Form layouts */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
}

.form-control {
  background-color: var(--bg-tertiary);
  border: 1px solid #909090;
  color: var(--text-primary);
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  border-radius: 2px;
}

.form-control:focus {
  border-color: var(--accent-blue);
  outline: none;
}

.form-control[readonly] {
  background-color: #e9e9e9;
  color: #555555;
  border-color: #c0c0c0;
}

/* Custom Table style */
.vds-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  background-color: white;
}

.vds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.vds-table th {
  background-color: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  padding: 6px 10px;
  color: var(--text-primary);
  font-weight: bold;
  text-align: left;
  font-size: 12px;
}

.vds-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #e0e0e0;
  border-right: 1px solid #e0e0e0;
}

.vds-table tr:hover {
  background-color: #f5f9ff;
}

.vds-table .form-control {
  padding: 2px 4px;
  font-size: 12px;
  border: 1px solid transparent;
  background-color: transparent;
}

.vds-table .form-control:focus, .vds-table tr:hover .form-control {
  border: 1px solid #909090;
  background-color: white;
}

/* Split-screen CAD Graphic Tab */
.cad-split-layout {
  display: flex;
  height: calc(100vh - 150px);
  width: 100%;
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  box-sizing: border-box;
  overflow: hidden;
}

.cad-sidebar {
  width: 320px;
  min-width: 320px;
  border-right: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 10px;
}

.cad-viewport-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: white;
}

.cad-canvas-toolbar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 5px 10px;
  display: flex;
  gap: 5px;
  align-items: center;
}

.cad-btn-icon {
  background-color: white;
  border: 1px solid #707070;
  cursor: pointer;
  padding: 3px 6px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

.cad-btn-icon:hover {
  background-color: #e0e0e0;
}

.cad-btn-icon.active {
  background-color: #ffffc0;
  border-color: #d0a000;
  font-weight: bold;
}

.cad-btn-delete {
  border-color: #d32f2f;
  color: #d32f2f;
}
.cad-btn-delete:hover {
  background-color: #ffebee;
}

.cad-btn-add {
  border-color: #fbc02d;
  color: #f57f17;
  background-color: #fffde7;
}
.cad-btn-add:hover {
  background-color: #fff9c4;
}

#simulation-container {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  background-color: white;
  overflow: hidden;
}

/* CAD Sidebar section property table styling */
.cad-prop-section {
  border: 1px solid var(--border-color);
  background-color: white;
  padding: 10px;
  margin-top: 10px;
}

.cad-prop-title {
  font-weight: bold;
  font-size: 12px;
  margin-bottom: 8px;
  color: #002288;
}

/* Direction Picker Radio Buttons Grid */
.dir-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  padding: 8px;
  background-color: white;
}

.dir-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

.dir-option input {
  margin: 0;
  cursor: pointer;
}

/* Modal Backdrops */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: white;
  border: 1px solid #707070;
  border-radius: 4px;
  width: 500px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

.modal-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 15px;
  font-weight: bold;
  font-size: 14px;
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 10px 15px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Alert styles */
.alert-vds {
  border: 1px solid #d4d0c8;
  padding: 10px;
  margin-bottom: 15px;
  font-size: 13px;
}

.alert-vds-success {
  background-color: #e8f5e9;
  border-color: #a5d6a7;
  color: #2e7d32;
}

.alert-vds-error {
  background-color: #ffebee;
  border-color: #ef9a9a;
  color: #c62828;
}

/* Help Dropdown Styles */
.dropdown-vds {
  position: relative;
  display: inline-block;
}

.dropdown-content-vds {
  display: none;
  position: absolute;
  background-color: var(--bg-primary);
  min-width: 190px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  z-index: 1005;
  top: 100%;
  left: 0;
  border-radius: 2px;
}

.dropdown-content-vds a {
  color: var(--text-primary);
  padding: 8px 12px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: inherit;
  transition: background-color 0.1s ease;
}

.dropdown-content-vds a i {
  font-size: 13px;
  width: 16px;
  text-align: center;
  color: var(--accent-blue);
}

.dropdown-content-vds a:hover {
  background-color: var(--accent-blue);
  color: white !important;
}

.dropdown-content-vds a:hover i {
  color: white !important;
}

.dropdown-vds:hover .dropdown-content-vds {
  display: block;
}
