/* Layout Panels */
body {
  font-family: Arial, sans-serif;
  background: #f4f4f4;
  margin: 0;
  padding: 0;
}

/* 🎨 Cache-buster: v20250104-borders */

/* Top Navbar */
.navbar {
  background-color: #334155;
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  min-height: 50px;
  box-sizing: border-box; /* Ensure padding is included in width */
}

.navbar-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-grow: 1;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  max-width: calc(100% - 200px); /* Reserve space for logo and logout */
}

.navbar-links a {
  color: white;
  text-decoration: none;
  font-size: 16px;
}

.navbar-links a:hover {
  color: #cbd5e1;
}

.logo {
  font-size: 20px;
  font-weight: bold;
}

.user-profile {
  display: flex;
  align-items: center;
  margin-left: 20px;
  min-width: 80px; /* Ensure logout button always has space */
}

.user-profile a {
  color: white;
  text-decoration: none;
  font-size: 16px;
  padding: 8px 16px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s;
  white-space: nowrap; /* Prevent text wrapping */
}

.user-profile a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}



/* Layout Wrapper & Panels */
.content-wrapper {
  padding-top: 60px;
}

.container {
  display: flex;
  min-height: calc(100vh - 60px);
}

.left-panel {
  width: 250px;
  background: #2c3e50;
  color: white;
  padding: 20px;
  border-right: 3px solid #4fc3f7;
  box-shadow: 3px 0 10px rgba(0, 0, 0, 0.1);
}

.middle-panel {
  flex: 1;
  background: white;
  padding: 30px;
  overflow-y: auto;
  border-right: 3px solid #e0e0e0;
  box-shadow: 3px 0 8px rgba(0, 0, 0, 0.05);
}

.right-panel {
  width: 25%;
  background: #ecf0f1;
  padding: 20px;
  overflow-y: auto;
  border-left: 1px solid #d0d0d0;
}

/* Sidebar Navigation */
.step-list {
  list-style: none;
  padding-left: 0;
  margin-top: 20px;
}

.step-list li {
  margin-bottom: 12px;
  padding: 8px 0;
}

.step-list a {
  color: white;
  text-decoration: none;
  display: block;
  padding: 6px 12px;
  border-radius: 4px;
}

.step-list a:hover {
  background-color: #475569; /* Slate-600 */
}

.step-list a.active {
  font-weight: bold;
  background-color: #2563eb; /* Consistent blue */
  color: #fff;
}

/* KPI Cards & Panels */
.kpi-card-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.kpi-card {
  background: #f9f9f9;
  border-left: 5px solid #3498db;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.ai-insights {
  list-style-type: disc;
  padding-left: 20px;
}

/* Button Styles */
.toggle-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
}

.toggle-btn:hover {
  background: #0056b3;
}

/* Login Screen */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: #f0f4f8;
}

.login-card {
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
  position: relative; /* Enable absolute positioning for logo */
}

/* OptivaAI Logo positioning in login cards */
.login-logo {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 80px;
  height: auto;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.login-logo:hover {
  opacity: 1.0;
}

.login-card h2 {
  margin-bottom: 30px;
  color: #334155;
}

.form-group {
  text-align: left;
  margin-bottom: 20px;
}

.form-group label {
  font-weight: bold;
  display: block;
  margin-bottom: 6px;
  color: #2c3e50;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.primary-btn {
  background: #007bff;
  color: white;
  padding: 12px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.primary-btn:hover {
  background: #0056b3;
}

.error-msg {
  color: red;
  margin-top: 15px;
  display: none;
}

.required {
  color: red;
}

.login-help-text {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

.login-help-text p {
  font-size: 14px;
  color: #64748b;
  margin: 0;
  font-weight: 400;
  line-height: 1.6;
}

.login-help-text a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.login-help-text a:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* Company Selection Screen */
.company-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.company-list button {
  padding: 12px;
  font-size: 16px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #ccc;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.company-list button:hover {
  background-color: #e2e8f0;
  border-color: #007bff;
  color: #007bff;
}

.company-name {
  font-weight: bold;
  color: #1e40af; /* Tailwind's blue-800 for good contrast */
}

/* Spinner implementation */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 6px solid #ccc;
  border-top: 6px solid #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none;
}

#loading-overlay.hidden {
  display: none !important;
}

/* Global Save Button Style */
#saveBtn {
  background-color: #00aaff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* Save button turns green after success */
#saveBtn.saved {
  background-color: #28a745;
}
