/* Custom Styles for Employee Scheduling System */

:root {
  --primary-color: #007bff;
  --bg-color: #f8f9fa;
  --text-color: #333;
}

html,
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #ebecf0;
  min-height: 100vh;
  position: relative;
}

@media (max-width: 767.98px) {
  html {
    font-size: 14px;
  }
}

[data-bs-theme="dark"] html,
[data-bs-theme="dark"] body {
  background-color: #1a1d20;
  /* slightly darker dark mode bg */
}

/* Glassmorphism nav */
.navbar.pwa-nav {
  background: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  z-index: 1050;
  position: sticky;
  top: 0;
}

[data-bs-theme="dark"] .navbar.pwa-nav {
  background: rgba(15, 15, 15, 0.4) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Card Styling */
.card {
  border-radius: 1rem;
}

/* Buttons */
.btn {
  transition: all 0.3s ease;
}

/* Modal styling */
.modal-content {
  border-radius: 1rem;
}

.modal-header {
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
}

/* Table refinements */
.table>tbody>tr {
  transition: background-color 0.2s;
}

/* Responsive container */
.main-container {
  padding-bottom: 2rem;
}

/* Forms */
.form-control:focus,
.form-select:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

/* Request Cards */
.request-card {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}



.request-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1) !important;
}

[data-bs-theme="dark"] .request-card:hover {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3) !important;
}

/* Team Cards */
.team-card {
  transition: all 0.2s ease-in-out;
}



.team-card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
}

[data-bs-theme="dark"] .team-card:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

/* Status Indicators */
.status-indicator {
  border: 2px solid #fff;
  border-radius: 50%;
  z-index: 2;
}

.status-online {
  background-color: #198754;
}

.status-recent {
  background-color: #ffc107;
}

.status-idle {
  background-color: #dc3545;
}

.status-pulse {
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(25, 135, 84, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
  }
}

[data-bs-theme="dark"] .status-indicator {
  border-color: #212529;
}

/* Schedule Navigation */
.schedule-nav-container {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
  width: 100%;
  overflow: hidden;
}

[data-bs-theme="dark"] .schedule-nav-container {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.schedule-tab-nav {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: none;
  gap: 1.5rem !important;
  width: 100%;
}


.schedule-tab-nav::-webkit-scrollbar {
  display: none;
}

.schedule-tab {
  text-align: left;
  padding: 0.75rem 0.25rem !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 3px solid transparent !important;
  border-radius: 0 !important;
  transition: all 0.2s ease;
  flex: 0 0 auto;
  color: var(--bs-secondary-color) !important;
  white-space: nowrap !important;
}

.schedule-tab.active {
  opacity: 1;
  color: var(--primary-color) !important;
  border-bottom-color: var(--primary-color) !important;
  font-weight: 700;
}

.schedule-tab:not(.active):hover {
  opacity: 1;
  color: var(--bs-emphasis-color) !important;
}

.tile-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1px;
}

.tile-dates {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap !important;
}

/* Mobile Bar Styles */
.mobile-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  z-index: 2000;
}

[data-bs-theme="dark"] .mobile-top-bar {
  background: rgba(15, 15, 15, 0.4) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-bottom-bar {
  position: fixed;
  /* bottom: max(0.4rem, env(safe-area-inset-bottom, 0px)); */
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: fit-content;
  max-width: 90vw;
  height: 56px;
  background: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  padding: 0 0.5rem;
}

[data-bs-theme="dark"] .mobile-bottom-bar {
  background: rgba(15, 15, 15, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.mobile-nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--bs-secondary-color);
  transition: all 0.2s ease;
  flex: 1;
  width: 75px;
  height: 100%;
  justify-content: center;
}

.mobile-nav-tab i {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.mobile-nav-tab span {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: capitalize;
  line-height: 1;
}

.tiny-text {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mobile-nav-tab.active {
  color: var(--primary-color);
}

.nav-link-desktop {
  transition: all 0.2s ease;
}

.nav-link-desktop:hover {
  background: rgba(var(--bs-primary-rgb), 0.1);
  color: var(--primary-color) !important;
}

[data-bs-theme="dark"] .nav-link-desktop:hover {
  background: rgba(var(--bs-primary-rgb), 0.2);
}

.nav-link-desktop.active {
  color: var(--primary-color) !important;
}

@keyframes notification-ping {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }

  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

.ping-danger {
  position: relative;
}

.ping-danger::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background-color: #dc3545;
  border-radius: 50%;
  z-index: -1;
  animation: notification-ping 1.5s ease-out infinite;
}

/* Schedule Page Enhancements */
.schedule-card {
  transition: all 0.3s ease !important;
}

.schedule-card:hover {
  background-color: var(--bs-secondary-bg);
}

.schedule-card:hover .chevron-icon {
  background-color: var(--bs-primary) !important;
  color: white !important;
}

.schedule-card:hover .chevron-icon i {
  color: white !important;
}

/* Page buffer for fixed navigation bars */
body {
  padding-top: calc(75px + env(safe-area-inset-top));
}

@media (max-width: 991.98px) {
  body {
    padding-bottom: calc(75px + env(safe-area-inset-bottom));
  }

  .modal {
    padding-top: calc(65px + env(safe-area-inset-top)) !important;
    padding-bottom: calc(85px + env(safe-area-inset-bottom)) !important;
  }
}

.main-container {
  padding-top: 0.5rem;
}

/* Utilitiy Classes */
.bg-card-icon {
  background-color: var(--bs-body-bg);
}

/* Global Print Settings */
@media print {
  @page {
    margin: 0;
  }

  .pwa-nav,
  .mobile-top-bar,
  .mobile-bottom-bar,
  .btn,
  .alert,
  .alert-dismissible,
  footer {
    display: none !important;
  }

  body {
    background-color: white !important;
    padding: 0 !important;
    margin: 0 !important;
    color: black !important;
  }

  .main-container {
    margin-top: 0 !important;
    padding-top: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* Offline Page Styles */
.offline-card {
  max-width: 500px;
  width: 90%;
  padding: 3.5rem 2rem;
  border-radius: 2.5rem;
  text-align: center;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .offline-card {
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.4);
  background: rgba(var(--bs-body-bg-rgb), 0.8);
  backdrop-filter: blur(10px);
}

.status-icon-wrapper {
  width: 110px;
  height: 110px;
  background: rgba(var(--bs-secondary-rgb), 0.08);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2.5rem;
  position: relative;
}

.status-icon-wrapper::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px dashed rgba(var(--bs-secondary-rgb), 0.2);
  animation: rotate-status 20s linear infinite;
}

@keyframes rotate-status {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.offline-card h1 {
  font-weight: 800;
  letter-spacing: -1px;
}

/* Prevent iOS Safari auto-zoom on inputs */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
  font-size: 16px !important;
}

/* Global News & Rich Text Styles */
.news-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

/* Quill Dark Mode Overrides */
[data-bs-theme="dark"] .ql-toolbar {
  background-color: var(--bs-body-tertiary-bg);
  border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] .ql-container {
  border-color: var(--bs-border-color) !important;
  background-color: var(--bs-body-bg);
}

[data-bs-theme="dark"] .ql-toolbar .ql-stroke {
  stroke: var(--bs-emphasis-color);
}

[data-bs-theme="dark"] .ql-toolbar .ql-fill {
  fill: var(--bs-emphasis-color);
}

[data-bs-theme="dark"] .ql-toolbar .ql-picker {
  color: var(--bs-emphasis-color);
}

[data-bs-theme="dark"] .ql-snow .ql-picker-options {
  background-color: var(--bs-body-bg);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .ql-editor.ql-blank::before {
  color: var(--bs-secondary-color) !important;
  opacity: 0.6;
}

[data-bs-theme="dark"] ::placeholder {
  color: var(--bs-secondary-color) !important;
  opacity: 0.5;
}

/* Management Sidebar Styles */
.management-sidebar {
  border-left: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  z-index: 2010 !important;
  width: 300px !important;
  max-width: 85vw !important;
  background: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

[data-bs-theme="dark"] .management-sidebar {
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(15, 15, 15, 0.4) !important;
}

.sidebar-header-style {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .sidebar-header-style {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.management-sidebar .list-group-item {
  background: transparent;
}

/* Large Viewport Fixed Sidebar Behavior */
@media (min-width: 1200px) {
  body {
    overflow-y: auto !important;
    padding-right: 300px !important;
  }

  .management-sidebar,
  .management-sidebar.show {
    width: 300px !important;
    position: fixed !important;
    top: 0;
    right: 0;
    height: 100vh;
    transform: none !important;
    visibility: visible !important;
    z-index: 2010 !important;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.03) !important;
    transition: none !important;
  }

  [data-bs-theme="dark"] .management-sidebar {
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
  }

  .mobile-top-bar {
    right: 300px !important;
  }

  .offcanvas-backdrop {
    display: none !important;
  }
}

/* Live Tab Custom Pulsing Signal Icon */
.live-signal-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  display: inline-block;
  overflow: visible;
}

.live-signal-icon .live-dot {
  fill: #198754;
  /* Beautiful green dot representing active clock-ins / live status */
  transition: fill 0.3s ease;
  transform-origin: 12px 12px;
  animation: live-signal-dot-pulse 2s infinite ease-in-out;
}

[data-bs-theme="dark"] .live-signal-icon .live-dot {
  fill: #198754;
}

/* If the link is primary active, make the dot match the primary theme */
.text-primary .live-signal-icon .live-dot {
  fill: var(--bs-primary);
}

.live-signal-icon .live-wave {
  fill: none;
  stroke: currentColor;
  stroke-width: 2px;
  stroke-linecap: round;
  opacity: 0.3;
}

/* Sequential ripple/pulse animations for both sides simultaneously */
.live-signal-icon .live-wave.wave-inner {
  animation: live-signal-broadcast-inner 2s infinite ease-in-out;
}

.live-signal-icon .live-wave.wave-outer {
  animation: live-signal-broadcast-outer 2s infinite ease-in-out;
}

@keyframes live-signal-dot-pulse {
  0% {
    opacity: 0.35;
    transform: scale(0.75);
  }

  20% {
    opacity: 1;
    transform: scale(1);
  }

  75% {
    opacity: 1;
    transform: scale(1);
  }

  90%,
  100% {
    opacity: 0.35;
    transform: scale(0.75);
  }
}

@keyframes live-signal-broadcast-inner {

  0%,
  20% {
    opacity: 0.3;
    stroke-width: 2px;
  }

  45% {
    opacity: 0.95;
    stroke-width: 2.3px;
  }

  75% {
    opacity: 0.95;
    stroke-width: 2.3px;
  }

  90%,
  100% {
    opacity: 0.3;
    stroke-width: 2px;
  }
}

@keyframes live-signal-broadcast-outer {

  0%,
  45% {
    opacity: 0.3;
    stroke-width: 2px;
  }

  70% {
    opacity: 0.95;
    stroke-width: 2.3px;
  }

  85% {
    opacity: 0.95;
    stroke-width: 2.3px;
  }

  95%,
  100% {
    opacity: 0.3;
    stroke-width: 2px;
  }
}

/* Modern Week Navigator Styles */
:root {
  --modern-nav-bg: var(--bs-body-bg);
  --modern-nav-border: var(--bs-border-color);
  --modern-accent: var(--bs-primary);
  --modern-text: var(--bs-body-color);
  --modern-text-muted: var(--bs-secondary-color);
  --week-card-radius: 1.5rem;
}

[data-bs-theme="dark"] {
  --modern-nav-bg: #212529;
  --modern-nav-border: rgba(255, 255, 255, 0.08);
}

.week-nav-modern {
  background: var(--modern-nav-bg);
  padding: 1rem;
  border-radius: var(--week-card-radius);
  border: 1px solid var(--modern-nav-border);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.modern-nav-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: var(--bs-tertiary-bg);
  color: var(--modern-text);
  border: 1px solid var(--modern-nav-border);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.modern-nav-btn:hover:not(.disabled) {
  background: var(--modern-accent);
  color: white;
  border-color: var(--modern-accent);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(var(--bs-primary-rgb), 0.3);
}

.modern-nav-btn.disabled {
  opacity: 0.2;
  pointer-events: none;
}

.nav-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--modern-accent);
  display: block;
  margin-bottom: 4px;
}

.nav-title {
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--modern-text);
  line-height: 1.2;
}

.nav-title .separator {
  opacity: 0.2;
  margin: 0 8px;
}

/* Relative Week Colors */
.week-lbl-past {
  color: #ef4444 !important; /* red */
}
.week-lbl-current {
  color: #10b981 !important; /* green */
}
.week-lbl-future {
  color: #ec4899 !important; /* hot pink */
}