/* ===================================
   User Dashboard - Modern Styles
   =================================== */

/* Dashboard Container */
.user-dashboard {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Ensure cards fill available width */
.user-dashboard .row {
  margin-left: 0;
  margin-right: 0;
}

.user-dashboard [class*="col-"] {
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  padding-right: calc(var(--bs-gutter-x) * 0.5);
}

/* ===================================
   Stat Cards
   =================================== */
.stat-card {
  border-radius: 1rem;
  transition: all 0.2s ease;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15) !important;
}

.stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.1;
}

.stat-unit {
  font-size: 1.25rem;
  font-weight: 500;
  color: #64748b;
}

.letter-spacing {
  letter-spacing: 0.05em;
}

/* Progress Bar */
.progress-thin {
  height: 6px;
  border-radius: 3px;
  background-color: #e2e8f0;
}

.progress-thin .progress-bar {
  border-radius: 3px;
}

/* ===================================
   Alert Cards
   =================================== */
.alert-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-left: 4px solid;
}

.on-leave-alert {
  border-left-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}

.announcement-alert {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.alert-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.alert-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================================
   Leaves List
   =================================== */
.leaves-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leave-item-row {
  padding: 0.625rem 0.75rem;
  background: #f8fafc;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
}

.leave-item-row:hover {
  background: #f1f5f9;
  transform: translateX(4px);
}

.leave-dates {
  font-size: 0.875rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.status-approved {
  background-color: #22c55e;
}

.status-dot.status-pending {
  background-color: #f59e0b;
}

.status-dot.status-denied,
.status-dot.status-rejected {
  background-color: #ef4444;
}

/* ===================================
   Tips Card
   =================================== */
.tips-card .card {
  border-radius: 1rem;
  overflow: hidden;
}

.tips-header {
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  color: white;
}

.tips-body {
  background: #f8fafc;
}

.tips-list .tip-item {
  display: none;
}

.tips-list .tip-item.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ===================================
   Company Time Display
   =================================== */
.company-time-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
}

.time-display {
  padding: 0.75rem 0;
}

.local-time-info {
  background: #f1f5f9;
}

.work-summary {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
}

.reminder-box {
  background: #fef3c7;
}

/* ===================================
   Calendar Card
   =================================== */
.calendar-card {
  border-radius: 1rem;
  overflow: hidden;
}

.calendar-nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.calendar-nav-btn-placeholder {
  width: 36px;
}

.calendar-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.calendar-table {
  border-collapse: separate;
  border-spacing: 4px;
  min-width: 100%;
}

.calendar-header {
  background: #f8fafc;
  font-weight: 600;
  border: none !important;
}

.calendar-cell {
  position: relative;
  vertical-align: top;
  padding: 0 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px;
  transition: all 0.15s ease;
  min-width: 40px;
  height: 70px;
}

.calendar-cell:hover {
  transform: scale(1.02);
  z-index: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calendar-cell-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 4px;
  position: relative;
}

.calendar-day-number {
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: #334155;
  display: block;
}

a.calendar-day-number:hover {
  color: #3b82f6;
  text-decoration: none;
}

.calendar-day-abbr {
  font-size: 0.65rem;
  color: #94a3b8;
  text-transform: uppercase;
}

.calendar-hours {
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 4px;
  border-radius: 4px;
  margin-top: 2px;
}

.calendar-leave-icon {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.6rem;
  color: #22c55e;
}

.calendar-lock-icon {
  position: absolute;
  bottom: 2px;
  left: 2px;
  font-size: 0.5rem;
  color: #94a3b8;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.calendar-cell:hover .calendar-lock-icon {
  opacity: 1;
}

/* Calendar Cell States */
.calendar-cell-today {
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  border-color: #3b82f6 !important;
  border-width: 2px !important;
}

.calendar-cell-today .calendar-day-number {
  color: #1d4ed8;
}

.calendar-cell-tracked {
  background: linear-gradient(135deg, #dbeafe 0%, #f0f9ff 100%);
}

.calendar-cell-tracked .calendar-day-number {
  color: #2563eb;
}

.calendar-cell-closed-tracked {
  background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
}

.calendar-cell-closed-tracked .calendar-day-number {
  color: #16a34a;
}

.calendar-cell-closed {
  background: #f1f5f9;
}

.calendar-cell-closed .calendar-day-number {
  color: #94a3b8;
}

.calendar-cell-future {
  background: #fafafa;
}

.calendar-cell-future .calendar-day-number {
  color: #cbd5e1;
}

.calendar-cell-future:hover {
  transform: none;
  box-shadow: none;
}

.calendar-cell-empty {
  background: #fff;
}

.calendar-cell-outside {
  background: #fafafa;
  border-color: transparent !important;
}

.calendar-cell-weekend {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Calendar Legend */
.calendar-legend {
  border-color: #e2e8f0 !important;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  background: #f8fafc;
  border-radius: 0.375rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ===================================
   Existing Styles (kept for compatibility)
   =================================== */
.upcoming-leaves-card {
  border-radius: 1rem;
  transition: all 0.3s ease;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
}

.upcoming-leaves-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
}

.leave-item {
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.leave-item:hover {
  background-color: #fff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05);
  transform: translateX(5px);
}

.status-indicator {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

.status-approved {
  color: #2e7d32;
  background-color: rgba(46, 125, 50, 0.1);
}

.status-pending {
  color: #f57c00;
  background-color: rgba(245, 124, 0, 0.1);
}

.status-rejected {
  color: #c62828;
  background-color: rgba(198, 40, 40, 0.1);
}

.icon-wrapper {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.empty-state-icon {
  opacity: 0.5;
  transition: all 0.3s ease;
}

.empty-state-icon:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.hover-lift {
  transition: all 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.leave-reason {
  max-width: 80%;
}

.gap-3 {
  gap: 1rem;
}

.did-you-know-card {
  border-radius: 1rem;
  transition: all 0.3s ease;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
}

.did-you-know-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

.bg-gradient-info {
  background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
}

.tip-item {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.tip-item.active {
  opacity: 1;
  transform: translateY(0);
}

.rotate-tip {
  transition: transform 0.3s ease;
}

.rotate-tip:hover {
  transform: rotate(180deg);
}

.hover-scale {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-scale:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Modern Dashboard Styles */
.rounded-4 {
  border-radius: 1rem !important;
}

.dashboard-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

.btn-sm.rounded-pill {
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-outline-secondary:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

.progress.rounded-pill .progress-bar {
  transition: width 0.6s ease;
}

/* Badge improvements */
.badge.rounded-pill {
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ===================================
   Mobile Responsive Styles
   =================================== */

/* Tablet breakpoint - ensure cards fill space */
@media (min-width: 768px) {
  .stat-card,
  .calendar-card {
    height: 100%;
  }

  .stat-card .card-body {
    display: flex;
    flex-direction: column;
  }

  .stat-card .work-summary,
  .stat-card .reminder-box {
    margin-top: auto;
  }
}

@media (max-width: 991px) and (min-width: 768px) {
  /* Medium screens - tighter spacing for 3 cards */
  .stat-card .card-body {
    padding: 1rem !important;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .stat-value {
    font-size: 1.75rem;
  }

  .stat-unit {
    font-size: 0.875rem;
  }

  .company-time-value {
    font-size: 1.25rem;
  }

  .leave-item-row {
    padding: 0.5rem;
  }

  .leave-dates {
    font-size: 0.75rem;
  }

  .local-time-info {
    padding: 0.5rem !important;
  }

  .work-summary {
    padding: 0.75rem !important;
  }
}

@media (max-width: 767px) {
  .user-dashboard {
    padding: 0 0.5rem;
  }

  .stat-card {
    border-radius: 0.75rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .stat-value {
    font-size: 2rem;
  }

  .stat-unit {
    font-size: 1rem;
  }

  .alert-card {
    padding: 1rem;
    border-radius: 0.75rem;
  }

  .alert-icon {
    width: 44px;
    height: 44px;
  }

  .alert-title {
    font-size: 1rem;
  }

  /* Calendar Mobile */
  .calendar-card {
    border-radius: 0.75rem;
  }

  .calendar-cell {
    height: 50px;
    min-width: 36px;
    border-radius: 6px;
  }

  .calendar-day-number {
    font-size: 0.875rem;
  }

  .calendar-hours {
    font-size: 0.55rem;
    padding: 0 2px;
  }

  .calendar-leave-icon {
    font-size: 0.5rem;
  }

  .legend-item {
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
  }

  .legend-dot {
    width: 10px;
    height: 10px;
  }

  /* Tips Mobile */
  .tips-header {
    font-size: 0.875rem;
  }

  /* Company Time Mobile */
  .company-time-value {
    font-size: 1.5rem;
  }

  /* Improve touch targets on mobile */
  .leave-item-row {
    padding: 0.75rem;
    min-height: 44px;
  }

  .btn-sm {
    min-height: 44px;
    padding: 0.5rem 1rem;
  }
}

@media (max-width: 575px) {
  .calendar-cell {
    height: 44px;
    min-width: 32px;
    border-radius: 4px;
  }

  .calendar-table {
    border-spacing: 2px;
  }

  .calendar-day-number {
    font-size: 0.8rem;
  }

  .calendar-hours {
    display: none;
  }

  .stat-value {
    font-size: 1.75rem;
  }

  /* Alert cards on very small screens */
  .alert-card {
    flex-direction: column;
  }

  .alert-card .alert-icon {
    margin-bottom: 0.75rem;
    margin-right: 0 !important;
  }

  /* Tips card on very small screens */
  .did-you-know-card .card-header {
    padding: 0.5rem 0.75rem !important;
  }

  .did-you-know-card .card-body {
    padding: 0.75rem !important;
  }

  /* Full width buttons on mobile */
  .empty-state .btn {
    width: 100%;
  }
}

/* ===================================
   Animations
   =================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .stat-card,
  .alert-card,
  .calendar-cell,
  .leave-item-row,
  .tip-item {
    transition: none;
  }

  .stat-card:hover,
  .calendar-cell:hover,
  .leave-item-row:hover {
    transform: none;
  }
}
