/* ===== PAGE HEADER STYLING ===== */
.page-header {
  margin-bottom: 25px;
}

.page-header h1 {
  font-size: 28px;
  margin-bottom: 8px;
  font-weight: 600;
}

.page-header p {
  font-size: 16px;
  margin: 0;
}

/* ===== HEADER WITH BACK BUTTON ===== */
.header-with-back {
  position: relative;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #3498db;
  text-decoration: none;
  border: 1px solid #3498db;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 15px;
  transition: all 0.2s ease;
}

.back-button:hover {
  background-color: #3498db;
  color: white;
}

/* ===== ALERT STYLING ===== */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin: 12px 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 16px;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-success::before {
  content: "\f058"; /* fa-check-circle */
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert-danger::before {
  content: "\f06a"; /* fa-exclamation-triangle */
}

/* ===== CARD STYLING ===== */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-top: 16px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.card-header h3 {
  margin: 0;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 16px 20px;
}

/* ===== FILTER SECTION ===== */
.filter-section {
  background: #f8f9fa;
  padding: 15px 20px;
  border-radius: 6px;
  margin-bottom: 20px;
  border: 1px solid #eaeaea;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.filter-group.search-group {
  flex: 2;
  min-width: 300px;
}

.filter-group label {
  font-weight: 500;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 10px 40px 10px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  color: #2c3e50;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-input::placeholder {
  color: #95a5a6;
}

.clear-search {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: #95a5a6;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 14px;
  width: 28px;
  height: 28px;
}

.clear-search:hover {
  background: #f1f5f9;
  color: #e74c3c;
}

.filter-group select {
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  color: #2c3e50;
  transition: all 0.2s ease;
  cursor: pointer;
}

.filter-group select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn-search {
  padding: 10px 20px;
  white-space: nowrap;
  align-self: flex-end;
}

.search-info {
  margin-top: 15px;
  padding: 10px 15px;
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  border-radius: 4px;
  color: #1565c0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInDown 0.3s ease-out;
}

.search-info i {
  font-size: 16px;
}

.search-info strong {
  color: #0d47a1;
  font-weight: 600;
}

/* ===== JOB LISTING STYLING ===== */
.job-item {
  padding: 16px 0;
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.2s ease;
}

.job-item:last-child {
  border-bottom: none;
}

.job-item:hover {
  background-color: #f8fafc;
  border-radius: 6px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}

/* Styling for closed jobs */
.job-item.job-closed {
  background: #f8f9fa;
  opacity: 0.8;
  border-radius: 6px;
  margin: 8px -8px;
  padding-left: 8px;
  padding-right: 8px;
}

.job-item.job-closed:hover {
  background-color: #f1f5f9;
}

/* Job header with title and status */
.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 15px;
}

.job-title {
  margin: 0 0 6px 0;
  color: #1e293b;
  font-size: 18px;
  font-weight: 600;
  flex: 1;
}

.job-closed .job-title {
  color: #64748b;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-open {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-closed {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.job-meta {
  color: #64748b;
  font-size: 14px;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.job-closed .job-meta {
  color: #94a3b8;
}

.job-desc-preview {
  color: #374151;
  margin-bottom: 12px;
  line-height: 1.6;
  white-space: pre-line;
}

.job-closed .job-desc-preview {
  color: #64748b;
}

/* ===== JOB ACTIONS ===== */
.job-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

/* ===== NO JOBS STYLING ===== */
.no-jobs {
  text-align: center;
  padding: 40px 20px;
  color: #95a5a6;
}

.no-jobs i {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.6;
}

.no-jobs p {
  font-size: 16px;
  margin: 0 0 10px 0;
  font-style: italic;
}

/* ===== JOB DETAIL PAGE STYLING ===== */
.job-detail-container {
  max-width: 900px;
}

.job-detail-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.job-detail-header {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  padding: 30px;
}

.job-title-section h2 {
  font-size: 28px;
  margin: 0 0 15px 0;
  font-weight: 700;
}

.job-status-large .status-badge {
  font-size: 14px;
  padding: 8px 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.job-status-large .status-closed {
  background-color: rgba(231, 76, 60, 0.2);
  border-color: rgba(231, 76, 60, 0.3);
}

/* Job Detail Info Grid */
.job-detail-info {
  padding: 30px;
  background: #f8f9fa;
  border-bottom: 1px solid #eaeaea;
}

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

.info-item {
  background: white;
  padding: 15px;
  border-radius: 6px;
  border-left: 4px solid #3498db;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.info-label {
  font-size: 12px;
  color: #7f8c8d;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.info-value {
  font-size: 14px;
  color: #2c3e50;
  font-weight: 500;
}

/* Job Detail Sections */
.job-detail-section {
  padding: 30px;
  border-bottom: 1px solid #eaeaea;
}

.job-detail-section:last-child {
  border-bottom: none;
}

.job-detail-section h3 {
  color: #2c3e50;
  font-size: 18px;
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.job-description,
.job-requirements {
  color: #34495e;
  line-height: 1.8;
  font-size: 15px;
}

/* Application Section */
.application-section {
  padding: 30px;
  background: #f8f9fa;
}

/* Login Required Section */
.login-required-section {
  text-align: center;
}

.login-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: #e3f2fd;
  color: #1565c0;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #bbdefb;
  margin-bottom: 20px;
}

.login-notice i {
  font-size: 24px;
}

.login-text h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
}

.login-text p {
  margin: 0;
  font-size: 14px;
}

.login-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Role Restricted Section */
.role-restricted-section {
  text-align: center;
}

.role-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: #fff3cd;
  color: #856404;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #ffeaa7;
}

.role-notice i {
  font-size: 24px;
}

.role-text h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
}

.role-text p {
  margin: 0 0 5px 0;
  font-size: 14px;
}

/* Already Applied Section */
.already-applied {
  text-align: center;
}

.applied-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: #d4edda;
  color: #155724;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #c3e6cb;
  margin-bottom: 20px;
}

.applied-notice i {
  font-size: 24px;
}

.applied-text h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
}

.applied-text p {
  margin: 0;
  font-size: 14px;
}

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

/* Apply Section */
.apply-section {
  background: white;
  border-radius: 8px;
  border: 2px solid #3498db;
  overflow: hidden;
}

.apply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #eaeaea;
}

.apply-header h3 {
  margin: 0;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.apply-form-container {
  padding: 20px;
}

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

.apply-form-detail label {
  display: block;
  font-weight: 500;
  color: #2c3e50;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.apply-form-detail input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 2px dashed #3498db;
  border-radius: 6px;
  background: #f8f9fa;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.apply-form-detail input[type="file"]:hover {
  background: #e3f2fd;
  border-color: #2980b9;
}

.form-text {
  font-size: 12px;
  color: #7f8c8d;
  margin-top: 5px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

/* Job Closed Section */
.job-closed-section {
  text-align: center;
}

.closed-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: #f8d7da;
  color: #721c24;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #f5c6cb;
}

.closed-notice i {
  font-size: 24px;
}

.closed-text h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
}

.closed-text p {
  margin: 0;
  font-size: 14px;
}

/* ===== BUTTON STYLING ===== */
.btn {
  padding: 10px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background: #7f8c8d;
  transform: translateY(-1px);
}

.btn-info {
  background: #17a2b8;
  color: white;
}

.btn-info:hover {
  background: #138496;
  transform: translateY(-1px);
}

.btn-warning {
  background: #f39c12;
  color: white;
}

.btn-warning:hover {
  background: #e67e22;
}

.btn-disabled {
  background-color: #6b7280;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-disabled:hover {
  background-color: #6b7280;
  transform: none;
}

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

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

/* ===== UTILITY CLASSES ===== */
.text-muted {
  color: #6b7280;
  text-align: center;
  padding: 20px;
  font-style: italic;
}

/* ===== RESPONSIVE STYLING ===== */
@media (max-width: 992px) {
  .page-header h1 {
    font-size: 24px;
  }

  .job-detail-header {
    padding: 20px;
  }

  .job-title-section h2 {
    font-size: 24px;
  }

  .info-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
  }

  .filter-form {
    gap: 12px;
  }

  .filter-group,
  .filter-group.search-group {
    min-width: 180px;
  }
}

@media (max-width: 768px) {
  .job-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .status-badge {
    align-self: flex-start;
  }

  .job-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .job-meta {
    flex-direction: column;
    gap: 4px;
  }

  .job-title {
    font-size: 16px;
  }

  .filter-form {
    flex-direction: column;
    gap: 12px;
  }

  .filter-group,
  .filter-group.search-group {
    min-width: auto;
    width: 100%;
  }

  .btn-search {
    width: 100%;
    align-self: stretch;
  }

  .search-info {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .apply-header {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .form-actions {
    flex-direction: column;
  }

  .login-actions {
    flex-direction: column;
    align-items: center;
  }

  .applied-notice,
  .closed-notice,
  .login-notice,
  .role-notice {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .job-detail-section,
  .job-detail-info,
  .application-section {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .card-header,
  .card-body {
    padding: 12px 16px;
  }

  .job-item {
    padding: 12px 0;
  }

  .btn {
    padding: 8px 12px;
    font-size: 13px;
    justify-content: center;
  }

  .status-badge {
    font-size: 10px;
    padding: 3px 8px;
  }

  .job-detail-header {
    padding: 15px;
  }

  .job-title-section h2 {
    font-size: 20px;
  }

  .info-item {
    padding: 12px;
  }

  .back-button {
    padding: 6px 10px;
    font-size: 13px;
  }

  .filter-section {
    padding: 12px 15px;
  }

  .search-input {
    font-size: 13px;
    padding: 9px 35px 9px 10px;
  }

  .filter-group select {
    font-size: 13px;
    padding: 9px 10px;
  }

  .search-info {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* ===== ANIMATION ENHANCEMENTS ===== */
.job-item {
  animation: fadeInUp 0.3s ease-out;
}

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

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

.status-badge {
  animation: pulse 2s infinite;
}

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

/* ===== POPUP STYLING ===== */
/* Popup Overlay */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.popup-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Popup Container */
.popup-container {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  overflow: hidden;
  animation: popupZoomIn 0.4s ease-out;
  background: transparent !important;
}

/* Slider wrapper and slides */
.popup-slider {
  position: relative;
  width: 100%;
  height: 100%;
}
.popup-slide {
  display: none;
}
.popup-slide img {
  width: 100%;
  height: auto;
  display: block;
}

/* Navigation arrows */
/* Unified controls bar */
.popup-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 10003;
}
.popup-ctrl-btn {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.popup-ctrl-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}
.popup-ctrl-btn.close {
  width: 44px;
  height: 40px;
}

/* Dots indicator within controls */
.popup-dots {
  display: flex;
  gap: 8px;
}
.popup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.popup-dot.active {
  background: #fff;
}
.popup-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Vertical Popup - Portrait orientation */
.popup-container.vertical {
  max-width: 400px;
  max-height: 80vh;
}

/* Horizontal Popup - Landscape orientation */
.popup-container.horizontal {
  max-width: 70vw;
  max-height: 500px;
}

/* Mixed mode: add generous padding and center slides to avoid clash */
.popup-container.mixed {
  max-width: 80vw;
  max-height: 85vh;
  padding: 24px;
  background: #000; /* dark background to isolate mixed content */
}

.popup-container.mixed .popup-slider {
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-container.mixed .popup-slide {
  display: none;
}

.popup-container.mixed .popup-slide img {
  max-width: 100%;
  max-height: calc(85vh - 80px);
  object-fit: contain;
}

@keyframes popupZoomIn {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Popup Image */
.popup-image {
  width: 100%;
  height: auto;
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

/* Close Button */
.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10001;
}

.popup-close:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* Responsive Popup Design */
@media (max-width: 768px) {
  .popup-container.vertical {
    max-width: 85%;
    max-height: 70vh;
  }

  .popup-container.horizontal {
    max-width: 90%;
    max-height: 60vh;
  }

  .popup-close {
    top: 5px;
    right: 5px;
    width: 35px;
    height: 35px;
    font-size: 18px;
  }

  .popup-ctrl-btn {
    width: 36px;
    height: 36px;
  }

  .popup-ctrl-btn.close {
    width: 40px;
    height: 36px;
  }

  .popup-controls {
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .popup-container.vertical,
  .popup-container.horizontal {
    max-width: 95%;
    max-height: 60vh;
  }

  .popup-close {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .popup-ctrl-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .popup-ctrl-btn.close {
    width: 36px;
    height: 32px;
  }

  .popup-dot {
    width: 8px;
    height: 8px;
  }

  .popup-controls {
    gap: 6px;
    bottom: 8px;
  }
}

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