/* Custom CSS for Employee Attendance Portal */

/* CSS Variables for consistent theming */
:root {
  /* Colors */
  --primary-50: #eff6ff;
  --primary-500: #2563eb;
  --primary-700: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-page: #f8f9fa;
  --bg-surface: #ffffff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --border-subtle: #e5e7eb;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Spacing */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-xxl: 64px;
  
  /* Shadows */
  --shadow-md: 0px 4px 8px -2px rgba(37, 99, 235, 0.08);
  --shadow-lg: 0px 10px 20px -5px rgba(37, 99, 235, 0.12);
  
  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* Base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-lg);
  border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

/* Dashboard Cards */
.stat-card {
  padding: var(--space-lg);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-500);
  margin-bottom: var(--space-xs);
}

.stat-card .stat-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.stat-card .stat-icon {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-size: 2rem;
  color: var(--primary-500);
}

/* Buttons */
.btn {
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  transition: all 200ms ease-out;
  border: none;
  font-family: var(--font-family);
}

.btn-primary {
  background: var(--primary-500);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

/* Status Badges */
.badge {
  padding: 6px 12px;
  border-radius: var(--radius-lg);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-status {
  background-color: var(--success);
  color: white;
}

.badge-pending {
  background-color: var(--warning);
  color: white;
}

.badge-rejected {
  background-color: var(--danger);
  color: white;
}

/* Forms */
.form-control, .form-select {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-family);
  transition: all 200ms ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

/* Navigation */
.navbar {
  box-shadow: var(--shadow-md);
  padding: var(--space-sm) 0;
}

.navbar-brand {
  font-size: 1.25rem;
}

.nav-link {
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: all 200ms ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--primary-50);
  color: var(--primary-700) !important;
}

/* Table Styles */
.table {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.table thead th {
  background: var(--bg-page);
  border-bottom: 2px solid var(--border-subtle);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
}

.table tbody tr {
  background: var(--bg-surface);
  transition: background-color 200ms ease;
}

.table tbody tr:hover {
  background: var(--bg-page);
}

.table tbody td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

/* Calendar Styles */
.calendar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.calendar-day {
  min-height: 100px;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-xs);
  position: relative;
  cursor: pointer;
  transition: background-color 200ms ease;
}

.calendar-day:hover {
  background: var(--primary-50);
}

.calendar-day .day-number {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.calendar-day.today .day-number {
  background: var(--primary-500);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day .status-indicator {
  position: absolute;
  bottom: var(--space-xs);
  left: var(--space-xs);
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.calendar-day.present .status-indicator {
  background: var(--success);
}

.calendar-day.half-day .status-indicator {
  background: var(--warning);
}

.calendar-day.absent .status-indicator {
  background: var(--danger);
}

.calendar-day.leave .status-indicator {
  background: var(--primary-500);
}

.calendar-day.weekend {
  background: #f5f5f5;
  color: var(--text-secondary);
}

/* Alert Styles */
.alert {
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-left: 4px solid var(--success);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border-left: 4px solid var(--danger);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border-left: 4px solid var(--warning);
}

.alert-info {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-500);
  border-left: 4px solid var(--primary-500);
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--border-subtle);
  border-top: 2px solid var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container-fluid {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }
  
  .stat-card {
    min-height: 100px;
    padding: var(--space-sm);
  }
  
  .stat-card .stat-number {
    font-size: 2rem;
  }
  
  .table-responsive {
    border-radius: var(--radius-md);
  }
  
  .calendar-day {
    min-height: 80px;
    padding: 4px;
  }
}

@media (max-width: 576px) {
  .card {
    margin-bottom: var(--space-sm);
  }
  
  .stat-card .stat-number {
    font-size: 1.5rem;
  }
  
  .btn {
    padding: 8px 16px;
    font-size: 0.875rem;
  }
}

/* Utility Classes */
.text-primary-custom {
  color: var(--primary-500) !important;
}

.text-success-custom {
  color: var(--success) !important;
}

.text-warning-custom {
  color: var(--warning) !important;
}

.text-danger-custom {
  color: var(--danger) !important;
}

.bg-primary-light {
  background-color: var(--primary-50) !important;
}

.border-primary {
  border-color: var(--primary-500) !important;
}

.shadow-custom {
  box-shadow: var(--shadow-md) !important;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 300ms ease-in;
}

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

.slide-up {
  animation: slideUp 300ms ease-out;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Print Styles */
@media print {
  .navbar,
  .btn,
  .alert {
    display: none !important;
  }
  
  .card {
    border: 1px solid #000;
    box-shadow: none;
  }
  
  .table {
    border: 1px solid #000;
  }
}