/* QR Lost and Found - Responsive Design System */
/* Built for Bulma CSS v1.0.4 with enhanced mobile-first approach */

/* ========================================
   RESPONSIVE DESIGN SYSTEM VARIABLES
   ======================================== */

:root {
  /* Touch Target Sizes */
  --touch-target-min: 44px;
  --touch-target-comfortable: 48px;
  
  /* Responsive Breakpoints (matching Bulma 1.0.4) */
  --mobile: 768px;
  --tablet: 1024px;
  --desktop: 1216px;
  --widescreen: 1408px;
  
  /* Spacing Scale */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;
  
  /* Typography Scale (responsive) */
  --text-xs: clamp(0.75rem, 2vw, 0.875rem);
  --text-sm: clamp(0.875rem, 2.5vw, 1rem);
  --text-base: clamp(1rem, 3vw, 1.125rem);
  --text-lg: clamp(1.125rem, 3.5vw, 1.25rem);
  --text-xl: clamp(1.25rem, 4vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 5vw, 2rem);
  --text-3xl: clamp(2rem, 6vw, 2.5rem);
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* ========================================
   MOBILE-FRIENDLY TOUCH TARGETS
   ======================================== */

/* Base touch-friendly class */
.touch-friendly {
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
  padding: 0.75rem 1rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Comfortable touch targets for primary actions */
.touch-comfortable {
  min-height: var(--touch-target-comfortable);
  min-width: var(--touch-target-comfortable);
  padding: 0.875rem 1.25rem;
}

/* Apply touch-friendly sizing to all interactive elements */
.button,
.input,
.textarea,
.select select,
.checkbox,
.radio,
.navbar-item,
.pagination-link,
.pagination-ellipsis,
.tabs a,
.breadcrumb a {
  min-height: var(--touch-target-min);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Enhanced button touch targets */
.button {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  line-height: 1.4;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.button.is-small {
  min-height: 40px;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
}

.button.is-medium {
  min-height: var(--touch-target-comfortable);
  padding: 0.875rem 1.5rem;
  font-size: 1.125rem;
}

.button.is-large {
  min-height: 52px;
  padding: 1rem 2rem;
  font-size: 1.25rem;
}

/* Enhanced input touch targets */
.input,
.textarea,
.select select {
  min-height: var(--touch-target-min);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

/* Prevent iOS zoom on input focus */
@media screen and (max-width: 768px) {
  .input,
  .textarea,
  .select select {
    font-size: 16px !important;
  }
}

/* ========================================
   RESPONSIVE FORM LAYOUTS
   ======================================== */

/* Mobile-first form stacking */
.form-responsive .field.is-grouped {
  flex-direction: column;
  gap: var(--spacing-sm);
}

.form-responsive .field.is-grouped .control {
  width: 100%;
}

/* Tablet and up: horizontal layout */
@media screen and (min-width: 769px) {
  .form-responsive .field.is-grouped {
    flex-direction: row;
    align-items: flex-end;
  }
  
  .form-responsive .field.is-grouped .control {
    width: auto;
    flex: 1;
  }
  
  .form-responsive .field.is-grouped .control:not(:last-child) {
    margin-right: var(--spacing-md);
  }
}

/* Form field spacing improvements */
.field:not(:last-child) {
  margin-bottom: var(--spacing-lg);
}

/* Enhanced form labels */
.label {
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: #363636;
  font-size: var(--text-sm);
}

/* Form help text improvements */
.help {
  font-size: var(--text-xs);
  margin-top: var(--spacing-xs);
  line-height: 1.4;
}

/* Character counter styling */
.character-counter {
  font-size: var(--text-xs);
  color: #7a7a7a;
  text-align: right;
  margin-top: var(--spacing-xs);
}

.character-counter.is-warning {
  color: #ff9800;
}

.character-counter.is-danger {
  color: #f14668;
}

/* ========================================
   RESPONSIVE BUTTON GROUPS
   ======================================== */

/* Mobile-first: stack buttons vertically */
.buttons-responsive {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.buttons-responsive .button {
  width: 100%;
  justify-content: center;
}

/* Tablet and up: horizontal layout */
@media screen and (min-width: 769px) {
  .buttons-responsive {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .buttons-responsive .button {
    width: auto;
    flex: 0 0 auto;
  }
}

/* Button group variations */
.buttons-responsive.is-left {
  justify-content: flex-start;
}

.buttons-responsive.is-right {
  justify-content: flex-end;
}

.buttons-responsive.is-centered {
  justify-content: center;
}

/* Full-width mobile buttons */
@media screen and (max-width: 768px) {
  .button.is-fullwidth-mobile {
    width: 100%;
    justify-content: center;
  }
  
  .field.is-grouped .button {
    width: 100%;
    margin-bottom: var(--spacing-sm);
  }
  
  .field.is-grouped .control:last-child .button {
    margin-bottom: 0;
  }
}

/* ========================================
   RESPONSIVE CARD LAYOUTS
   ======================================== */

/* Enhanced card system for mobile */
.card-responsive {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card-responsive:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Card content improvements */
.card-responsive .card-content {
  padding: var(--spacing-lg);
}

@media screen and (max-width: 768px) {
  .card-responsive .card-content {
    padding: var(--spacing-md);
  }
}

/* Card actions - stack on mobile */
.card-actions {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  border-top: 1px solid #e8e8e8;
  background-color: #fafafa;
}

@media screen and (max-width: 768px) {
  .card-actions {
    flex-direction: column;
  }
  
  .card-actions .button {
    width: 100%;
  }
}

/* ========================================
   RESPONSIVE TABLE LAYOUTS
   ======================================== */

/* Mobile-first: convert tables to cards */
.table-responsive {
  width: 100%;
}

@media screen and (max-width: 768px) {
  .table-responsive {
    display: none;
  }
  
  .table-responsive + .table-cards {
    display: block;
  }
}

@media screen and (min-width: 769px) {
  .table-cards {
    display: none;
  }
}

/* Table card layout for mobile */
.table-cards {
  display: none;
}

.table-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-md);
  border: 1px solid #e8e8e8;
}

.table-card-header {
  font-weight: 600;
  font-size: var(--text-lg);
  margin-bottom: var(--spacing-sm);
  color: #363636;
}

.table-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid #f5f5f5;
}

.table-card-row:last-child {
  border-bottom: none;
}

.table-card-label {
  font-weight: 500;
  color: #7a7a7a;
  font-size: var(--text-sm);
}

.table-card-value {
  font-size: var(--text-sm);
  text-align: right;
}

/* ========================================
   RESPONSIVE GRID SYSTEM ENHANCEMENTS
   ======================================== */

/* Enhanced responsive columns */
.columns.is-mobile-stacked {
  flex-direction: column;
}

@media screen and (min-width: 769px) {
  .columns.is-mobile-stacked {
    flex-direction: row;
  }
}

/* Responsive column gaps */
.columns.has-gap-small {
  margin-left: calc(-1 * var(--spacing-sm));
  margin-right: calc(-1 * var(--spacing-sm));
}

.columns.has-gap-small > .column {
  padding-left: var(--spacing-sm);
  padding-right: var(--spacing-sm);
}

.columns.has-gap-medium {
  margin-left: calc(-1 * var(--spacing-md));
  margin-right: calc(-1 * var(--spacing-md));
}

.columns.has-gap-medium > .column {
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

.columns.has-gap-large {
  margin-left: calc(-1 * var(--spacing-lg));
  margin-right: calc(-1 * var(--spacing-lg));
}

.columns.has-gap-large > .column {
  padding-left: var(--spacing-lg);
  padding-right: var(--spacing-lg);
}

/* ========================================
   RESPONSIVE NAVIGATION ENHANCEMENTS
   ======================================== */

/* Enhanced mobile navigation */
@media screen and (max-width: 1023px) {
  .navbar-menu {
    padding: var(--spacing-md);
    box-shadow: var(--shadow-lg);
  }
  
  .navbar-item {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xs);
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
  }
  
  .navbar-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
  }
  
  .navbar-dropdown {
    position: static !important;
    box-shadow: none !important;
    padding-left: var(--spacing-lg);
    margin-top: var(--spacing-sm);
  }
  
  .navbar-dropdown .navbar-item {
    padding-left: var(--spacing-xl);
    font-size: var(--text-sm);
  }
}

/* Enhanced navbar burger */
.navbar-burger {
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.navbar-burger:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar-burger:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* ========================================
   RESPONSIVE TYPOGRAPHY
   ======================================== */

/* Responsive text sizes */
.text-responsive-xs { font-size: var(--text-xs); }
.text-responsive-sm { font-size: var(--text-sm); }
.text-responsive-base { font-size: var(--text-base); }
.text-responsive-lg { font-size: var(--text-lg); }
.text-responsive-xl { font-size: var(--text-xl); }
.text-responsive-2xl { font-size: var(--text-2xl); }
.text-responsive-3xl { font-size: var(--text-3xl); }

/* Enhanced title responsiveness */
.title.is-responsive-1 { font-size: var(--text-3xl); }
.title.is-responsive-2 { font-size: var(--text-2xl); }
.title.is-responsive-3 { font-size: var(--text-xl); }
.title.is-responsive-4 { font-size: var(--text-lg); }

.subtitle.is-responsive { font-size: var(--text-base); }

/* ========================================
   RESPONSIVE SPACING UTILITIES
   ======================================== */

/* Responsive margin utilities */
.m-responsive-xs { margin: var(--spacing-xs); }
.m-responsive-sm { margin: var(--spacing-sm); }
.m-responsive-md { margin: var(--spacing-md); }
.m-responsive-lg { margin: var(--spacing-lg); }
.m-responsive-xl { margin: var(--spacing-xl); }

.mt-responsive-xs { margin-top: var(--spacing-xs); }
.mt-responsive-sm { margin-top: var(--spacing-sm); }
.mt-responsive-md { margin-top: var(--spacing-md); }
.mt-responsive-lg { margin-top: var(--spacing-lg); }
.mt-responsive-xl { margin-top: var(--spacing-xl); }

.mb-responsive-xs { margin-bottom: var(--spacing-xs); }
.mb-responsive-sm { margin-bottom: var(--spacing-sm); }
.mb-responsive-md { margin-bottom: var(--spacing-md); }
.mb-responsive-lg { margin-bottom: var(--spacing-lg); }
.mb-responsive-xl { margin-bottom: var(--spacing-xl); }

/* Responsive padding utilities */
.p-responsive-xs { padding: var(--spacing-xs); }
.p-responsive-sm { padding: var(--spacing-sm); }
.p-responsive-md { padding: var(--spacing-md); }
.p-responsive-lg { padding: var(--spacing-lg); }
.p-responsive-xl { padding: var(--spacing-xl); }

/* ========================================
   RESPONSIVE LAYOUT UTILITIES
   ======================================== */

/* Container improvements */
.container-responsive {
  max-width: 100%;
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
  margin-left: auto;
  margin-right: auto;
}

@media screen and (min-width: 769px) {
  .container-responsive {
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
  }
}

@media screen and (min-width: 1024px) {
  .container-responsive {
    max-width: 960px;
  }
}

@media screen and (min-width: 1216px) {
  .container-responsive {
    max-width: 1152px;
  }
}

@media screen and (min-width: 1408px) {
  .container-responsive {
    max-width: 1344px;
  }
}

/* Responsive flexbox utilities */
.flex-responsive {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

@media screen and (min-width: 769px) {
  .flex-responsive {
    flex-direction: row;
    align-items: center;
  }
}

.flex-responsive.is-column-always {
  flex-direction: column;
}

.flex-responsive.is-row-tablet {
  flex-direction: column;
}

@media screen and (min-width: 769px) {
  .flex-responsive.is-row-tablet {
    flex-direction: row;
  }
}

/* ========================================
   RESPONSIVE VISIBILITY UTILITIES
   ======================================== */

/* Show/hide on different screen sizes */
.is-hidden-mobile {
  display: none !important;
}

@media screen and (min-width: 769px) {
  .is-hidden-mobile {
    display: block !important;
  }
}

.is-hidden-tablet-up {
  display: block !important;
}

@media screen and (min-width: 769px) {
  .is-hidden-tablet-up {
    display: none !important;
  }
}

.is-hidden-desktop-up {
  display: block !important;
}

@media screen and (min-width: 1024px) {
  .is-hidden-desktop-up {
    display: none !important;
  }
}

/* ========================================
   RESPONSIVE COMPONENT ENHANCEMENTS
   ======================================== */

/* Enhanced notification responsiveness */
.notification {
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
}

@media screen and (max-width: 768px) {
  .notification {
    padding: var(--spacing-md);
    margin-left: var(--spacing-sm);
    margin-right: var(--spacing-sm);
  }
}

/* Enhanced modal responsiveness */
@media screen and (max-width: 768px) {
  .modal-card {
    margin: var(--spacing-md);
    max-height: calc(100vh - 2rem);
  }
  
  .modal-card-head,
  .modal-card-foot {
    padding: var(--spacing-md);
  }
  
  .modal-card-body {
    padding: var(--spacing-md);
  }
}

/* Enhanced tabs responsiveness */
@media screen and (max-width: 768px) {
  .tabs {
    overflow-x: auto;
    white-space: nowrap;
  }
  
  .tabs ul {
    flex-wrap: nowrap;
  }
  
  .tabs li {
    flex-shrink: 0;
  }
  
  .tabs a {
    padding: var(--spacing-md) var(--spacing-lg);
    min-width: var(--touch-target-min);
  }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Enhanced focus indicators */
.button:focus,
.input:focus,
.textarea:focus,
.select select:focus,
.navbar-item:focus,
.pagination-link:focus,
.tabs a:focus,
.breadcrumb a:focus {
  outline: 2px solid #3273dc;
  outline-offset: 2px;
  box-shadow: 0 0 0 0.125em rgba(50, 115, 220, 0.25);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .button,
  .input,
  .textarea,
  .select select {
    border-width: 2px;
  }
  
  .card {
    border: 2px solid #363636;
  }
}

/* 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;
  }
}

/* ========================================
   PRINT OPTIMIZATIONS
   ======================================== */

@media print {
  .button,
  .navbar,
  .breadcrumb,
  .pagination,
  .tabs,
  .modal,
  .notification.is-info,
  .notification.is-warning {
    display: none !important;
  }
  
  .container {
    max-width: none !important;
    padding: 0 !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }
  
  .title,
  .subtitle {
    color: #000 !important;
  }
}