/* Styles personnalisés pour le système de gestion hôtelière */

/* Variables CSS */
:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #0dcaf0;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --hotel-primary: #2c3e50;
  --hotel-secondary: #3498db;
  --hotel-accent: #e74c3c;
}

/* Styles généraux */
body {
  font-family: 'Roboto', sans-serif;
  background-color: #f5f7fa;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 60px; /* Pour le menu fixe */
}

/* Navigation */
.navbar-brand {
  font-weight: 700;
  letter-spacing: 1px;
}

.navbar-dark .navbar-nav .nav-link {
  font-weight: 500;
  transition: all 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: #ffc107 !important;
}

/* Cartes */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
}

.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
  border-radius: 10px 10px 0 0 !important;
  font-weight: 600;
  border: none;
}

/* Boutons */
.btn {
  border-radius: 5px;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--hotel-primary);
  border-color: var(--hotel-primary);
}

.btn-primary:hover {
  background-color: #1a2530;
  border-color: #1a2530;
}

.btn-success {
  background-color: var(--hotel-secondary);
  border-color: var(--hotel-secondary);
}

.btn-success:hover {
  background-color: #2980b9;
  border-color: #2980b9;
}

/* Alertes */
.alert {
  border-radius: 5px;
}

/* Tableaux */
.table {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.table th {
  font-weight: 600;
}

/* Formulaire */
.form-control, .form-select {
  border-radius: 5px;
  padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--hotel-secondary);
  box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

/* Pied de page */
.footer {
  background-color: var(--hotel-primary);
  color: white;
  padding: 2rem 0;
  margin-top: 3rem;
}

/* Eviter que le sidebar fixe recouvre le footer sur les grands écrans : décaler le footer à droite du sidebar */
@media (min-width: 992px) {
  .footer {
    margin-left: 250px; /* correspond à --sidebar-width du template */
  }
}

.footer h5 {
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer a {
  color: #bdc3c7;
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer a:hover {
  color: white;
  text-decoration: underline;
}

/* Styles spécifiques aux cartes administrateur */
.card-admin {
  border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-admin-header {
  background-color: var(--hotel-primary) !important;
  color: white !important;
  border-radius: 10px 10px 0 0 !important;
}

.border-left-primary {
  border-left: 0.25rem solid var(--hotel-primary) !important;
}

.border-left-success {
  border-left: 0.25rem solid var(--hotel-secondary) !important;
}

.border-left-info {
  border-left: 0.25rem solid var(--info-color) !important;
}

.border-left-warning {
  border-left: 0.25rem solid var(--warning-color) !important;
}

.border-left-dark {
  border-left: 0.25rem solid var(--dark-color) !important;
}

/* Compte à rebours */
.countdown {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 1.2rem;
}

/* Images de chambres */
.card-img-top {
  border-radius: 10px 10px 0 0;
}

/* Vidéo de présentation */
.video-presentation {
  border-radius: 10px;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  margin-bottom: 2rem;
}

/* Galerie d'images des chambres */
.gallery-container {
  position: relative;
  overflow: hidden;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 10px;
  cursor: pointer;
  z-index: 2;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.gallery-nav:hover {
  background: rgba(0, 0, 0, 0.7);
}

.gallery-prev {
  left: 10px;
}

.gallery-next {
  right: 10px;
}

.gallery-thumbnails {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  overflow-x: auto;
  padding: 5px;
  scrollbar-width: thin;
}

.gallery-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.gallery-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.3s;
  border-radius: 5px;
  flex-shrink: 0;
}

.gallery-thumbnail.active {
  border-color: var(--hotel-secondary);
}

.price-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
}

.image-counter {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
  z-index: 2;
}

.gallery-indicators {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 2;
}

.gallery-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s;
}

.gallery-indicator.active {
  background: white;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar-brand {
    font-size: 1.2rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .footer {
    text-align: center;
    padding: 1.5rem 0;
  }
  
  .footer h5 {
    margin-top: 1rem;
    font-size: 1.1rem;
  }
  
  .gallery-thumbnail {
    width: 50px;
    height: 50px;
  }
  
  .gallery-nav {
    width: 35px;
    height: 35px;
    padding: 8px;
  }
  
  /* Ajustements pour les formulaires */
  .form-control, .form-select {
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }
  
  /* Ajustements pour les boutons */
  .btn {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
  
  /* Ajustements pour les cartes */
  .card-body {
    padding: 1rem;
  }
  
  /* Ajustements pour le pied de page */
  .footer p {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .gallery-thumbnail {
    width: 40px;
    height: 40px;
  }
  
  .gallery-nav {
    width: 30px;
    height: 30px;
    padding: 6px;
  }
  
  .price-tag, .image-counter {
    font-size: 12px;
    padding: 4px 8px;
  }
  
  .gallery-indicator {
    width: 8px;
    height: 8px;
  }
  
  /* Ajustements supplémentaires pour les très petits écrans */
  body {
    padding-top: 56px;
  }
  
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  h1, .h1 {
    font-size: 1.75rem;
  }
  
  h2, .h2 {
    font-size: 1.5rem;
  }
  
  h3, .h3 {
    font-size: 1.25rem;
  }
  
  .table-responsive {
    font-size: 0.9rem;
  }
  
  .table th, .table td {
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .card-body {
    padding: 0.75rem;
  }
  
  .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
  
  .form-control, .form-select {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
  }
  
  .gallery-thumbnails {
    gap: 3px;
    padding: 3px;
  }
  
  .footer {
    padding: 1rem 0;
  }
  
  .footer h5 {
    font-size: 1rem;
  }
  
  .footer p {
    font-size: 0.8rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Styles pour les onglets */
.nav-tabs .nav-link {
  border: 1px solid transparent;
  border-bottom: none;
  color: #6c757d;
  font-weight: 500;
  padding: 12px 20px;
  margin-right: 5px;
  border-radius: 5px 5px 0 0;
  transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
  background-color: #e9ecef;
  border-color: #dee2e6;
}

.nav-tabs .nav-link.active {
  background-color: var(--hotel-primary);
  color: white;
  border-color: var(--hotel-primary);
}

.tab-content {
  background-color: white;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 5px 5px;
  padding: 20px;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Améliorations de la navigation */
.navbar-toggler {
  border: none;
  outline: none;
  box-shadow: none;
}

.navbar-toggler:focus {
  box-shadow: none;
}

/* Ajustements pour les petits écrans */
@media (max-width: 991px) {
  .navbar-nav {
    text-align: center;
  }
  
  .navbar-nav .nav-item {
    margin-bottom: 0.5rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
  }
  
  /* Ajustements pour les colonnes */
  .row {
    margin-left: -10px;
    margin-right: -10px;
  }
  
  [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Styles pour les tableaux responsives */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Améliorations pour les formulaires sur mobile */
@media (max-width: 768px) {
  .form-group {
    margin-bottom: 1rem;
  }
  
  .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
  }
  
  .input-group {
    flex-direction: column;
  }
  
  .input-group .form-control,
  .input-group .btn {
    width: 100%;
    border-radius: 5px;
  }
  
  .input-group .btn {
    margin-top: 0.5rem;
  }
}

/* Améliorations pour les cartes sur mobile */
@media (max-width: 768px) {
  .card-header {
    padding: 0.75rem 1rem;
  }
  
  .card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }
  
  .card-text {
    font-size: 0.95rem;
  }
}

/* Ajustements pour les alertes sur mobile */
@media (max-width: 768px) {
  .alert {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  .alert h6 {
    font-size: 1rem;
  }
}

/* Styles pour les modals sur mobile */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 10px;
    max-width: calc(100% - 20px);
  }
  
  .modal-content {
    border-radius: 10px;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }
  
  .modal-title {
    font-size: 1.25rem;
  }
}

/* Améliorations spécifiques pour Android */
@media screen and (max-width: 768px) {
  body.android-device {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Amélioration du scroll pour Android */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Ajustements pour les boutons sur Android */
  .btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  /* Amélioration de la performance sur Android */
  .sidebar, .main-content, .card {
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  
  /* Ajustements pour le header sur Android */
  .navbar-admin {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 10px;
  }
  
  .navbar-brand {
    flex: 1;
    text-align: center;
    font-size: 1rem;
    padding: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Amélioration de la navigation sur Android */
  .nav-link {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  /* Ajustements pour les formulaires sur Android */
  .form-control, .form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }
  
  /* Amélioration du scroll pour les listes déroulantes */
  select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
  }
}
