:root {
  --psw-orange: #eb6209;
  --psw-orange-dark: #c95207;
  --psw-gray-light: #f8f9fa;
  --psw-gray: #6c757d;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333;
  background-color: #fff;
}

#body {
  flex: 1;
}

/* Header */
header {
  background: linear-gradient(180deg, #fff 0%, var(--psw-gray-light) 100%);
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 1rem;
}

/* Navigation links */
header nav a {
  color: var(--psw-gray);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s ease-in-out;
}

header nav a:hover {
  color: var(--psw-orange);
}

/* User info panel */
.user-panel {
  font-size: 0.875rem;
  color: var(--psw-gray);
}

.user-panel a {
  color: var(--psw-orange);
  text-decoration: none;
}

.user-panel a:hover {
  color: var(--psw-orange-dark);
  text-decoration: underline;
}

/* Button styles */
.btn-psw {
  background-color: var(--psw-orange);
  border-color: var(--psw-orange);
  color: #fff;
}

.btn-psw:hover {
  background-color: var(--psw-orange-dark);
  border-color: var(--psw-orange-dark);
  color: #fff;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--psw-orange);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Cards */
.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border-radius: 0.5rem;
}

.card-header {
  background-color: var(--psw-gray-light);
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
}

/* Tables */
.table {
  border-radius: 0.5rem;
  overflow: hidden;
  width: 100%;
}

/* Make main content container fluid instead of Bootstrap's stepped breakpoints */
.content-wrapper.main-content.container {
  max-width: 100% !important;
  padding-left: 2rem;
  padding-right: 2rem;
}

.table thead th {
  background-color: var(--psw-gray-light);
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--psw-gray);
}

.table tbody tr:hover {
  background-color: rgba(235, 98, 9, 0.05);
}

.table td, .table th {
  vertical-align: middle;
}

/* Traffic light indicators for document expiry */
.trafficlight {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.trafficlight:before {
  display: inline-block;
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #dee2e6;
  flex-shrink: 0;
}

.trafficlight.green:before {
  background: #28a745;
  box-shadow: 0 0 3px rgba(40, 167, 69, 0.6), 0 0 8px rgba(40, 167, 69, 0.3);
}

.trafficlight.yellow:before {
  background: #ffc107;
  box-shadow: 0 0 3px rgba(255, 193, 7, 0.6), 0 0 8px rgba(255, 193, 7, 0.3);
}

.trafficlight.red:before {
  background: #dc3545;
  box-shadow: 0 0 3px rgba(220, 53, 69, 0.6), 0 0 8px rgba(220, 53, 69, 0.3);
}

/* Sortable table headers */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th.sortable:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

th.sortable::after {
  content: "\f127";
  font-family: "bootstrap-icons";
  margin-left: 0.5rem;
  opacity: 0.3;
  font-size: 0.75rem;
}

th.sortable.asc::after {
  content: "\f148";
  opacity: 0.7;
}

th.sortable.desc::after {
  content: "\f128";
  opacity: 0.7;
}

/* Footer */
footer {
  font-size: 0.75rem;
  color: #adb5bd;
  text-align: center;
}

/* Links */
a {
  color: var(--psw-orange);
}

a:hover {
  color: var(--psw-orange-dark);
}

/* Page titles */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: #212529;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--psw-orange);
  display: inline-block;
}

/* Forms */
.form-control:focus {
  border-color: var(--psw-orange);
}

.form-label {
  font-weight: 500;
  color: var(--psw-gray);
  font-size: 0.875rem;
}

/* Fieldsets */
fieldset {
  background: #fff;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  margin-bottom: 1.5rem;
}

fieldset h2 {
  margin-top: 0;
}

/* Alerts */
.alert {
  border-radius: 0.5rem;
  border: none;
}

/* Validation summary - remove bullet and extra spacing */
.alert ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.alert ul li:only-child {
  margin: 0;
}

/* Login button styling */
.btn-link {
  color: var(--psw-orange);
  text-decoration: none;
}

.btn-link:hover {
  color: var(--psw-orange-dark);
}

/* Override Bootstrap outline button hover to use PSW orange */
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--psw-orange);
  border-color: var(--psw-orange);
  color: #fff;
}

.btn-outline-secondary:active,
.btn-outline-primary:active {
  background-color: var(--psw-orange-dark) !important;
  border-color: var(--psw-orange-dark) !important;
  color: #fff !important;
}

/* Action button spacing in tables */
.table td.text-end {
  white-space: nowrap;
}

.table td .btn + .btn {
  margin-left: 0.25rem;
}

/* Login page background */
body.login-page {
  background-image: url('../images/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.login-page header {
  background: transparent !important;
  border-bottom: none !important;
}

body.login-page header > .position-absolute.top-0 {
  display: none;
}

body.login-page #body {
  display: flex;
  flex-direction: column;
}

body.login-page .main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0 !important;
}

body.login-page .card {
  background-color: rgba(255, 255, 255, 0.95);
}

body.login-page footer {
  display: none;
}
