/* ============================================================
   styles.css — Custom styles for TimesheetWeb
   Bootstrap 5 is the base; only add overrides here.
   ============================================================ */

/* ---- Enterprime brand color override ---- */
:root {
  --bs-primary: #FF6506;
  --bs-primary-rgb: 255, 101, 6;
  --bs-link-color: #FF6506;
  --bs-link-hover-color: #d95500;
}
.btn-primary {
  --bs-btn-bg: #FF6506;
  --bs-btn-border-color: #FF6506;
  --bs-btn-hover-bg: #d95500;
  --bs-btn-hover-border-color: #cc5000;
  --bs-btn-active-bg: #c04b00;
  --bs-btn-active-border-color: #b34600;
  --bs-btn-disabled-bg: #FF6506;
  --bs-btn-disabled-border-color: #FF6506;
}
.btn-outline-primary {
  --bs-btn-color: #FF6506;
  --bs-btn-border-color: #FF6506;
  --bs-btn-hover-bg: #FF6506;
  --bs-btn-hover-border-color: #FF6506;
  --bs-btn-active-bg: #d95500;
  --bs-btn-active-border-color: #cc5000;
}
.text-primary { color: #FF6506 !important; }
a { color: #FF6506; }
a:hover { color: #d95500; }
.form-check-input:checked {
  background-color: #FF6506;
  border-color: #FF6506;
}
.form-check-input:focus {
  border-color: #ffb27f;
  box-shadow: 0 0 0 .25rem rgba(255,101,6,.25);
}
.form-control:focus, .form-select:focus {
  border-color: #ffb27f;
  box-shadow: 0 0 0 .25rem rgba(255,101,6,.25);
}
.page-item.active .page-link {
  background-color: #FF6506;
  border-color: #FF6506;
}
.page-link { color: #FF6506; }
.page-link:hover { color: #d95500; }

/* Slightly off-white page background so white cards pop */
body {
  background-color: #f4f5f7;
}

/* Avatar circle (initials fallback) */
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #FF6506;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  user-select: none;
}

/* Login page centering */
#section-login {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* User info card */
.user-card {
  max-width: 420px;
}

/* ---- Modern table card wrapper ---- */
.table-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06), 0 0 1px rgba(0,0,0,.08);
  overflow: hidden;
}
.table-card .table {
  border-collapse: separate;
  border-spacing: 0;
}
.table-card .table thead th {
  background: #fff;
  border-bottom: 2px solid #e9ecef;
  color: #495057;
  font-weight: 600;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 14px 16px;
  white-space: nowrap;
}
.table-card .table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: .9rem;
  color: #333;
  vertical-align: middle;
}
.table-card .table tbody tr:last-child td {
  border-bottom: none;
}
.table-card .table tbody tr:hover {
  background: #fff9f5;
}
.table-card .table tbody tr {
  transition: background .15s ease;
}

/* List table hover */
#list-table tbody tr {
  cursor: pointer;
}

/* ---- Navbar hover effects ---- */
.navbar .btn-link,
.navbar .btn-outline-light {
  transition: background .2s, transform .15s, box-shadow .2s, opacity .15s;
}
.navbar .btn-link:hover {
  opacity: .85;
  transform: scale(1.05);
}
.navbar .btn-outline-light:hover {
  background: rgba(255,255,255,.2);
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(255,255,255,.2);
}
.navbar .avatar {
  transition: transform .15s, box-shadow .15s;
}
.navbar .avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(255,255,255,.3);
}

/* ---- Period navigator (month / week) ---- */
.period-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06), 0 0 1px rgba(0,0,0,.08);
  padding: 2px;
}
.period-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: #495057;
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
.period-nav-btn:hover {
  background: #fff4ec;
  color: #FF6506;
  transform: scale(1.1);
}
.period-nav-btn:active {
  background: #ffe0c7;
  transform: scale(.95);
}
.period-nav-label {
  padding: 0 12px;
  font-size: .875rem;
  font-weight: 600;
  color: #333;
  text-align: center;
  user-select: none;
}

/* ---- Toolbar button hover effects ---- */
#toolbar .btn-outline-primary,
#toolbar .btn-outline-secondary,
#toolbar .btn-primary {
  transition: transform .15s, box-shadow .2s;
}
#toolbar .btn-outline-primary:hover,
#toolbar .btn-outline-secondary:hover,
#toolbar .btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(255,101,6,.25);
}

/* Action button hover effects in list rows */
.btn-action-icon {
  opacity: .5;
  transition: opacity .15s, transform .15s, color .15s;
}
.btn-action-icon:hover {
  opacity: 1;
  transform: scale(1.25);
  color: #FF6506 !important;
}

/* ---- Filter resource box (compact, matches form-select-sm height) ---- */
.filter-resource-box {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 31px;
  font-size: .875rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  cursor: default;
}
.filter-resource-box:focus-within {
  border-color: #ffb27f;
  box-shadow: 0 0 0 .25rem rgba(255,101,6,.25);
}

/* ---- Lookup widget ---- */
.lookup-wrapper { position: relative; }

.lookup-control {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 5px 10px;
  background: #fff;
  min-height: 38px;
  transition: border-color .15s, box-shadow .15s;
}
.lookup-control:focus-within {
  border-color: #ffb27f;
  box-shadow: 0 0 0 .25rem rgba(255,101,6,.25);
}
.lookup-icon  { color: #FF6506; flex-shrink: 0; }
.lookup-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: .95rem; color: #FF6506; min-width: 0;
}
.lookup-input::placeholder { color: #adb5bd; font-style: italic; }
.lookup-clear {
  background: none; border: none; padding: 0 2px;
  color: #6c757d; font-size: 1.1rem; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.lookup-clear:hover { color: #dc3545; }

/* Inline dropdown */
.lookup-dropdown {
  position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 200;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  max-height: 260px; overflow-y: auto;
}
.lookup-dropdown-item {
  padding: 8px 12px; cursor: pointer; font-size: .9rem;
  border-bottom: 1px solid #f0f0f0;
}
.lookup-dropdown-item:last-child { border-bottom: none; }
.lookup-dropdown-item:hover { background: #fff7f0; color: #FF6506; }

/* Allow dropdown to overflow modal body */
#modal-detail .modal-body { overflow: visible; }

/* Sticky table header */
#list-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
#list-table thead th {
  background: #fff;
}

/* ============================================================
   FullCalendar — modern card style matching tables
   ============================================================ */

#fc-calendar {
  font-family: inherit;
  font-size: .875rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06), 0 0 1px rgba(0,0,0,.08);
  overflow: hidden;
  padding: 0;
}

/* Remove default FullCalendar borders — we use our own */
#fc-calendar .fc-scrollgrid {
  border: none !important;
}
#fc-calendar .fc-scrollgrid td,
#fc-calendar .fc-scrollgrid th {
  border-color: #eef0f2 !important;
}

/* Column headers — match table-card header style */
#fc-calendar .fc-col-header-cell {
  background: #fff;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #495057;
  border-bottom: 2px solid #e9ecef !important;
  padding: 10px 0;
}
#fc-calendar .fc-col-header-cell.fc-day-today {
  background: #fff4ec;
  color: #FF6506;
}

/* Time axis labels */
#fc-calendar .fc-timegrid-slot-label {
  font-size: .75rem;
  color: #8c95a0;
  font-weight: 500;
}
#fc-calendar .fc-timegrid-axis {
  background: #fff;
}

/* Today column highlight */
#fc-calendar .fc-day-today {
  background: rgba(255,101,6,.02) !important;
}

/* Time slot rows */
#fc-calendar .fc-timegrid-slot {
  height: 2.2em;
}

/* Events — refined look */
#fc-calendar .fc-event {
  border-radius: 6px;
  border: none;
  border-left: 3px solid;
  font-size: .75rem;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  transition: box-shadow .15s, transform .15s;
}
#fc-calendar .fc-event:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,.14);
  transform: translateY(-1px);
}

/* Now indicator line */
#fc-calendar .fc-timegrid-now-indicator-line {
  border-color: #dc3545;
  border-width: 2px;
}
#fc-calendar .fc-timegrid-now-indicator-arrow {
  border-top-color: #dc3545;
}

/* Hide internal toolbar (we use our own buttons) */
#fc-calendar .fc-header-toolbar { display: none; }

/* Daily total hours badge in calendar column headers */
.day-total-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: .7rem;
  font-weight: 700;
  border-radius: 10px;
  vertical-align: middle;
  line-height: 1.4;
  /* color and background set inline via printDayColor() */
}

/* Remove FullCalendar's internal scrollbar — let page scroll instead */
#fc-calendar .fc-scroller { overflow: visible !important; }
#fc-calendar .fc-timegrid-body { overflow: visible !important; }

/* ============================================================
   Sidebar menu (offcanvas)
   ============================================================ */

#sidebar-menu { width: 280px; }

.sidebar-nav { margin: 0; }

.sidebar-nav-link {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #212529;
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
  border-bottom: 1px solid #f0f0f0;
  transition: background .15s;
}
.sidebar-nav-link:hover { background: #fff7f0; color: #FF6506; }

.sidebar-chevron {
  font-size: .7rem;
  transition: transform .2s;
}
[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(180deg);
}

.sidebar-sub-nav {
  background: #f8f9fa;
}
.sidebar-sub-link {
  display: block;
  padding: 10px 20px 10px 44px;
  color: #495057;
  text-decoration: none;
  font-size: .875rem;
  border-bottom: 1px solid #eee;
  transition: background .15s;
}
.sidebar-sub-link:hover { background: #fff0e5; color: #FF6506; }
