/* approved.css - Optimized for perfect image display */
:root {
  --primary: #2c3e50;
  --secondary: #3498db;
  --accent: #e74c3c;
  --light: #ecf0f1;
  --dark: #2c3e50;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --gray: #95a5a6;
  --light-gray: #f8f9fa;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f7f9;
}

.container-main {
  margin-top: 20px;
  margin-bottom: 20px;
}

/* ===== PERFECT IMAGE DISPLAY SOLUTION ===== */

/* Reset ALL images in job cards */
.job-card img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Single image container - Full display without clipping */
.job-image-container:not(.multi) {
  width: 100%;
  height: 250px;
  padding: 0;
  margin: 0;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.job-image-container:not(.multi) img.job-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0 auto;
}

/* Multi-image container - Perfect thumbnails */
.job-image-container.multi {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: #f8f9fa;
  min-height: 150px;
}

.job-image-container.multi .thumb-box {
  width: 140px;
  height: 100px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.job-image-container.multi img.job-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 4px;
}

/* Thumbnail delete button */
.thumb-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(231, 76, 60, 0.9);
  color: white;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  opacity: 0;
  z-index: 10;
}

.thumb-box:hover .thumb-delete {
  opacity: 1;
}

.thumb-delete:hover {
  background: var(--danger);
  transform: scale(1.1);
}

/* ===== JOB CARD LAYOUT ===== */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.job-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.job-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.job-card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.business-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 5px;
  line-height: 1.2;
}

.location {
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 15px;
}

.job-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 10px;
  line-height: 1.3;
}

.job-description {
  color: #555;
  margin-bottom: 15px;
  line-height: 1.5;
  flex: 1;
}

.job-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.job-meta i {
  color: var(--secondary);
}

.contact-info {
  margin-bottom: 15px;
}

.contact-info div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.contact-info i {
  color: var(--secondary);
  width: 16px;
}

.card-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 15px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  color: white;
  border: none;
  cursor: pointer;
}

.social-link i {
  font-size: 16px;
}

.social-link.whatsapp {
  background: #25D366;
}

.social-link.instagram {
  background: #E1306C;
}

.social-link.facebook {
  background: #3b5998;
}

.social-link.tiktok {
  background: #000000;
}

.social-link.email {
  background: var(--gray);
}

.social-link:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  color: white;
}

.edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  background: var(--warning);
  color: white;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.edit-btn:hover {
  background: #e67e22;
  transform: translateY(-2px);
  color: white;
}

/* ===== MESSAGE AREA ===== */
.page-message {
  margin-bottom: 20px;
}

.alert {
  border-radius: 8px;
  padding: 12px 20px;
  margin-bottom: 15px;
  border: none;
  font-weight: 500;
}

.alert-danger {
  background-color: rgba(231, 76, 60, 0.15);
  color: #c0392b;
}

.alert-success {
  background-color: rgba(39, 174, 96, 0.15);
  color: #27ae60;
}

/* ===== COMPACT FILTER ===== */
.compact-filter {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 25px;
}

.search-form {
  width: 100%;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}

.filter-item {
  flex: 1;
  min-width: 150px;
}

.filter-item.search {
  flex: 2;
}

.filter-item .form-control-sm {
  border-radius: 6px;
  border: 1px solid #ddd;
  padding: 8px 12px;
  font-size: 14px;
  transition: var(--transition);
}

.filter-item .form-control-sm:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.filter-item .btn-primary {
  background-color: var(--secondary);
  border: none;
  border-radius: 6px;
  padding: 8px 15px;
  transition: var(--transition);
}

.filter-item .btn-primary:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
}

/* ===== HERO SLIDER ===== */
.hero-slider {
  position: relative;
  height: 400px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}

.slide.active {
  opacity: 1;
}

.slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
}

.caption {
  position: relative;
  color: white;
  font-size: 28px;
  font-weight: 700;
  padding: 30px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 1;
  width: 100%;
  max-width: calc(100% - 100px); /* Prevent overlapping with arrows */
  margin: 0 auto 20px; /* Add bottom margin for dots */
  text-align: center;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
}

.slider-btn:hover {
  background: white;
}

.slider-btn.prev {
  left: 20px;
}

.slider-btn.next {
  right: 20px;
}

.slider-btn i {
  font-size: 20px;
  color: var(--dark);
}

.dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition);
}

.dot.active {
  background: white;
}

.dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
  .jobs-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

@media (max-width: 992px) {
  .jobs-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
  
  .job-image-container:not(.multi) {
    height: 220px;
  }
  
  .job-image-container.multi .thumb-box {
    width: 130px;
    height: 90px;
  }
  
  .caption {
    font-size: 24px;
    padding: 25px;
    max-width: calc(100% - 90px);
  }
}

@media (max-width: 768px) {
  .jobs-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .job-image-container:not(.multi) {
    height: 200px;
  }
  
  .job-image-container.multi .thumb-box {
    width: 120px;
    height: 80px;
  }
  
  .filter-row {
    flex-direction: column;
  }
  
  .filter-item {
    min-width: 100%;
  }
  
  .hero-slider {
    height: 300px;
  }
  
  .caption {
    font-size: 20px;
    padding: 20px;
    max-width: calc(100% - 80px);
    margin-bottom: 15px;
  }
  
  .slider-btn {
    width: 40px;
    height: 40px;
  }
  
  .slider-btn.prev {
    left: 15px;
  }
  
  .slider-btn.next {
    right: 15px;
  }
  
  .slider-btn i {
    font-size: 16px;
  }
}

@media (max-width: 576px) {
  .job-image-container:not(.multi) {
    height: 180px;
  }
  
  .job-image-container.multi {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .job-image-container.multi .thumb-box {
    width: calc(50% - 10px);
    height: 100px;
    max-width: 160px;
  }
  
  .hero-slider {
    height: 250px;
  }
  
  .caption {
    font-size: 18px;
    padding: 15px;
    max-width: calc(100% - 60px);
    margin-bottom: 10px;
  }
  
  .slider-btn {
    width: 35px;
    height: 35px;
  }
  
  .slider-btn.prev {
    left: 10px;
  }
  
  .slider-btn.next {
    right: 10px;
  }
  
  .slider-btn i {
    font-size: 14px;
  }
  
  .dots {
    bottom: 15px;
  }
  
  .dot {
    width: 10px;
    height: 10px;
  }
  
  .container-main {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .card-buttons {
    flex-direction: column;
  }
  
  .social-link, .edit-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Extra small devices */
@media (max-width: 400px) {
  .hero-slider {
    height: 200px;
  }
  
  .caption {
    font-size: 16px;
    padding: 12px;
    max-width: calc(100% - 50px);
    margin-bottom: 8px;
  }
  
  .slider-btn {
    width: 30px;
    height: 30px;
  }
  
  .slider-btn.prev {
    left: 8px;
  }
  
  .slider-btn.next {
    right: 8px;
  }
  
  .slider-btn i {
    font-size: 12px;
  }
  
  .dots {
    bottom: 10px;
  }
  
  .dot {
    width: 8px;
    height: 8px;
  }
}

/* ===== PAGE HEADING ===== */
.page-headcontainer {
  margin-bottom: 30px;
}

.page-headcontainer h4 {
  font-size: 32px;
  color: var(--dark);
  margin-bottom: 10px;
  font-weight: 700;
}

.page-headcontainer p {
  font-size: 18px;
  color: var(--gray);
}

/* ===== IMAGE MODAL ===== */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
}

.close-x {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10000;
}

.close-x:hover {
  color: var(--accent);
}

/* ===== EDIT MODAL STYLES ===== */
.modal-content {
  border-radius: 12px;
  overflow: hidden;
  border: none;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
  background: var(--light);
  border-bottom: 1px solid #ddd;
  padding: 15px 20px;
}

.modal-title {
  font-weight: 700;
  color: var(--dark);
}

.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  border-top: 1px solid #ddd;
  padding: 15px 20px;
}

.form-label {
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 5px;
}

.form-control {
  border-radius: 6px;
  padding: 10px 15px;
  border: 1px solid #ddd;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Map Container */
.map-container {
  height: 300px;
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ddd;
}

#locationMap {
  height: 100%;
  width: 100%;
}

.coordinates-input {
  font-size: 0.875rem;
  color: var(--gray);
}

/* Upload Area Styles */
.upload-area {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--light-gray);
}

.upload-area:hover {
  border-color: var(--secondary);
  background: rgba(52, 152, 219, 0.05);
}

.upload-area.dragover {
  border-color: var(--secondary);
  background: rgba(52, 152, 219, 0.1);
}

.upload-area i {
  color: var(--gray);
  margin-bottom: 10px;
}

/* Image Preview Styles */
.image-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.preview-image {
  width: 120px;
  height: 80px;
  object-fit: contain;
  border-radius: 6px;
  border: 2px solid #dee2e6;
  background: white;
  padding: 4px;
}

/* Existing Images Styles */
#existingImages {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

#existingImages .position-relative {
  width: 120px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #dee2e6;
}

#existingImages img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 4px;
}

#existingImages .btn-danger {
  width: 20px;
  height: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.btn {
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 600;
  transition: var(--transition);
  border: none;
}

.btn-success {
  background: var(--success);
}

.btn-success:hover {
  background: #219653;
}

.btn-secondary {
  background: var(--gray);
}

.btn-secondary:hover {
  background: #7f8c8d;
}

/* ===== NO RESULTS ===== */
.alert-info {
  background: rgba(52, 152, 219, 0.15);
  color: var(--secondary);
  border: none;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
}

.alert-info h4 {
  margin-bottom: 10px;
  font-weight: 700;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
  .jobs-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

@media (max-width: 992px) {
  .jobs-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
  
  .job-image-container:not(.multi) {
    height: 220px;
  }
  
  .job-image-container.multi .thumb-box {
    width: 130px;
    height: 90px;
  }
}

@media (max-width: 768px) {
  .jobs-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .job-image-container:not(.multi) {
    height: 200px;
  }
  
  .job-image-container.multi .thumb-box {
    width: 120px;
    height: 80px;
  }
  
  .filter-row {
    flex-direction: column;
  }
  
  .filter-item {
    min-width: 100%;
  }
  
  .hero-slider {
    height: 300px;
  }
  
  .caption {
    font-size: 20px;
    padding: 20px;
  }
}

@media (max-width: 576px) {
  .job-image-container:not(.multi) {
    height: 180px;
  }
  
  .job-image-container.multi {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .job-image-container.multi .thumb-box {
    width: calc(50% - 10px);
    height: 100px;
    max-width: 160px;
  }
  
  .hero-slider {
    height: 250px;
  }
  
  .caption {
    font-size: 18px;
  }
  
  .container-main {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .card-buttons {
    flex-direction: column;
  }
  
  .social-link, .edit-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===== FORCE OVERRIDE INLINE STYLES ===== */
/* This will ensure no image clipping occurs */
.job-image-container:not(.multi) img[style] {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  position: static !important;
  top: auto !important;
  left: auto !important;
}

.job-image-container.multi img[style] {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}