/**
 * Kaya & Communal Resident Portal
 * Global Styles - Pure CSS (No Build Process Required)
 */

/* ========================================
   CSS Variables (Brand Colors)
   ======================================== */
:root {
  --primary: #5C5C5C;
  --secondary: #1C1C1C;
  --success: #307A07;
  --warning: #ED8A00;
  --danger: #CB2B2B;

  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;

  --white: #FFFFFF;

  --brand-spacing: 0.18em;
  --border-radius: 12px;
  --transition: all 0.2s ease;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.625;
  color: var(--gray-600);
  background: linear-gradient(to bottom, var(--gray-50), var(--white));
  min-height: 100vh;
}

/* ========================================
   Typography
   ======================================== */
.brand-title {
  font-size: 2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--brand-spacing);
  color: var(--secondary);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.subtitle {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--gray-600);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.card-title-large {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 1.25rem;
  line-height: 1.3;
}

.text-small {
  font-size: 0.9375rem;
  margin-top: 0.5rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* ========================================
   Layout
   ======================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1rem;
}

.header {
  text-align: center;
  margin-bottom: 3rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.divider {
  width: 60px;
  height: 3px;
  background-color: var(--primary);
  margin: 0 auto 1.25rem;
}

.content-section {
  max-width: 800px;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

/* ========================================
   Cards
   ======================================== */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
}

.card-centered {
  text-align: center;
  padding: 2.5rem 2rem;
}

/* ========================================
   Forms
   ======================================== */
.form-group {
  margin-bottom: 1.5rem;
}

.input-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.input-field {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1.0625rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  transition: var(--transition);
  min-height: 50px; /* Touch-friendly */
  line-height: 1.5;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92, 92, 92, 0.1);
}

.input-field::placeholder {
  color: var(--gray-400);
}

select.input-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234B5563' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 3rem;
}

/* ========================================
   Buttons
   ======================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--white);
  background-color: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  min-height: 52px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--secondary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

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

.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(92, 92, 92, 0.25);
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-order {
  width: 100%;
}

/* ========================================
   Order Button Container
   ======================================== */
.order-button-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1rem;
  right: 1rem;
  z-index: 50;
  padding: 0;
}

@media (min-width: 768px) {
  .order-button-container {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: auto;
    margin-top: 2rem;
  }
}

/* ========================================
   Unit Grid
   ======================================== */
.unit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 6rem; /* Space for fixed button on mobile */
}

@media (min-width: 640px) {
  .unit-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .unit-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1rem;
  }
}

.unit-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.unit-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.unit-card:active {
  transform: translateY(0);
}

.unit-card.selected {
  border-color: var(--primary);
  background-color: var(--gray-50);
  box-shadow: 0 0 0 3px rgba(92, 92, 92, 0.2);
}

.unit-card-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.25rem;
  line-height: 1;
}

.unit-card-label {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  font-weight: 500;
}

/* ========================================
   Time Status Badges
   ======================================== */
.time-status {
  margin-top: 1.75rem;
  display: flex;
  justify-content: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 9999px;
}

.badge svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.badge-success {
  background-color: rgba(48, 122, 7, 0.1);
  color: var(--success);
  border: 1px solid rgba(48, 122, 7, 0.2);
}

.badge-warning {
  background-color: rgba(237, 138, 0, 0.1);
  color: var(--warning);
  border: 1px solid rgba(237, 138, 0, 0.2);
}

/* ========================================
   Hours Info (Closed Section)
   ======================================== */
.hours-info {
  max-width: 500px;
  margin: 0 auto;
}

.hours-text {
  font-size: 1.0625rem;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.hours-box {
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.hours-item {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--secondary);
  margin: 0.625rem 0;
  line-height: 1.5;
}

.visit-text {
  font-size: 1rem;
  color: var(--gray-600);
  margin-top: 1.5rem;
  line-height: 1.6;
}

/* ========================================
   No Results
   ======================================== */
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}

.no-results p {
  font-size: 1.125rem;
}

/* ========================================
   Accessibility
   ======================================== */
.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 for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ========================================
   Responsive Typography
   ======================================== */
@media (min-width: 768px) {
  .brand-title {
    font-size: 2.75rem;
  }

  .subtitle {
    font-size: 1.25rem;
  }

  .card-title-large {
    font-size: 2rem;
  }

  .container {
    padding: 5rem 2rem;
  }

  .header {
    margin-bottom: 3.5rem;
  }
}

/* ========================================
   Reduced Motion Support
   ======================================== */
@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;
  }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .order-button-container {
    display: none;
  }

  .unit-grid {
    margin-bottom: 1rem;
  }
}
