/* Consolidated Custom CSS for Jobs Sub-app */
/* All optimized components combined for better compatibility */

/* ===========================================
   THEME VARIABLES
   ========================================== */
:root {
  /* Brand Colors - Override these for different sub-apps */
  --background-color: #73d8fd;
  --button-color: #07a1ff;
  --text-color: #000000;
  --hero-banner-bg: #fef7f4;
  --hero-banner-text: #010000;
  --job-list-bg: #e9e7fd;
  --job-list-text: #e9e7fd;
  --job-list-highlight-bg: #6a61f8;
  --job-list-highlight-text: #fef7f4;
  
  /* Form Colors */
  --form-error-border: #ef4444;
  --form-error-bg: #fef2f2;
  --form-error-text: #dc2626;
  
  /* Component Colors */
  --dropdown-border: #d1d5db;
  --dropdown-bg: #f9fafb;
  --dropdown-hover: #f3f4f6;
  --dropdown-focus: #3b82f6;
}

/* Theme application utilities */
.theme-bg {
  background-color: var(--background-color);
}

.theme-button {
  background-color: var(--button-color);
  border-color: var(--button-color);
  color: white;
  transition: all 0.2s ease;
}

.theme-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.hero-themed {
  background-color: var(--hero-banner-bg);
  color: var(--hero-banner-text);
}

/* ===========================================
   FORM VALIDATION STYLES
   ========================================== */

/* Form validation error styling */
.field-error {
  border-color: var(--form-error-border) !important;
  background-color: var(--form-error-bg) !important;
  box-shadow: 0 0 0 1px var(--form-error-border) !important;
}

.field-error:focus {
  border-color: var(--form-error-text) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

/* Group validation styling for radio/checkbox groups */
.validation-group-error {
  border-color: var(--form-error-border) !important;
  box-shadow: 0 0 0 2px var(--form-error-border) !important;
  border-radius: 0.5rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  padding-bottom: 0.75rem;
}

.validation-group-error legend {
  background-color: white;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* CAPTCHA validation styling */
.captcha-error {
  border-color: var(--form-error-border) !important;
  box-shadow: 0 0 0 2px var(--form-error-border) !important;
  border-radius: 0.5rem;
  padding: 0.5rem;
}

/* ===========================================
   ICON STYLES
   ========================================== */

/* Base icon styles */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Icon size utilities */
.icon.inline {
  display: inline;
  vertical-align: text-bottom;
}

/* Ensure icons inherit color properly */
.icon svg {
  stroke: currentColor;
  fill: none;
}

/* Icon spacing utilities (these work with Tailwind classes) */
.icon.mr-1 { margin-right: 0.25rem; }
.icon.mr-2 { margin-right: 0.5rem; }
.icon.mr-3 { margin-right: 0.75rem; }
.icon.ml-1 { margin-left: 0.25rem; }
.icon.ml-2 { margin-left: 0.5rem; }
.icon.mt-1 { margin-top: 0.25rem; }

/* ===========================================
   DROPZONE COMPONENT STYLES
   ========================================== */

/* Clean Dropzone container - with proper spacing */
.dropzone-container {
  border: 2px dashed #d1d5db !important;
  border-radius: 0.5rem !important;
  background: #f9fafb !important;
  transition: all 0.2s ease !important;
  min-height: 165px !important;
  cursor: pointer !important;
  padding: 20px !important;
  margin-bottom: 24px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.dropzone-container:hover {
  border-color: #9ca3af !important;
  background: #f3f4f6 !important;
}

.dropzone-container.dz-drag-hover {
  border-color: #6b7280 !important;
  background: #f3f4f6 !important;
  border-style: dashed !important;
}

/* Reset default Dropzone styling */
.dropzone {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: auto !important;
  transition: all 0.3s ease;
  position: relative !important;
  overflow: visible !important;
}

/* Override default Dropzone message */
.dropzone .dz-message {
  margin: 0 !important;
  opacity: 1 !important;
}

/* File previews arranged horizontally - clean layout */
.dropzone .file-previews-container {
  display: flex !important;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
  width: 100% !important;
  clear: both !important;
}

/* Enhanced file preview styling - fixed layout with state indicators */
.dropzone .dz-preview {
  position: relative !important;
  display: inline-block !important;
  vertical-align: top !important;
  margin: 0 !important;
  width: 120px !important;
  min-height: 140px !important;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  transition: all 0.2s ease;
  animation: fadeInUp 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.dropzone .dz-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-color: #3b82f6;
}

/* File state specific styling */
.dropzone .dz-preview.dz-processing {
  border-color: #3b82f6 !important;
  background: linear-gradient(135deg, #eff6ff, #dbeafe) !important;
  animation: pulse 2s infinite;
}

.dropzone .dz-preview.dz-success {
  border-color: #10b981 !important;
  background: white !important; /* Clean white background for successful uploads */
  animation: none !important; /* Stop any ongoing animations */
}

.dropzone .dz-preview.dz-error {
  border-color: #ef4444 !important;
  background: linear-gradient(135deg, #fef2f2, #fee2e2) !important;
  animation: none !important; /* Stop any ongoing animations */
}

/* Custom file icon styling - centered properly with visibility */
.dropzone .dz-image {
  width: 48px !important;
  height: 48px !important;
  margin: 8px auto 4px auto !important;
  border-radius: 4px !important;
  background: #f3f4f6 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  z-index: 1 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.dropzone .dz-image img,
.dropzone .dz-image svg {
  width: 24px !important;
  height: 24px !important;
  object-fit: contain !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

/* File details styling - proper layout flow */
.dropzone .dz-details {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  width: 100% !important;
  pointer-events: none !important;
}

.dropzone .dz-filename {
  font-size: 10px !important;
  line-height: 1.2 !important;
  color: #374151 !important;
  font-weight: 500 !important;
  margin: 4px 0 !important;
  word-break: break-all !important;
  text-align: center !important;
  max-width: 100% !important;
  display: block !important;
  height: auto !important;
}

.dropzone .dz-size {
  font-size: 11px !important;
  color: #6b7280 !important;
  margin: 4px 0 8px 0 !important;
  text-align: center !important;
  display: block !important;
}

.dropzone .dz-progress {
  background: #e5e7eb !important;
  border-radius: 4px !important;
  height: 8px !important;
  overflow: hidden !important;
  margin: 8px 0 4px 0 !important;
  width: 100% !important;
  position: relative !important;
  z-index: 15 !important;
  box-shadow: none !important;
  border: none !important;
}

/* Progress bar states - better control of visibility and animation */
.dropzone .dz-preview .dz-progress {
  opacity: 0 !important; /* Hidden by default */
  transition: opacity 0.2s ease !important;
}

.dropzone .dz-preview.dz-processing .dz-progress {
  opacity: 1 !important; /* Show during upload */
  transition: all 0.2s linear !important;
}

.dropzone .dz-preview.dz-complete .dz-progress {
  opacity: 0 !important; /* Hide when complete */
  transition: opacity 0.4s ease-in !important;
}

.dropzone .dz-preview:not(.dz-processing) .dz-progress {
  animation: none !important;
}

/* Progress bar upload portion - starts at 0% and animates */
.dropzone .dz-progress .dz-upload {
  background: linear-gradient(90deg, #10b981, #059669) !important;
  border-radius: 4px !important;
  transition: width 0.3s ease !important;
  height: 100% !important;
  display: block !important;
  position: relative !important;
  z-index: 16 !important;
  width: 0% !important; /* Always start at 0% width */
}

.dropzone .dz-remove {
  font-size: 10px !important;
  color: #ef4444 !important;
  text-decoration: none !important;
  display: block !important;
  margin: 4px 0 0 0 !important;
  text-align: center !important;
  z-index: 20 !important;
  pointer-events: auto !important;
  padding: 2px 4px !important;
  white-space: nowrap !important;
}

.dropzone .dz-remove:hover {
  color: #dc2626 !important;
  text-decoration: underline !important;
}

/* Hide success and error marks by default - we use remove buttons instead */
.dropzone .dz-success-mark,
.dropzone .dz-error-mark {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Hide error message by default - only show when there's an actual error */
.dropzone .dz-error-message {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Show error message only when file has error state */
.dropzone .dz-preview.dz-error .dz-error-message {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: linear-gradient(135deg, #fef2f2, #fee2e2) !important;
  border: 1px solid #fecaca !important;
  border-radius: 8px !important;
  color: #dc2626 !important;
  padding: 8px 12px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  position: absolute !important;
  bottom: -40px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  white-space: nowrap !important;
  z-index: 35 !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: blur(8px) !important;
  animation: slideInDown 0.3s ease !important;
}

.dropzone .dz-preview.dz-error .dz-error-message::before {
  content: "" !important;
  position: absolute !important;
  top: -6px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 0 !important;
  height: 0 !important;
  border-left: 6px solid transparent !important;
  border-right: 6px solid transparent !important;
  border-bottom: 6px solid #fecaca !important;
}

/* Upload prompt styling - ensure visibility */
.dropzone .upload-prompt {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
  min-height: 140px !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Ensure upload prompt content is visible */
.dropzone .upload-prompt *,
.dropzone .upload-prompt svg,
.dropzone .upload-prompt p {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

.dropzone .upload-prompt svg {
  display: block !important;
  width: 64px !important;
  height: 64px !important;
}

/* Hide upload prompt when files are present */
.dropzone.has-files .upload-prompt {
  display: none !important;
}

/* Clean up any default dropzone artifacts and add proper spacing */
.dropzone .dz-default.dz-message {
  display: none !important;
}

.dropzone .dz-preview .dz-details .dz-size span,
.dropzone .dz-preview .dz-details .dz-filename span {
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

.dropzone .dz-preview.dz-file-preview .dz-details {
  opacity: 1 !important;
}

.dropzone .dz-preview.dz-image-preview {
  background: white !important;
}

/* Success and error marks are hidden by default - using remove buttons instead */

.dropzone .dz-preview:after,
.dropzone .dz-preview:before {
  display: none !important;
}

/* Fix container spacing and eliminate bottom artifacts */
.dropzone .file-previews-container {
  margin-bottom: 20px !important;
  padding-bottom: 10px !important;
}

/* Ensure dropzone container has proper bottom spacing */
.dropzone-container {
  margin-bottom: 20px !important;
  padding-bottom: 20px !important;
}

/* Hide any default dropzone generated elements */
.dropzone > div:not(.upload-prompt):not(.file-previews-container) {
  display: none !important;
}

/* Aggressively hide dropzone artifacts */
.dropzone .dz-preview .dz-details .dz-size span,
.dropzone .dz-preview .dz-details .dz-filename span,
.dropzone .dz-preview .dz-details .dz-filename .dz-filename:not(:hover) span {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Remove any pink/colored backgrounds from default elements */
.dropzone .dz-preview .dz-filename:hover span,
.dropzone .dz-preview .dz-filename span {
  background-color: transparent !important;
  border: none !important;
}

/* Hide only specific problematic default dropzone elements */
.dropzone .dz-default:not(.dz-message) {
  display: none !important;
}

/* Hide the checkbox-like artifact specifically */
.dropzone input[type="checkbox"],
.dropzone input[type="radio"],
.dropzone .dz-clickable input,
.dropzone input[type="file"] {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
}

/* Target any form elements that might be creating artifacts */
.dropzone form,
.dropzone input:not([type="hidden"]),
.dropzone button:not(.dz-remove) {
  display: none !important;
  visibility: hidden !important;
}

/* Comprehensive cleanup of all dropzone artifacts */
.dropzone .dz-preview::after,
.dropzone .dz-preview::before,
.dropzone::after,
.dropzone::before,
.dropzone-container::after,
.dropzone-container::before {
  display: none !important;
  content: none !important;
}

/* Restore upload prompt visibility */
.dropzone .upload-prompt,
.dropzone .upload-prompt * {
  background-color: transparent !important;
  background-image: none !important;
}

/* Ensure file icon backgrounds are visible */
.dropzone .dz-image {
  background-color: #f3f4f6 !important;
  background-image: none !important;
}

/* Keep other elements clean */
.dropzone .dz-filename,
.dropzone .dz-size,
.dropzone .dz-remove {
  background-color: transparent !important;
  background-image: none !important;
}

/* Specific overrides for containers and previews */
.dropzone .dz-preview {
  background-color: white !important;
  background-image: none !important;
}

.dropzone-container {
  background: #f9fafb !important;
}

/* ===========================================
   CUSTOM SELECT COMPONENTS
   ========================================== */

/* Custom select dropdown styling */
.custom-select-dropdown {
  min-width: 100%;
  max-height: 15rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dropdown-border) var(--dropdown-bg);
}

.custom-select-dropdown::-webkit-scrollbar {
  width: 6px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
  background: var(--dropdown-bg);
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
  background-color: var(--dropdown-border);
  border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
  background-color: #9ca3af;
}

/* Multi-select tags styling */
.multiselect-tag {
  transition: all 0.15s ease-in-out;
}

.multiselect-tag:hover {
  background-color: rgb(147 197 253);
  color: rgb(30 58 138);
}

.multiselect-tag button:hover {
  color: rgb(30 58 138) !important;
}

/* ===========================================
   JOB CONTENT FORMATTING
   ========================================== */

.job-content {
  line-height: 1.7;
  color: #374151;
}

.job-content p {
  margin-bottom: 1.25rem;
}

.job-content p:last-child {
  margin-bottom: 0;
}

/* Text formatting */
.job-content strong,
.job-content b {
  font-weight: 700;
  color: #1f2937;
}

.job-content em,
.job-content i {
  font-style: italic;
}

.job-content u {
  text-decoration: underline;
}

.job-content mark {
  background-color: #fef3c7;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
}

.job-content small {
  font-size: 0.875rem;
  color: #6b7280;
}

/* Headings */
.job-content h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1.5rem;
  margin-top: 2rem;
  line-height: 1.2;
}

.job-content h1:first-child {
  margin-top: 0;
}

.job-content h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1.25rem;
  margin-top: 1.75rem;
  line-height: 1.3;
}

/* Lists - restore default styling removed by Tailwind reset */
.job-content ul,
.job-content ol {
  margin-bottom: 1.25rem;
  padding-left: 2rem;
}

.job-content ul {
  list-style-type: disc;
}

.job-content ol {
  list-style-type: decimal;
}

.job-content li {
  margin-bottom: 0.5rem;
}

.job-content li:last-child {
  margin-bottom: 0;
}

/* Nested lists - only apply different styles to nested lists, not top-level */
.job-content ul ul {
  list-style-type: circle;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.job-content ul ul ul {
  list-style-type: square;
}

.job-content ol ol {
  list-style-type: lower-alpha;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.job-content ol ol ol {
  list-style-type: lower-roman;
}

/* ===========================================
   JOB-SPECIFIC STYLES
   ========================================== */

/* Scrollable content areas - responsive height calculation */
.scrollable-content {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* Fixed header and footer with backdrop blur */
.fixed-header,
.fixed-footer {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Enhanced shadow effects */
.shadow-header {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-footer {
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 -2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Job listing hover effects */
.job-listing:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease-in-out;
}

/* Company info panel with backdrop filter */
.company-info-panel {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

/* Flash message gradient backgrounds */
.flash-gradient-danger {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.flash-gradient-success {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.flash-gradient-info {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.flash-gradient-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

/* ===========================================
   SHARETHIS WIDGET STYLING
   ========================================== */

.sharethis-sticky-share-buttons {
  position: fixed !important;
  left: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 9999 !important;
}

#st-1,
.st-sticky-share-buttons {
  position: fixed !important;
  left: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 9999 !important;
}

.st-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 48px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-sizing: border-box !important;
}

.st-btn svg,
.st-btn img {
  width: 32px !important;
  height: 32px !important;
  display: block !important;
}

.st-btn[data-network] .st-label {
  display: none !important;
}

.st-btn * {
  box-sizing: border-box !important;
}

.sharethis-sticky-share-buttons img {
  display: block !important;
  max-width: 100% !important;
  height: auto !important;
}

/* ===========================================
   ANIMATIONS & UTILITIES
   ========================================== */

/* Loading spinner animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin 1s linear infinite;
}

/* Dropzone animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes bounceIn {
  from, 20%, 40%, 60%, 80%, to {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }
  0% {
    opacity: 0;
    transform: scale3d(.3, .3, .3);
  }
  20% {
    transform: scale3d(1.1, 1.1, 1.1);
  }
  40% {
    transform: scale3d(.9, .9, .9);
  }
  60% {
    opacity: 1;
    transform: scale3d(1.03, 1.03, 1.03);
  }
  80% {
    transform: scale3d(.97, .97, .97);
  }
  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Alpine.js transition classes */
[x-transition] {
  transition-property: opacity, transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Ensure Alpine.js cloak works properly */
[x-cloak] {
  display: none !important;
}

/* ===========================================
   MODAL STYLING
   ========================================== */

/* Ensure modal background is semi-transparent, not solid black */
.fixed.inset-0.bg-black.bg-opacity-50 {
  background-color: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(4px) !important;
}

/* ===========================================
   RECAPTCHA BADGE POSITIONING
   ========================================== */

/* Position reCAPTCHA badge at bottom of screen, in front of footer */
.grecaptcha-badge {
  bottom: 0 !important; /* Keep at bottom of screen */
  z-index: 50 !important; /* Higher than footer's z-index of 40 to appear in front */
}

/* ===========================================
   UTILITY CLASSES
   ========================================== */

/* Utility classes for theme application */
.btn-primary-custom {
  background-color: var(--button-color);
  border-color: var(--button-color);
  color: white;
  transition: all 0.2s ease;
}

.btn-primary-custom:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Hero section with theme variables */
.hero-section {
  background-color: var(--hero-banner-bg);
  color: var(--hero-banner-text);
}

/* ===========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Hide ShareThis buttons on tablets and smaller screens */
@media (max-width: 1024px) {
  .sharethis-sticky-share-buttons,
  #st-1,
  .st-sticky-share-buttons {
    display: none !important;
  }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .scrollable-content {
    max-height: calc(100vh - 150px);
  }
  
  .hero-section {
    padding: 1rem;
  }

  .job-content {
    font-size: 0.875rem;
  }

  .job-content h1 {
    font-size: 1.75rem;
  }

  .job-content h2 {
    font-size: 1.5rem;
  }

  .job-content h3 {
    font-size: 1.25rem;
  }

  .job-content ul,
  .job-content ol {
    padding-left: 1.25rem;
  }
}
