@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg-dark: #0B1120;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(245, 158, 11, 0.4);
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --accent-gold: #F59E0B;
  --accent-gold-hover: #D97706;
  --accent-blue: #3B82F6;
  --accent-indigo: #6366F1;
  --danger-red: #EF4444;
  --success-green: #10B981;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: radial-gradient(circle at top right, #1E1B4B 0%, #0B1120 55%);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .brand-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Login Overlay */
#loginOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, rgba(30, 58, 138, 0.4) 0%, rgba(11, 17, 32, 0.95) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.4s ease-out;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-glow);
  box-shadow: 0 25px 50px -12px rgba(245, 158, 11, 0.15);
}

.login-card::before {
  content: '';
  position: absolute;
  top: -50px;
  left: -50px;
  width: 100px;
  height: 100px;
  background: var(--accent-gold);
  filter: blur(80px);
  z-index: 0;
}

.login-header {
  position: relative;
  z-index: 1;
  margin-bottom: 30px;
}

.login-logo {
  font-size: 42px;
  margin-bottom: 12px;
  display: inline-block;
  animation: pulse 2s infinite;
}

.login-title {
  font-size: 26px;
  color: #FFFFFF;
  font-weight: 700;
}

.login-subtitle {
  font-size: 14px;
  color: var(--accent-gold);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
  position: relative;
  z-index: 1;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-gold) 0%, #B45309 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  position: relative;
  z-index: 1;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, #FBBF24 0%, #D97706 100%);
}

.btn-secondary {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger:hover {
  background: var(--danger-red);
  color: #FFFFFF;
}

.btn-action {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  margin-right: 6px;
}

.btn-action:hover {
  background: var(--accent-blue);
  color: #FFFFFF;
}

/* Main Application Header */
#mainApp {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}

.app-header {
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-indigo) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.brand-info h1 {
  font-size: 20px;
  color: #FFFFFF;
  margin: 0;
}

.brand-info span {
  font-size: 12px;
  color: var(--accent-gold);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.user-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.clock-display {
  font-size: 14px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  font-variant-numeric: tabular-nums;
}

.admin-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #F8FAFC;
  font-size: 14px;
}

.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gold);
  color: #0B1120;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* Navigation Tabs */
.tab-navbar {
  padding: 16px 32px 0;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 24px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.05);
  font-weight: 600;
}

/* Main Content Views */
.content-area {
  padding: 32px;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.view-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-section.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title {
  font-size: 24px;
  color: #FFFFFF;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.03) 100%);
  border-radius: 0 var(--radius-md) 0 100%;
}

.stat-icon {
  font-size: 28px;
  margin-bottom: 12px;
  display: inline-block;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: #FFFFFF;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Data Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.5);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 16px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(30, 41, 59, 0.4);
}

.data-table td {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Photo Report Grid & Cards */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px;
  margin-bottom: 24px;
  background: rgba(30, 41, 59, 0.4);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.report-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.report-img-wrapper {
  width: 100%;
  height: 220px;
  position: relative;
  background: #000000;
  overflow: hidden;
  cursor: pointer;
}

.report-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.report-img-wrapper:hover .report-img {
  transform: scale(1.06);
}

.report-time-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(11, 17, 32, 0.85);
  color: var(--accent-gold);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(4px);
}

.report-details {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.report-job {
  font-size: 17px;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.report-user {
  font-size: 14px;
  color: var(--accent-blue);
  font-weight: 500;
  margin-bottom: 12px;
}

.report-gps {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: monospace;
}

/* Modals & Lightbox */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-content {
  width: 100%;
  max-width: 520px;
  padding: 32px;
  max-height: 90vh;
  overflow-y: auto;
}

.lightbox-content {
  max-width: 900px;
  background: #000;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

.lightbox-img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 16px;
}

.modal-title {
  font-size: 20px;
  color: #FFFFFF;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* Responsive */
@media (max-width: 768px) {
  .app-header { padding: 12px 16px; flex-direction: column; gap: 12px; }
  .tab-navbar { padding: 8px 16px 0; }
  .content-area { padding: 16px; }
}
