/**
 * OpHire Portal Redesign - Global Utilities
 * AngelList-Inspired Modern Design System
 *
 * This file contains reusable component patterns and utilities
 * for the complete portal redesign. Follows Base Coat UI patterns.
 */

/* ==========================================================================
   STATS CARD COMPONENT
   ========================================================================== */

.stats-card {
  background: rgb(var(--card));
  border: 1px solid rgb(var(--border) / 0.1);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 300ms ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stats-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.stats-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  margin-bottom: 0.5rem;
}

.stats-card-icon.success {
  background: rgba(16, 185, 129, 0.15);
  color: rgb(16 185 129);
}

.stats-card-icon.info {
  background: rgba(59, 130, 246, 0.15);
  color: rgb(59 130 246);
}

.stats-card-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  color: rgb(245 158 11);
}

.stats-card-icon.error {
  background: rgba(239, 68, 68, 0.15);
  color: rgb(239 68 68);
}

.stats-card-label {
  font-size: 0.875rem;
  color: rgb(var(--muted-foreground));
  font-weight: 500;
}

.stats-card-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  color: rgb(var(--foreground));
  line-height: 1.2;
}

.stats-card-change {
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stats-card-change.positive {
  color: rgb(16 185 129);
}

.stats-card-change.negative {
  color: rgb(239 68 68);
}

.stats-card-change.neutral {
  color: rgb(var(--muted-foreground));
}

/* ==========================================================================
   STATUS BADGE COMPONENT
   ========================================================================== */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  transition: all 200ms ease;
}

.status-badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: rgb(16 185 129);
}

.status-badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: rgb(245 158 11);
}

.status-badge-error {
  background: rgba(239, 68, 68, 0.15);
  color: rgb(239 68 68);
}

.status-badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: rgb(59 130 246);
}

.status-badge-neutral {
  background: rgba(148, 163, 184, 0.15);
  color: rgb(148 163 184);
}

.status-badge-icon {
  width: 1rem;
  height: 1rem;
}

/* ==========================================================================
   EMPTY STATE COMPONENT
   ========================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  min-height: 300px;
  border: 2px dashed rgb(var(--border) / 0.3);
  border-radius: var(--radius);
  background: rgb(var(--background));
}

.empty-state-icon {
  width: 4rem;
  height: 4rem;
  color: rgb(var(--muted));
  margin-bottom: 1.5rem;
}

.empty-state-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  background: rgb(var(--muted) / 0.15);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.empty-state-heading {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  color: rgb(var(--foreground));
  margin-bottom: 0.5rem;
}

.empty-state-description {
  font-size: 0.875rem;
  color: rgb(var(--muted-foreground));
  max-width: 28rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.empty-state-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */

.sidebar-nav {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 17.5rem; /* 280px */
  background: rgb(var(--card));
  border-right: 1px solid rgb(var(--border) / 0.1);
  padding: 2rem 1.5rem;
  overflow-y: auto;
  z-index: 40;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--muted-foreground));
  text-decoration: none;
  transition: all 200ms ease;
  position: relative;
  margin-bottom: 0.5rem;
}

.sidebar-nav-item:hover {
  background: rgb(var(--muted) / 0.1);
  color: rgb(var(--foreground));
}

.sidebar-nav-item.active {
  background: rgba(16, 185, 129, 0.15);
  color: rgb(16 185 129);
  border-left: 3px solid rgb(16 185 129);
  padding-left: calc(1rem - 3px);
}

.sidebar-nav-item-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.sidebar-nav-content {
  margin-left: 17.5rem;
  min-height: 100vh;
}

/* Mobile: Hide sidebar, show at bottom */
@media (max-width: 1024px) {
  .sidebar-nav {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    border-right: none;
    border-top: 1px solid rgb(var(--border) / 0.1);
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar-nav-item {
    flex-direction: column;
    min-width: 4rem;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    margin-bottom: 0;
  }

  .sidebar-nav-content {
    margin-left: 0;
    margin-bottom: 5rem;
  }
}

/* ==========================================================================
   JOB CARD COMPONENT
   ========================================================================== */

.job-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 300ms ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.job-card:hover {
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.2);
  border-left: 4px solid rgb(16 185 129);
  transform: translateY(-2px);
}

.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.job-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  color: #0F172A;
  line-height: 1.3;
}

.job-card-company {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.job-card-company-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgb(var(--muted));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: rgb(var(--foreground));
}

.job-card-company-name {
  font-size: 1rem;
  color: #475569;
}

.job-card-ai-badge {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgb(16 185 129);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  font-family: 'Space Grotesk', sans-serif;
  flex-shrink: 0;
}

.job-card-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: #64748B;
  font-size: 0.875rem;
}

.job-card-metadata-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.job-card-compensation {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #E2E8F0;
}

.job-card-compensation-item-label {
  font-size: 0.875rem;
  color: #64748B;
  margin-bottom: 0.25rem;
}

.job-card-compensation-item-value {
  font-size: 1rem;
  font-weight: 600;
  color: rgb(16 185 129);
}

.job-card-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.job-card-highlight-badge {
  background: rgba(16, 185, 129, 0.1);
  color: rgb(16 185 129);
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.job-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.job-card-certs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.job-card-cert-badge {
  background: transparent;
  border: 1px solid #CBD5E1;
  color: #64748B;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ==========================================================================
   FORM ENHANCEMENTS
   ========================================================================== */

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--foreground));
}

.form-label-required::after {
  content: ' *';
  color: rgb(var(--error));
}

.form-input {
  height: 3.5rem;
  padding: 0 1rem;
  border: 2px solid rgb(var(--border));
  border-radius: var(--radius);
  background: rgb(var(--background));
  color: rgb(var(--foreground));
  font-size: 1rem;
  transition: all 200ms ease;
}

.form-input:focus {
  outline: none;
  border-color: rgb(var(--accent));
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input-error {
  border-color: rgb(var(--error));
}

.form-input-success {
  border-color: rgb(var(--success));
}

.form-helper {
  font-size: 0.875rem;
  color: rgb(var(--muted-foreground));
}

.form-error {
  font-size: 0.875rem;
  color: rgb(var(--error));
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.form-success {
  font-size: 0.875rem;
  color: rgb(var(--success));
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ==========================================================================
   ANIMATION KEYFRAMES
   ========================================================================== */

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

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

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

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

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Animation utility classes */
.animate-fadeInUp {
  animation: fadeInUp 400ms ease-out;
}

.animate-fadeIn {
  animation: fadeIn 300ms ease-out;
}

.animate-slideIn {
  animation: slideIn 300ms ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Stagger animation delays */
.animate-delay-100 {
  animation-delay: 100ms;
}

.animate-delay-200 {
  animation-delay: 200ms;
}

.animate-delay-300 {
  animation-delay: 300ms;
}

.animate-delay-400 {
  animation-delay: 400ms;
}

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

/* Spacing */
.section-padding {
  padding: 3rem 1.5rem;
}

@media (min-width: 768px) {
  .section-padding {
    padding: 5rem 3rem;
  }
}

/* Container */
.container-narrow {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.container-wide {
  max-width: 87.5rem; /* 1400px */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 0.5rem;
  height: 0.5rem;
}

::-webkit-scrollbar-track {
  background: rgb(var(--background));
}

::-webkit-scrollbar-thumb {
  background: rgb(var(--muted));
  border-radius: 0.25rem;
}

::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--muted-foreground));
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid rgb(var(--ring));
  outline-offset: 2px;
}

/* ==========================================================================
   RESPONSIVE UTILITIES
   ========================================================================== */

/* Hide on mobile */
@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Hide on tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .hide-tablet {
    display: none !important;
  }
}

/* Hide on desktop */
@media (min-width: 1024px) {
  .hide-desktop {
    display: none !important;
  }
}

/* Show only on mobile */
@media (min-width: 768px) {
  .show-mobile-only {
    display: none !important;
  }
}
