/**
 * Base Mobile CSS
 * Global mobile styles för alla kundsidor
 */
@import url('./responsive-breakpoints.css');

/* ========== MOBILE MODAL SYSTEM STYLES ========== */

/* Bottom Sheet */
.mobile-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  display: none;
}

.mobile-sheet-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 24px 24px 0 0;
  padding: 1.5rem;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
}

.mobile-sheet-overlay.active .mobile-bottom-sheet {
  transform: translateY(0);
}

.mobile-sheet-handle {
  width: 40px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
  margin: 0 auto 1rem;
}

.mobile-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.mobile-sheet-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.mobile-sheet-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  font-size: 1.125rem;
  transition: all 0.2s;
}

.mobile-sheet-close:active {
  transform: scale(0.9);
  background: #e2e8f0;
}

.mobile-sheet-content {
  margin-bottom: 1.5rem;
}

.mobile-sheet-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.mobile-sheet-action {
  flex: 1;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.mobile-sheet-action.primary {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
}

.mobile-sheet-action.secondary {
  background: #f1f5f9;
  color: #1e293b;
}

.mobile-sheet-action:active {
  transform: scale(0.97);
}

/* Action Sheet Styles */
.action-sheet-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5rem;
  text-align: center;
}

.action-sheet-message {
  color: #64748b;
  font-size: 0.938rem;
  text-align: center;
  margin-bottom: 1rem;
}

.action-sheet-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.action-sheet-button {
  width: 100%;
  padding: 1rem;
  border: none;
  background: #f8fafc;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
}

.action-sheet-button:active {
  background: #e2e8f0;
  transform: scale(0.98);
}

.action-sheet-button.destructive {
  color: #ef4444;
}

/* Full Screen Modal */
.mobile-fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.mobile-fullscreen-modal.active {
  transform: translateY(0);
}

.mobile-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  padding-top: calc(1.5rem + env(safe-area-inset-top));
  border-bottom: 1px solid #e2e8f0;
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.mobile-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.mobile-modal-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  font-size: 1.25rem;
  transition: all 0.2s;
}

.mobile-modal-close:active {
  transform: scale(0.9);
  background: #e2e8f0;
}

.mobile-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}

/* Confirm/Alert Messages */
.confirm-message,
.alert-message {
  font-size: 1rem;
  color: #475569;
  line-height: 1.6;
  text-align: center;
  padding: 1rem 0;
}

/* ========== FORM ERROR STYLES ========== */

.field-error-message {
  color: #ef4444;
  font-size: 0.813rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.field-error-message::before {
  content: '⚠';
}

input.error,
textarea.error,
select.error {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

/* ========== IMAGE PREVIEW ========== */

.image-preview {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.image-preview img {
  max-width: 150px;
  max-height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
}

/* ========== CHARACTER COUNTER ========== */

.character-counter {
  text-align: right;
  font-size: 0.813rem;
  color: #64748b;
  margin-top: 0.25rem;
}

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

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

  /* Show only on phone */
  .show-mobile {
    display: block !important;
  }

  /* Full width on phone */
  .full-width-mobile {
    width: 100% !important;
  }

  /* Stack on phone */
  .stack-mobile {
    flex-direction: column !important;
  }

  /* Center on phone */
  .center-mobile {
    text-align: center !important;
  }

  /* Larger touch targets */
  .touch-target {
    min-width: 44px !important;
    min-height: 44px !important;
  }
}

/* Show only on tablet/desktop */
.show-desktop {
  display: none !important;
}

@media (min-width: 768px) {
  .show-desktop {
    display: block !important;
  }

  .hide-desktop {
    display: none !important;
  }
}

/* ========== DARK MODE SUPPORT (Future) ========== */

@media (prefers-color-scheme: dark) {
  .mobile-bottom-sheet,
  .mobile-fullscreen-modal {
    background: #1e293b;
    color: white;
  }

  .mobile-sheet-header,
  .mobile-modal-header {
    border-bottom-color: #334155;
  }

  .mobile-sheet-title,
  .mobile-modal-title,
  .action-sheet-title {
    color: white;
  }

  .mobile-sheet-close,
  .mobile-modal-close {
    background: #334155;
    color: #94a3b8;
  }

  .action-sheet-button {
    background: #334155;
    color: white;
  }

  .action-sheet-button:active {
    background: #475569;
  }
}

