/* css/style.css */

/*=======================
  Root Variables
========================*/
:root {
  --primary:        #0d6efd;
  --secondary:      #6c757d;
  --success:        #198754;
  --danger:         #dc3545;
  --warning:        #ffc107;
  --info:           #0dcaf0;
  --light:          #f8f9fa;
  --dark:           #212529;

  --font-base:      'Segoe UI', Tahoma, sans-serif;
  --font-size-base: 1rem;
  --line-height:    1.5;
  --border-radius:  .375rem;
  --card-padding:   1rem;
  --section-gap:    2rem;
  --input-padding:  .5rem .75rem;
  --transition:     0.3s;
}

/*=======================
  Global Styles
========================*/
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--light);
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--dark);
}

a {
  transition: color var(--transition);
}
a:hover {
  color: var(--primary);
}

/*=======================
  Typography
========================*/
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: .75rem;
}
.lead {
  font-size: 1.125rem;
  font-weight: 300;
}

/*=======================
  Navbar Override
========================*/
.navbar {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/*=======================
  Cards & Panels
========================*/
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
  transition: box-shadow var(--transition);
}
.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.card-body {
  padding: var(--card-padding);
}

/*=======================
  Form Layout & Sections
========================*/
/* Group related fields into a visual section */
.form-section {
  background: #fff;
  border: 1px solid #e2e5e8;
  border-radius: var(--border-radius);
  padding: var(--card-padding);
  margin-bottom: var(--section-gap);
}
.form-section-title {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--light);
  font-size: 1.25rem;
  font-weight: 500;
}

/* Override Bootstrap form control padding */
.form-control {
  padding: var(--input-padding);
  border-radius: var(--border-radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(13,110,253,.25);
}

/* Group multiple controls horizontally */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.form-row .form-group {
  flex: 1;
  min-width: 150px;
}

/* Style for validation feedback */
.was-validated .form-control:invalid,
.form-control.is-invalid {
  border-color: var(--danger);
}
.was-validated .form-control:valid,
.form-control.is-valid {
  border-color: var(--success);
}

/*=======================
  Tables & Lists
========================*/
/* Scrollable container for long lists/tables */
.scrollable-list,
.scrollable-table {
  max-height: 400px;
  overflow-y: auto;
}

/* Custom scrollbar (Webkit) */
.scrollable-list::-webkit-scrollbar,
.scrollable-table::-webkit-scrollbar {
  width: 8px;
}
.scrollable-list::-webkit-scrollbar-thumb,
.scrollable-table::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.1);
  border-radius: 4px;
}

/* Table overrides */
.table thead {
  background-color: var(--primary);
  color: #fff;
}
.table tbody tr:hover {
  background-color: rgba(13,110,253,0.05);
}
.table td, .table th {
  vertical-align: middle;
}

/* Paginated nav */
.pagination {
  justify-content: center;
  margin-top: 1rem;
}

/*=======================
  Buttons
========================*/
.btn {
  border-radius: var(--border-radius);
  transition: background-color var(--transition), box-shadow var(--transition);
}
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background-color: darken(var(--primary), 5%);
}

/*=======================
  Modals
========================*/
.modal-content {
  border-radius: var(--border-radius);
  overflow: hidden;
}
.modal-header {
  background-color: var(--light);
  border-bottom: 2px solid #e2e5e8;
}
.modal-footer {
  background-color: var(--light);
  border-top: 2px solid #e2e5e8;
}

/*=======================
  Utility Classes
========================*/
.text-primary {
  color: var(--primary) !important;
}
.m-0   { margin: 0 !important; }
.mt-1  { margin-top: 0.25rem !important; }
.mb-1  { margin-bottom: 0.25rem !important; }
.mt-2  { margin-top: 0.5rem !important; }
.mb-2  { margin-bottom: 0.5rem !important; }
.mt-3  { margin-top: 1rem !important; }
.mb-3  { margin-bottom: 1rem !important; }
.mt-4  { margin-top: 1.5rem !important; }
.mb-4  { margin-bottom: 1.5rem !important; }

/*=======================
  Responsive Adjustments
========================*/
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }
  .card-body {
    padding: .75rem;
  }
}
