/**
 * JCL Job Poster Dashboard Styles
 * Ergonomic, mobile-first design
 * Version: 1.0
 */

/* ============================================
   Variables (using existing JCL colors)
   ============================================ */
:root {
  --jcl-orange: #EE6C4D;
  --jcl-gray: #2B3241;
  --jcl-white: #E0FBFC;
  --jcl-taupe: #483C32;
  --jcl-success: #28a745;
  --jcl-warning: #ffc107;
  --jcl-danger: #dc3545;
  --jcl-info: #17a2b8;
}

/* ============================================
   Dashboard Container
   ============================================ */
.jcl-dash-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  font-family: 'Century Gothic', 'CenturyGothic', 'AppleGothic', sans-serif;
  line-height: 1.6;
  color: var(--jcl-gray);
}

@media (min-width: 768px) {
  .jcl-dash-container {
    padding: 0 40px;
  }
}

/* ============================================
   Header Section
   ============================================ */
.jcl-dash-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .jcl-dash-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
  }
}

.jcl-dash-welcome h1 {
  font-size: 28px;
  font-weight: bold;
  color: var(--jcl-gray);
  margin: 0 0 8px 0;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .jcl-dash-welcome h1 {
    font-size: 36px;
  }
}

.jcl-dash-org-name {
  font-size: 16px;
  color: #666;
  margin: 0;
}

@media (min-width: 768px) {
  .jcl-dash-org-name {
    font-size: 18px;
  }
}

/* ============================================
   Verification Badge
   ============================================ */
.jcl-dash-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.jcl-dash-badge-verified {
  background: #d4edda;
  color: #155724;
}

.jcl-dash-badge-pending {
  background: #fff3cd;
  color: #856404;
}

.jcl-dash-badge-icon {
  font-size: 16px;
}

/* ============================================
   Helper Text
   ============================================ */
.jcl-dash-helper-text {
  background: #f8f9fa;
  border-left: 4px solid var(--jcl-orange);
  padding: 12px 16px;
  font-size: 14px;
  color: #666;
  margin-bottom: 24px;
  border-radius: 4px;
}

/* ============================================
   Primary Action Strip
   ============================================ */
.jcl-dash-actions-primary {
  margin-bottom: 10px;
}

.jcl-dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  min-height: 48px; /* Touch-friendly */
}

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

.jcl-dash-btn-primary {
  background: var(--jcl-orange);
  color: white;
}

.jcl-dash-btn-primary:hover:not(:disabled) {
  background: #d85a3a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(238, 108, 77, 0.3);
}

.jcl-dash-btn-secondary {
  background: #f8f9fa;
  color: var(--jcl-gray);
  border: 1px solid #dee2e6;
}

.jcl-dash-btn-secondary:hover:not(:disabled) {
  background: #e9ecef;
  border-color: #adb5bd;
}

.jcl-dash-btn-text {
  background: transparent;
  color: #666;
  padding: 8px 16px;
  min-height: auto;
}

.jcl-dash-btn-text:hover:not(:disabled) {
  color: var(--jcl-gray);
  background: #f8f9fa;
}

.jcl-dash-btn-large {
  width: 100%;
  font-size: 18px;
  padding: 16px 32px;
  min-height: 56px;
}

@media (min-width: 768px) {
  .jcl-dash-btn-large {
    width: auto;
    min-width: 200px;
  }
}

.jcl-dash-btn-icon {
  font-size: 20px;
}

/* ============================================
   Secondary Actions
   ============================================ */
.jcl-dash-actions-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

/* ============================================
   Content Cards
   ============================================ */
.jcl-dash-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 32px;
}

@media (min-width: 768px) {
  .jcl-dash-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.jcl-dash-card {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.jcl-dash-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--jcl-gray);
  margin: 0 0 16px 0;
}

.jcl-dash-card-content {
  color: #666;
}

/* ============================================
   Info Rows
   ============================================ */
.jcl-dash-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f1f1;
}

.jcl-dash-info-row:last-child {
  border-bottom: none;
}

.jcl-dash-info-label {
  font-weight: 600;
  color: var(--jcl-gray);
  font-size: 14px;
}

.jcl-dash-info-value {
  color: #666;
  font-size: 14px;
  text-align: right;
}

.jcl-dash-domain {
  background: #e7f3ff;
  color: #0066cc;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
}

/* ============================================
   Alerts
   ============================================ */
.jcl-dash-alert {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.jcl-dash-alert-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
}

.jcl-dash-alert-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.jcl-dash-alert strong {
  display: block;
  margin-bottom: 4px;
}

.jcl-dash-alert p {
  margin: 0;
}

/* ============================================
   Empty State
   ============================================ */
.jcl-dash-empty-state {
  text-align: center;
  padding: 32px 16px;
  color: #999;
}

.jcl-dash-empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}

.jcl-dash-empty-state p {
  margin: 0;
  font-size: 14px;
}

/* ============================================
   Loading State
   ============================================ */
.jcl-dash-loading {
  text-align: center;
  padding: 60px 20px;
}

.jcl-dash-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--jcl-orange);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: jclDashSpin 0.8s linear infinite;
  margin: 0 auto 20px;
}

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

.jcl-dash-loading p {
  color: #666;
  font-size: 16px;
}

/* ============================================
   Error State
   ============================================ */
.jcl-dash-error {
  text-align: center;
  padding: 60px 20px;
  color: var(--jcl-danger);
}

.jcl-dash-error p {
  margin: 0 0 8px 0;
  font-size: 16px;
}

.jcl-dash-error-detail {
  font-size: 14px;
  color: #999;
}

/* ============================================
   Login Prompt
   ============================================ */
.jcl-dash-login-prompt {
  text-align: center;
  padding: 80px 20px;
  max-width: 400px;
  margin: 0 auto;
}

.jcl-dash-login-icon {
  font-size: 64px;
  margin-bottom: 24px;
}

.jcl-dash-login-prompt h2 {
  font-size: 24px;
  color: var(--jcl-gray);
  margin: 0 0 12px 0;
}

.jcl-dash-login-prompt p {
  color: #666;
  margin: 0 0 24px 0;
}

/* ============================================
   Modal
   ============================================ */
.jcl-dash-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Century Gothic', 'CenturyGothic', 'AppleGothic', sans-serif;
}

.jcl-dash-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.jcl-dash-modal-content {
  position: relative;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  padding: 32px;
  max-height: 90vh;
  overflow-y: auto;
  animation: jclDashModalSlideIn 0.3s ease-out;
}

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

@media (max-width: 768px) {
  .jcl-dash-modal-content {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    padding: 20px;
  }
}

.jcl-dash-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #999;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.jcl-dash-modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

.jcl-dash-modal-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--jcl-gray);
  margin: 0 0 8px 0;
}

.jcl-dash-modal-subtitle {
  font-size: 14px;
  color: #666;
  margin: 0 0 24px 0;
}

/* ============================================
   Form Elements
   ============================================ */
.jcl-dash-form-group {
  margin-bottom: 20px;
}

.jcl-dash-form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--jcl-gray);
  margin-bottom: 8px;
}

.jcl-dash-form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.jcl-dash-form-input:focus {
  outline: none;
  border-color: var(--jcl-orange);
}

.jcl-dash-form-input.error {
  border-color: var(--jcl-danger);
}

.jcl-dash-form-hint {
  display: block;
  font-size: 13px;
  color: #666;
  margin-top: 6px;
}

/* ============================================
   Messages
   ============================================ */
.jcl-dash-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

.jcl-dash-message-success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.jcl-dash-message-error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

/* ============================================
   Modal Actions
   ============================================ */
.jcl-dash-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.jcl-dash-modal-actions button {
  flex: 1;
}

/* ============================================
   WordPress Header Integration
   ============================================ */
#jcl-dashboard-header-left {
  display: flex;
  align-items: center;
  order: 1;
}

#jcl-dashboard-header-right {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: auto;
  order: 3;
}

.jcl-header-dashboard-title {
  font-size: 18px;
  font-weight: 600;
  color: #FFFFFF;
}

.jcl-header-center-banner {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  order: 2;
  z-index: 1;
}

.jcl-header-center-banner img {
  height: 40px;
  width: auto;
  display: block;
}

/* Welcome Section with Inline Credits */
.jcl-dash-welcome-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-top: 0;
  margin-top: 10px;
  gap: 20px;
}

@media (max-width: 768px) {
  .jcl-dash-welcome-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

.jcl-dash-welcome-left h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--jcl-gray);
  margin: 0 0 4px 0;
}

.jcl-dash-welcome-left p {
  margin: 0;
}

/* Icon Buttons */
.jcl-dash-icon-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #dee2e6;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jcl-dash-icon-btn:hover {
  background: #f8f9fa;
  border-color: var(--jcl-orange);
  transform: scale(1.05);
}

.jcl-dash-icon-btn .jcl-icon {
  font-size: 24px;
}

/* Notification Dot */
.jcl-notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  background: #dc3545;
  border-radius: 50%;
  border: 2px solid white;
}

/* Bell Ringing Animation */
.jcl-has-notification .jcl-icon {
  animation: jclBellRing 2s ease-in-out infinite;
  transform-origin: center top;
}

@keyframes jclBellRing {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-15deg); }
  20%, 40% { transform: rotate(15deg); }
  50% { transform: rotate(0deg); }
}

/* ============================================
   Jobs Section
   ============================================ */
.jcl-dash-jobs-section {
  margin-top: 10px;
}

.jcl-dash-section-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--jcl-gray);
  margin: 0 0 12px 0;
}

.jcl-dash-jobs-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .jcl-dash-jobs-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .jcl-dash-jobs-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Job Card */
.jcl-dash-job-card {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.jcl-dash-job-card:hover {
  border-color: var(--jcl-orange);
  box-shadow: 0 4px 12px rgba(238, 108, 77, 0.15);
  transform: translateY(-2px);
}

.jcl-dash-job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.jcl-dash-job-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--jcl-gray);
  margin: 0 0 4px 0;
}

.jcl-dash-job-facility {
  font-size: 14px;
  color: #666;
  margin: 0;
}

.jcl-dash-job-badges {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;
}

.jcl-dash-job-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.jcl-badge-emergent {
  background: #ffe5e5;
  color: #dc3545;
}

.jcl-badge-active {
  background: #d4edda;
  color: #155724;
}

.jcl-badge-on-hold {
  background: #fff3cd;
  color: #856404;
}

.jcl-dash-job-meta {
  font-size: 13px;
  color: #999;
  padding-top: 12px;
  border-top: 1px solid #f1f1f1;
}

/* ============================================
   Profile & Notifications Views
   ============================================ */
.jcl-dash-profile-view,
.jcl-dash-notifications-view {
  margin: 20px 0;
}

/* ============================================
   Edit Field Button
   ============================================ */
.jcl-edit-field-btn {
  background: none;
  border: none;
  color: #EE6C4D;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 8px;
  margin-left: 8px;
  border-radius: 4px;
  transition: all 0.2s;
  font-weight: 600;
}

.jcl-edit-field-btn:hover {
  background-color: #ffe5df;
}

.jcl-dash-form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================
   Credits Display (Inline with Welcome)
   ============================================ */
.jcl-dash-credits-inline {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

@media (max-width: 768px) {
  .jcl-dash-credits-inline {
    align-items: flex-start;
    text-align: left;
  }
}

.jcl-dash-credits-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.jcl-dash-credits-label {
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.jcl-dash-credits-value {
  font-size: 13px;
  font-weight: bold;
  color: var(--jcl-orange);
}

.jcl-credits-depleted {
  color: var(--jcl-danger) !important;
  animation: jclPulse 2s ease-in-out infinite;
}

@keyframes jclPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.jcl-dash-credits-warning-text {
  font-size: 12px;
  color: #856404;
  font-weight: 600;
  margin-top: 4px;
}
