/* Shared Utility Classes and Responsive Breakpoints with Pure CSS Integration */

/* ===== PURE CSS RESPONSIVE BREAKPOINTS ===== */
/* Mobile First Approach - Pure CSS Compatible */

/* Extra Small devices (phones, 480px and down) */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  .pure-button {
    width: 100%;
    margin-bottom: var(--spacing-sm);
  }
  
  .card {
    padding: var(--spacing-md);
  }
  
  .pure-form .pure-input-1,
  .pure-form input[type="text"],
  .pure-form input[type="email"],
  .pure-form input[type="password"] {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .text-center-mobile {
    text-align: center;
  }
  
  .d-none-mobile {
    display: none;
  }
  
  .d-block-mobile {
    display: block;
  }
}

/* Pure CSS Small devices (≥ 568px) */
@media screen and (min-width: 35.5em) {
  .container {
    max-width: 540px;
    margin: 0 auto;
  }
  
  .pure-button {
    width: auto;
  }
  
  .pure-form .pure-input-1-2 {
    width: calc(50% - 8px);
    display: inline-block;
    margin-right: 16px;
  }
  
  .pure-form .pure-input-1-2:last-child {
    margin-right: 0;
  }
}

/* Pure CSS Medium devices (≥ 768px) */
@media screen and (min-width: 48em) {
  .container {
    max-width: 720px;
  }
  
  .pure-button {
    width: auto;
  }
  
  .d-none-tablet {
    display: none;
  }
  
  .d-block-tablet {
    display: block;
  }
  
  /* Side-by-side form inputs for tablets+ */
  .pure-form .pure-input-1-2 {
    width: calc(50% - 8px);
    display: inline-block;
    margin-right: 16px;
  }
  
  .pure-form .pure-input-1-2:last-child {
    margin-right: 0;
  }
  
  .pure-form .pure-input-1-3 {
    width: calc(33.333% - 8px);
    display: inline-block;
    margin-right: 12px;
  }
  
  .pure-form .pure-input-1-3:last-child {
    margin-right: 0;
  }
}

/* Pure CSS Large devices (≥ 1024px) */
@media screen and (min-width: 64em) {
  .container {
    max-width: 960px;
  }
  
  .d-none-desktop {
    display: none;
  }
  
  .d-block-desktop {
    display: block;
  }
  
  /* Enhanced form layouts for desktop */
  .pure-form .pure-input-1-4 {
    width: calc(25% - 6px);
    display: inline-block;
    margin-right: 8px;
  }
  
  .pure-form .pure-input-1-4:last-child {
    margin-right: 0;
  }
  
  .pure-form .pure-input-3-4 {
    width: calc(75% - 8px);
    display: inline-block;
    margin-right: 16px;
  }
  
  .pure-form .pure-input-3-4:last-child {
    margin-right: 0;
  }
}

/* Pure CSS Extra large devices (≥ 1280px) */
@media screen and (min-width: 80em) {
  .container {
    max-width: 1140px;
  }
}

/* ===== PURE CSS FORM RESPONSIVE UTILITIES ===== */
/* Mobile-first form responsive classes */

@media screen and (min-width: 48em) { /* md */
  .pure-form-responsive .pure-control-group {
    margin-bottom: 18px;
  }
}

@media screen and (min-width: 64em) { /* lg */
  .pure-form-responsive .pure-control-group {
    margin-bottom: 20px;
  }
}

/* Pure CSS Input Group Responsive */
.pure-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.pure-input-group .pure-input-1 {
  flex: 1;
}

.pure-input-group .pure-button {
  margin-left: var(--spacing-sm);
}

/* Mobile-first input group */
@media screen and (max-width: 47.99em) { /* < md */
  .pure-input-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .pure-input-group .pure-button {
    margin-left: 0;
    margin-top: var(--spacing-sm);
  }
}

/* ===== COMMON ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

@keyframes loadingProgress {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

/* ===== ANIMATION UTILITY CLASSES ===== */
.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s ease-out;
}

.animate-fade-in-down {
  animation: fadeInDown 0.4s ease-out;
}

.animate-slide-in-left {
  animation: slideInLeft 0.4s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.4s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* ===== LAYOUT UTILITIES ===== */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-nowrap {
  flex-wrap: nowrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.flex-1 {
  flex: 1;
}

.flex-auto {
  flex: auto;
}

.flex-none {
  flex: none;
}

/* ===== GRID UTILITIES ===== */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gap-1 {
  gap: var(--spacing-sm);
}

.gap-2 {
  gap: var(--spacing-md);
}

.gap-3 {
  gap: var(--spacing-lg);
}

.gap-4 {
  gap: var(--spacing-xl);
}

/* ===== SPACING UTILITIES ===== */
.m-0 { margin: 0; }
.m-1 { margin: var(--spacing-sm); }
.m-2 { margin: var(--spacing-md); }
.m-3 { margin: var(--spacing-lg); }
.m-4 { margin: var(--spacing-xl); }

.mx-auto { margin-left: auto; margin-right: auto; }
.mx-0 { margin-left: 0; margin-right: 0; }
.mx-1 { margin-left: var(--spacing-sm); margin-right: var(--spacing-sm); }
.mx-2 { margin-left: var(--spacing-md); margin-right: var(--spacing-md); }
.mx-3 { margin-left: var(--spacing-lg); margin-right: var(--spacing-lg); }
.mx-4 { margin-left: var(--spacing-xl); margin-right: var(--spacing-xl); }

.my-0 { margin-top: 0; margin-bottom: 0; }
.my-1 { margin-top: var(--spacing-sm); margin-bottom: var(--spacing-sm); }
.my-2 { margin-top: var(--spacing-md); margin-bottom: var(--spacing-md); }
.my-3 { margin-top: var(--spacing-lg); margin-bottom: var(--spacing-lg); }
.my-4 { margin-top: var(--spacing-xl); margin-bottom: var(--spacing-xl); }

.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: var(--spacing-sm); padding-right: var(--spacing-sm); }
.px-2 { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
.px-3 { padding-left: var(--spacing-lg); padding-right: var(--spacing-lg); }
.px-4 { padding-left: var(--spacing-xl); padding-right: var(--spacing-xl); }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-2 { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.py-3 { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }
.py-4 { padding-top: var(--spacing-xl); padding-bottom: var(--spacing-xl); }

/* ===== TEXT UTILITIES ===== */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.leading-none { line-height: 1; }
.leading-tight { line-height: 1.25; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.75; }
.leading-loose { line-height: 2; }

/* ===== COLOR UTILITIES ===== */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }

.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-success { background-color: var(--success); }
.bg-warning { background-color: var(--warning); }
.bg-danger { background-color: var(--danger); }
.bg-light { background-color: var(--light); }
.bg-dark { background-color: var(--dark); }

/* ===== BORDER UTILITIES ===== */
.border { border: 1px solid var(--border-color); }
.border-0 { border: 0; }
.border-t { border-top: 1px solid var(--border-color); }
.border-b { border-bottom: 1px solid var(--border-color); }
.border-l { border-left: 1px solid var(--border-color); }
.border-r { border-right: 1px solid var(--border-color); }

.rounded { border-radius: var(--radius-md); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

/* ===== SHADOW UTILITIES ===== */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-none { box-shadow: none; }

/* ===== PURE CSS SPECIFIC UTILITIES ===== */
/* Pure CSS responsive visibility */
.pure-hidden {
  display: none !important;
}

.pure-visible {
  display: block !important;
}

/* Pure CSS responsive text alignment */
@media screen and (max-width: 47.99em) { /* < md */
  .pure-text-center-mobile {
    text-align: center;
  }
  
  .pure-text-left-mobile {
    text-align: left;
  }
  
  .pure-text-right-mobile {
    text-align: right;
  }
}

@media screen and (min-width: 48em) { /* md */
  .pure-text-center-tablet {
    text-align: center;
  }
  
  .pure-text-left-tablet {
    text-align: left;
  }
  
  .pure-text-right-tablet {
    text-align: right;
  }
}

@media screen and (min-width: 64em) { /* lg */
  .pure-text-center-desktop {
    text-align: center;
  }
  
  .pure-text-left-desktop {
    text-align: left;
  }
  
  .pure-text-right-desktop {
    text-align: right;
  }
}

/* Pure CSS form responsive utilities */
@media screen and (min-width: 48em) { /* md */
  /* Convert to aligned form on larger screens */
}

/* ===== ACCESSIBILITY UTILITIES ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.focus-visible:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== PRINT UTILITIES ===== */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-only {
    display: block !important;
  }
  
  .page-break {
    page-break-before: always;
  }
  
  .avoid-break {
    page-break-inside: avoid;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== HIGH CONTRAST ===== */
@media (prefers-contrast: high) {
  .card,
  .status-card {
    border: 2px solid var(--text-primary);
  }
  
  .pure-button {
    border: 2px solid currentColor;
  }
  
  .pure-form .pure-input-1,
  .pure-form input[type="text"],
  .pure-form input[type="email"],
  .pure-form input[type="password"] {
    border: 2px solid var(--text-primary);
  }
} 