/**
 * Admin Portal - Shared styles for CSEGS Application and Application List pages
 */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 64px;
    --header-height: 66px;
    --primary-red: #c41e3a;
    --primary-red-dark: #9e1830;
    --active-bg: #e8f4fc;
    --active-text: #4a6c9e;
    --stepper-done: #2f7253;
    --stepper-error: #b94652;
    --text-color: #212529;
    --bs-toast-max-width: 550px;
}

* {
  font-family: 'Roboto', sans-serif;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: #f8f9fa;
  font-size: 0.88rem;
}

/* Form controls border color */
.form-control,
.form-select,
textarea.form-control {
  border-color: #b3b3b3;
}

.navbg-strip{
  background-image: url(../img/navbg-strip.png);
  background-size: cover;
  background-position: top;
  background-repeat: no-repeat;
}

/* Header */
.app-header {
  height: var(--header-height);
  background: linear-gradient(180deg, #f0f0f0 0%, #fff 100%);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  box-shadow: 0 10px 10px #0000000a;
}

.hamburger-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  margin-right: 1rem;
  color: #333;
  font-size: 1.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.header-spacer {
  flex: 1;
}

.header-welcome {
  font-size: 0.9rem;
  color: #495057;
  margin-right: 1rem;
}

.header-logout {
  width: 36px;
  height: 36px;
  background: var(--active-text);
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-user-btn {
  width: 40px;
  height: 40px;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--active-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  padding: 0;
  transition: all 0.2s;
}

.header-user-btn:hover,
.header-user-btn:focus {
  background: var(--active-text);
  color: #fff;
  border-color: var(--active-text);
}

.header-user-btn:focus {
  box-shadow: 0 0 0 0.2rem rgba(74, 108, 158, 0.25);
}

.dropdown-menu {
  margin-top: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #dee2e6;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
}

.dropdown-item i {
  width: 20px;
  text-align: center;
}

.btn.btn-primary {
  background: var(--active-text);
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
 /* display: flex;*/
  align-items: center;
  justify-content: center;
}

.btn.btn-primary:hover {
opacity: 0.8;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: #fff;
  border-right: 1px solid #ededee;
  z-index: 1025;
  transition: width 0.25s ease, left 0.25s ease;
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar.collapsed.hover-expand {
  width: var(--sidebar-width);
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
}

.sidebar-nav {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
}

.sidebar-nav li {
  margin: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  color: #495057;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.sidebar-nav a:hover {
  background: #f8f9fa;
  color: #212529;
}

.sidebar-nav a.active {
  color: var(--active-text);
  font-weight: 700;
}

.sidebar-nav .fa {
  width: 24px;
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-right: 12px;
}

.sidebar.collapsed .sidebar-nav .fa {
  margin-right: 0;
}

.sidebar.collapsed .sidebar-nav a {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar.collapsed .sidebar-nav .nav-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  margin-left: 0;
}

.sidebar.collapsed.hover-expand .sidebar-nav .nav-text {
  opacity: 1;
  width: auto;
  margin-left: 12px;
}

.sidebar.collapsed.hover-expand .sidebar-nav a {
  justify-content: flex-start;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.sidebar.collapsed.hover-expand .sidebar-nav .fa {
  margin-right: 12px;
}

.nav-caret {
  margin-left: auto;
  font-size: 0.75rem;
  color: #6c757d;
  transition: transform 0.2s;
}

.sidebar-nav li.has-submenu > a .nav-caret {
  transform: rotate(0deg);
}

.sidebar-nav li.has-submenu.expanded > a .nav-caret {
  transform: rotate(90deg);
}

.sidebar.collapsed .nav-caret {
  display: none !important;
}

.sidebar.collapsed.hover-expand .nav-caret {
  display: flex !important;
}

.submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background: #f8f9fa;
}

.sidebar-nav li.has-submenu.expanded .submenu {
  max-height: 800px;
  padding: 0.25rem 0;
}

.submenu li {
  margin: 0;
}

.submenu a {
  padding: 0.6rem 1.25rem 0.6rem 3.5rem;
  font-size: 0.9rem;
}

.submenu a:hover {
  background: #e9ecef;
  color: #212529;
}

.submenu a.active {
  color: var(--active-text);
  font-weight: 600;
}

.sidebar.collapsed .submenu {
  display: none;
}

.sidebar.collapsed.hover-expand .submenu {
  display: block;
}

/* Dashboard sidebar: dark blue active state for selected item */
.sidebar-nav-dashboard .submenu a.active,
.sidebar-nav-dashboard a.active {
  background: #1e4976;
  color: #fff;
  font-weight: 600;
}

.sidebar-nav-dashboard .submenu a.active:hover {
  background: #163a5f;
  color: #fff;
}

.sidebar-nav-dashboard .submenu a {
  padding-left: 2.25rem;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  padding: 1.5rem 2rem;
  transition: margin-left 0.25s ease;
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed);
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--active-text);
}

/* Common Form Styles */
.form-label {
  color: var(--text-color);
}

.form-label .required {
  color: var(--stepper-error);
  font-weight: 700;
}

.form-control::placeholder {
  opacity: 0.5;
}

.form-check {
  padding-left: 1.75rem;
}

.form-check-label {
  cursor: pointer;  
}

.form-check-input {
  margin-top: 0.3rem;
}

.form-check-input[type="checkbox"],
.form-check-input[type="radio"] {
  border-color: #6c757d;
  border-width: 1.5px;
}

.form-check-input[type="checkbox"]:checked,
.form-check-input[type="radio"]:checked {
  background-color: var(--active-text);
  border-color: var(--active-text);
}

.card {
  box-shadow: 0 4px 8px #00000012;
  border: none;
}

.text-muted.small {
  font-size: 0.75rem;
  color: #505457 !important;
}

/* ============================================
   CSEGS Application Specific Styles
   ============================================ */

.page-desc {
  color: #212529;
  margin-bottom: 1.5rem;
}

.stepper-wrapper {
  /*margin: 0rem 1rem;*/
  padding: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.stepper {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
}

.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s;
  gap: 0.5rem;
}

.stepper-step:hover {
  transform: translateY(-2px);
}

.stepper-step:hover .step-circle {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #dee2e6;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #6c757d;
  transition: all 0.2s;
}

.stepper-step.done .step-circle {
  border-color: var(--stepper-done);
  background: var(--stepper-done);
  color: #fff;
}

.stepper-step.done .step-circle .fa-check {
  display: block;
}

.stepper-step.done .step-circle .step-num {
  display: none;
}

.stepper-step.error .step-circle {
  border-color: var(--stepper-error);
  background: var(--stepper-error);
  color: #fff;
}

.stepper-step.active .step-circle {
  border-color: var(--active-text);
  background: var(--active-text);
  color: #fff;
}

.step-label {
  font-size: 0.75rem;
  color: #6c757d;
  max-width: 80px;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
  white-space: pre-line;
}

.stepper-step.done .step-label {
  color: var(--stepper-done);
  font-weight: 600;
}

.stepper-step.error .step-label {
  color: var(--stepper-error);
  font-weight: 600;
}

.stepper-step.active .step-label {
  color: var(--active-text);
  font-weight: 700;
}

.step-connector {
  width: 24px;
  height: 2px;
  background: #dee2e6;
  margin: 0 0.25rem;
  transition: background 0.2s;
  align-self: flex-start;
  margin-top: 18px;
  flex: 1;
}

.stepper-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.stepper-panel.active {
  display: block;
}

.stepper-completed-connector {
    background: var(--stepper-done);
}

.main-content-popup {
    /* margin-left: var(--sidebar-width); */
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    padding: 1.5rem 2rem;
    transition: margin-left 0.25s ease;
}

@keyframes fadeIn {
    from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.stepper-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  padding: 0.25rem 0;
  border-top: 1px solid #dee2e6;
  background-color: #ffffff60;
  backdrop-filter: blur(4px);
}

.stepper-buttons .btn {
  font-weight: 600;
}

.box {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.box-header {
  font-weight: 700;
  padding-bottom: 0.5rem;
  font-size: 1rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 1rem;
  color: var(--active-text);
}

.instructions-list {
  padding-left: 1.5rem;
}

.instructions-list li {
  margin-bottom: 1rem;
}

.box-content {
  padding: 1rem;
}

/* ============================================
   Application List Specific Styles
   ============================================ */

.app-list-filters {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.app-list-table-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.action-icons .btn-link,
.status-icons .btn-link {
  padding: 0.25rem 0.35rem;
  text-decoration: none;
}

.action-icons .btn-link {
  color: #495057;
}

.status-icons .btn-link {
  color: #adb5bd;
}

.action-icons .btn-link:hover,
.status-icons .btn-link:hover {
  color: var(--active-text);
}

.action-icons .btn-link[data-status="done"],
.status-icons .btn-link[data-status="done"] {
  color: #198754;
}

.table a{
  color: var(--active-text)
}

.table-align-middle td {
  vertical-align: middle;
}

/* History modal – Application Summary */
.history-summary .fw-bold {
  color: #212529;
}

.history-summary .text-end {
  color: #495057;
}

.table>:not(caption)>*>*{
  padding: 0.8rem !important;
}

/*.table>thead>tr>th{
  background-color: #4a6c9e45 !important
}*/

/* Sidebar overlay (shown only on mobile when menu is open) */
.sidebar-overlay {
  display: none;
}

.editRestrict {
    pointer-events: none; /* Disables mouse interaction */
    background-color: #e9ecef; /* Light grey to look disabled */
    opacity: 0.7;
    cursor: not-allowed;
}

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 991.98px) {
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1024;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .sidebar-overlay.visible {
    pointer-events: auto;
    opacity: 1;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    width: var(--sidebar-width);
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0.5rem;
  }

  .stepper-wrapper {
    margin: 2rem 0.5rem;
  }

  .box {
    padding: 0.5rem;
  }

  .page-title {
    font-size: 1.25rem;
  }
}
