/**
 * NautiSphere - Responsive CSS
 * Styles responsive pour les dashboards BUSINESS
 * @version 1.0.0
 */

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

/* Hide scrollbar on tabs */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Safe area pour iPhone avec notch */
@supports (padding: max(0px)) {
  .safe-bottom {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  .safe-top {
    padding-top: max(0px, env(safe-area-inset-top));
  }
}

/* Touch targets minimum 44x44px sur mobile */
@media (max-width: 640px) {
  .touch-target {
    min-height: 44px;
    min-width: 44px;
  }

  button,
  a.nav-item,
  .btn {
    min-height: 44px;
  }
}

/* Empêcher le zoom sur input focus (iOS) */
@media (max-width: 640px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Sticky header avec safe area */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top);
}

/* ========================================
   SIDEBAR BUSINESS
   ======================================== */

/* Sidebar base */
#sidebar {
  transition: transform 0.3s ease-in-out;
}

/* Nav items BUSINESS */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item.active {
  background: rgba(139, 92, 246, 0.3);
  color: white;
}

/* ========================================
   MODALS RESPONSIVE
   ======================================== */

/* Bottom sheet style sur mobile */
@media (max-width: 640px) {
  .modal-responsive {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-responsive > div {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 1rem 1rem 0 0 !important;
    max-height: 90vh;
  }

  /* Animation slide up */
  .modal-slide-up {
    animation: slideUp 0.3s ease-out;
  }

  @keyframes slideUp {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

@media (max-width: 640px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
}

/* ========================================
   TABLES RESPONSIVE
   ======================================== */

/* Table scroll container */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -1rem;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .table-responsive {
    margin: 0;
    padding: 0;
  }
}

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

@media (max-width: 768px) {
  .hide-tablet {
    display: none !important;
  }
}

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

/* ========================================
   CARDS RESPONSIVE
   ======================================== */

/* Card grid responsive */
.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

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

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

@media (min-width: 1280px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========================================
   FORMS RESPONSIVE
   ======================================== */

/* Form grid */
.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Full width on all breakpoints */
.form-grid .full-width {
  grid-column: 1 / -1;
}

/* ========================================
   BUTTONS RESPONSIVE
   ======================================== */

/* Button group: stacked on mobile, inline on desktop */
.btn-group-responsive {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .btn-group-responsive {
    flex-direction: row;
    justify-content: flex-end;
  }

  .btn-group-responsive > * {
    width: auto;
  }
}

/* Full width buttons on mobile */
@media (max-width: 640px) {
  .btn-full-mobile {
    width: 100%;
  }
}

/* ========================================
   TYPOGRAPHY RESPONSIVE
   ======================================== */

.text-responsive-xl {
  font-size: 1.5rem;
}

.text-responsive-2xl {
  font-size: 1.875rem;
}

.text-responsive-3xl {
  font-size: 2.25rem;
}

@media (min-width: 640px) {
  .text-responsive-xl {
    font-size: 1.875rem;
  }

  .text-responsive-2xl {
    font-size: 2.25rem;
  }

  .text-responsive-3xl {
    font-size: 3rem;
  }
}

/* ========================================
   TABS RESPONSIVE
   ======================================== */

.tabs-responsive {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin: 0 -1rem;
  padding: 0 1rem;
}

.tabs-responsive::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  white-space: nowrap;
  padding: 0.75rem 0.25rem;
  font-size: 0.875rem;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  transition: all 0.2s;
  background: transparent;
  cursor: pointer;
}

.tab-btn:hover {
  color: #374151;
}

.tab-btn.active {
  border-color: #8b5cf6;
  color: #7c3aed;
  font-weight: 500;
}

@media (min-width: 640px) {
  .tabs-responsive {
    margin: 0;
    padding: 0;
    gap: 2rem;
  }

  .tab-btn {
    padding: 1rem 0.25rem;
  }
}

/* ========================================
   STATS CARDS RESPONSIVE
   ======================================== */

.stats-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr);
}

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

/* ========================================
   PROPLUS SPECIFIC STYLES
   ======================================== */

/* BUSINESS Badge */
.business-badge {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* BUSINESS Gradient Header */
.business-header {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  padding: 1rem;
  border-radius: 0.75rem;
}

@media (min-width: 640px) {
  .business-header {
    padding: 1.5rem;
    border-radius: 1rem;
  }
}

/* BUSINESS Card */
.business-card {
  background: white;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  padding: 1rem;
  transition: box-shadow 0.2s;
}

.business-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

@media (min-width: 640px) {
  .business-card {
    padding: 1.5rem;
    border-radius: 1rem;
  }
}

/* ========================================
   CERTIFICATION REQUEST SPECIFIC
   ======================================== */

/* Radio card style */
.radio-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.radio-card:hover {
  border-color: #c4b5fd;
}

.radio-card:has(input:checked) {
  border-color: #8b5cf6;
  background-color: #faf5ff;
}

@media (min-width: 640px) {
  .radio-card {
    padding: 1rem 1.25rem;
    border-radius: 1rem;
  }
}

/* File upload zone */
.file-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border: 2px dashed #d1d5db;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.file-upload-zone:hover {
  border-color: #8b5cf6;
  background-color: #faf5ff;
}

@media (min-width: 640px) {
  .file-upload-zone {
    padding: 2rem;
    border-radius: 1rem;
  }
}

/* ========================================
   ADMIN DASHBOARD SPECIFIC
   ======================================== */

/* Certification request card */
.certification-card {
  background: white;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  padding: 1rem;
  transition: box-shadow 0.2s;
}

.certification-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

@media (min-width: 640px) {
  .certification-card {
    padding: 1.5rem;
    border-radius: 1rem;
  }
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.pending {
  background-color: #fef3c7;
  color: #92400e;
}

.status-badge.reviewing {
  background-color: #dbeafe;
  color: #1e40af;
}

.status-badge.approved {
  background-color: #dcfce7;
  color: #166534;
}

.status-badge.rejected {
  background-color: #fee2e2;
  color: #991b1b;
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

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

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

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

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

/* ========================================
   LOADING STATES
   ======================================== */

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 0.5rem;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus visible pour navigation clavier */
:focus-visible {
  outline: 2px solid #8b5cf6;
  outline-offset: 2px;
}

/* Réduire les animations si préférence utilisateur */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
