/**
 * HEC Bore Merger - Shared Styles
 * Phase 3.3 - Clean, modern design with HEC orange accents
 */

:root {
  --hec-orange: #FF6B35;
  --hec-orange-hover: #E85A28;
  --hec-orange-light: #FFF3EF;

  /* Dark Theme Colors */
  --primary-bg: #0a0a0a;
  --secondary-bg: rgba(17,24,39,0.95);
  --card-bg: rgba(17,24,39,0.95);
  --border-color: rgba(75,85,99,0.3);
  --text-primary: #ffffff;
  --text-secondary: #ffffff;
  --text-muted: #ffffff;

  /* Action Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #3b82f6;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.5);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --transition: all 0.2s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica', 'Arial', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--primary-bg);
  background-image: radial-gradient(circle at 25% 25%, #1a1a2e 0%, transparent 50%),
                    radial-gradient(circle at 75% 75%, #16213e 0%, transparent 50%);
  margin: 0;
  padding: 0;
  padding-top: calc(60px + env(safe-area-inset-top));
}

/* ============================================
   Navigation Bar
   ============================================ */

.nav-bar {
  background: var(--secondary-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding-top: env(safe-area-inset-top);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-brand img {
  height: 32px;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-link {
  padding: 8px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-weight: 500;
}

.nav-link:hover {
  background: rgba(59,130,246,0.1);
  color: var(--info);
}

.nav-link.active {
  background: var(--info);
  color: white;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user-name {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background: #059669;
}

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

.btn-secondary:hover:not(:disabled) {
  background: #b91c1c;
}

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

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
}

/* ============================================
   Cards
   ============================================ */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card h2 {
  color: var(--hec-orange) !important;
}

.card h3 {
  color: var(--hec-orange) !important;
}

#job-name {
  color: var(--hec-orange) !important;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 16px;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--secondary-bg);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ============================================
   Job Cards (Grid)
   ============================================ */

.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.job-card {
  cursor: pointer;
  position: relative;
}

.job-card .card-body {
  padding-top: 50px;
}

.job-card-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.job-card-badge.active {
  background: #D4EDDA;
  color: #155724;
}

.job-card-badge.on-hold {
  background: #FFF3CD;
  color: #856404;
}

.job-card-badge.completed {
  background: #D1ECF1;
  color: #0C5460;
}

.job-card-badge.cancelled {
  background: #F8D7DA;
  color: #721C24;
}

.job-card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.job-card-meta {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 16px;
  line-height: 1.6;
}

.job-card-meta div {
  margin-bottom: 4px;
}

.job-card-stats {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   Tabs
   ============================================ */

.tabs {
  border-bottom: 2px solid var(--border-color);
  display: flex;
  gap: 0;
  margin-bottom: 24px;
}

.tab {
  padding: 12px 20px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  position: relative;
  bottom: -2px;
}

.tab:hover {
  color: var(--hec-orange);
  background: var(--hec-orange-light);
}

.tab.active {
  color: var(--hec-orange);
  border-bottom-color: var(--hec-orange);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================
   Forms
   ============================================ */

.form-group {
  margin-bottom: 20px;
}

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--hec-orange);
  box-shadow: 0 0 0 3px var(--hec-orange-light);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-help {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px 20px;
  min-width: 300px;
  max-width: 400px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideIn 0.3s ease;
  border-left: 4px solid var(--hec-orange);
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast-icon {
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hec-orange);
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.error .toast-icon {
  color: var(--danger);
}

.toast.warning .toast-icon {
  color: var(--warning);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 13px;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   Modals
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow: auto;
  animation: scaleIn 0.2s ease;
}

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

.modal-title {
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================
   Utility Classes
   ============================================ */

.container {
  max-width: 1400px;
  margin: 60px auto 0 auto;
  padding: 24px;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex {
  display: flex;
}

.align-items-center {
  align-items: center;
}

.justify-content-between {
  justify-content: space-between;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.hidden {
  display: none !important;
}

/* ============================================
   Footer Styles
   ============================================ */
.site-footer {
  background: rgba(17,24,39,0.98);
  border-top: 1px solid rgba(75,85,99,0.3);
  padding: 24px 0 16px 0;
  margin-top: 48px;
  color: rgba(156,163,175,0.9);
  font-size: 13px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(75,85,99,0.2);
}

.footer-brand {
  flex: 1;
  min-width: 200px;
}

.footer-version {
  font-size: 18px;
  font-weight: 600;
  color: var(--hec-orange);
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 12px;
  color: rgba(156,163,175,0.7);
  line-height: 1.5;
}

.footer-contact {
  flex: 1;
  min-width: 200px;
}

.footer-section-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(209,213,219,0.9);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.footer-link {
  display: block;
  color: rgba(156,163,175,0.9);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--hec-orange);
}

.footer-link-icon {
  margin-right: 6px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: rgba(156,163,175,0.7);
}

.footer-copyright {
  flex: 1;
}

.footer-powered {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-powered-link {
  color: rgba(59,130,246,0.8);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-powered-link:hover {
  color: rgba(59,130,246,1);
}

/* Mobile-specific footer spacing for pages WITH bottom nav */
body.has-bottom-nav .site-footer {
  padding-bottom: 80px;
}

@media (max-width: 768px) {
  .site-footer {
    margin-top: 24px;
    padding: 16px 0 16px 0;
  }

  /* Extra bottom padding only for pages with bottom nav */
  body.has-bottom-nav .site-footer {
    padding-bottom: 80px;
  }

  .footer-top {
    flex-direction: column;
    gap: 16px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .footer-brand,
  .footer-contact {
    min-width: 100%;
  }
}


.job-card {
  position: relative;
}

.job-card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.job-menu-toggle {
  padding: 6px 12px;
  font-size: 13px;
  background: rgba(31,41,55,0.8);
  background-image: none;
  border: 1px solid rgba(75,85,99,0.4);
  border-radius: 6px;
  color: #9ca3af !important;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  box-shadow: none;
  text-shadow: none;
  text-decoration: none;
}

.job-menu-toggle:hover {
  background: rgba(31,41,55,0.95);
  color: #ffffff !important;
  border-color: rgba(75,85,99,0.6);
}

.job-menu-toggle::before,
.job-menu-toggle::after {
  content: none !important;
  display: none !important;
}

/* Job card menu styles */
.job-card {
  position: relative;
}

.job-card-menu {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
}

.job-card-menu-toggle {
  padding: 6px 12px;
  font-size: 13px;
  background: rgba(31,41,55,0.85);
  border: 1px solid rgba(75,85,99,0.4);
  border-radius: 6px;
  color: #9ca3af;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.job-card-menu-toggle:hover {
  background: rgba(55,65,81,0.9);
  color: #f9fafb;
  border-color: rgba(148,163,184,0.5);
}

.job-card-menu-caret {
  font-size: 11px;
  margin-left: 4px;
  color: inherit !important;
  opacity: 1 !important;
}

.job-card-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 170px;
  background: rgba(17,24,39,0.98);
  border: 1px solid rgba(75,85,99,0.3);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  overflow: hidden;
}

.job-card-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  text-align: left;
  font-size: 13px;
  color: #e5e7eb;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.job-card-dropdown-item:hover {
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
}

.job-card-dropdown-item.job-menu-delete {
  color: #f87171;
}

.job-card-dropdown-item.job-menu-delete:hover {
  background: rgba(248,113,113,0.12);
  color: #fca5a5;
}

.job-card-title-link {
  text-decoration: none;
  color: #3b82f6;
  font-size: 20px;
  font-weight: 600;
  display: block;
  margin-bottom: 12px;
  transition: color 0.2s ease;
}

.job-card-title-link:hover {
  color: #60a5fa;
}

/* ============================================
   Job Detail Information Sections - Version 2
   Enhanced Hierarchy with Size & Weight Variation
   ============================================ */

.detail-section {
  margin-top: 20px;
  padding: 24px;
  background: rgba(31,41,55,0.4);
  border-radius: 8px;
  border-left: 3px solid var(--hec-orange);
}

.detail-section h3 {
  margin: 0 0 20px 0;
  color: var(--hec-orange);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.detail-item {
  padding: 12px;
  background: rgba(17,24,39,0.6);
  border-radius: 6px;
  border: 1px solid rgba(75,85,99,0.2);
}

.detail-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9ca3af;
  margin-bottom: 6px;
}

.detail-value {
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.4;
}

/* Special styling for description and notes fields */
.detail-description {
  margin-top: 16px;
  padding: 16px;
  background: rgba(17,24,39,0.6);
  border-radius: 6px;
  border: 1px solid rgba(75,85,99,0.2);
}

.detail-description .detail-label {
  margin-bottom: 8px;
}

.detail-description .detail-value {
  line-height: 1.6;
  white-space: pre-wrap;
}
