/* =============================================================
   MODAL HOUSE MANAGER - STYLES
   ============================================================= */

/* Overlay de la modal */
.house-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.house-modal-overlay.active {
  display: flex;
}

/* Conteneur principal de la modal */
.house-modal {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(20, 20, 30, 0.95));
  border-radius: 20px;
  backdrop-filter: blur(15px);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  overflow: visible !important; /* Permet aux tooltips de dépasser */
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(100, 150, 255, 0.3);
  color: white;
}

/* Modal agrandie */
.house-modal-large {
  max-width: 1200px !important;
}

/* Contenu des modales - texte lisible sur fond sombre */
.house-modal p,
.house-modal div,
.house-modal span,
.house-modal label {
  color: rgba(255, 255, 255, 0.9);
}

.house-modal h1,
.house-modal h2,
.house-modal h3,
.house-modal h4,
.house-modal h5,
.house-modal h6 {
  color: white;
}

/* Header de la modal */
.house-modal-header {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(20, 20, 30, 0.95));
  color: white;
  padding: 20px 25px;
  position: relative;
  backdrop-filter: blur(15px);
  border-bottom: 2px solid rgba(100, 150, 255, 0.3);
  border-radius: 20px 20px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.house-modal-title-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.house-modal-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.house-rename-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
  color: white;
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  opacity: 0.8;
}

.house-rename-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  opacity: 1;
  transform: scale(1.05);
}

.house-rename-input {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 22px;
  font-weight: 600;
  color: #333;
  min-width: 250px;
  max-width: 350px;
  outline: none;
  transition: all 0.3s;
  text-shadow: none;
}

.house-rename-input:focus {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

.house-modal-subtitle {
  margin: 5px 0 0 0;
  font-size: 14px;
  opacity: 0.9;
  font-weight: 300;
}

.house-modal-close {
  position: absolute;
  top: 20px;
  right: 25px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.house-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Navigation par onglets */
.house-modal-tabs {
  display: flex;
  background: rgba(100, 150, 255, 0.05);
  border-bottom: 1px solid rgba(100, 150, 255, 0.1);
}

.house-modal-tab {
  flex: 1;
  padding: 15px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 3px solid transparent;
}

.house-modal-tab:hover {
  background: rgba(100, 150, 255, 0.08);
  color: #333;
}

.house-modal-tab.active {
  color: #667eea;
  background: rgba(100, 150, 255, 0.1);
  border-bottom-color: #667eea;
}

.house-modal-tab-icon {
  margin-right: 8px;
  font-size: 16px;
}

/* Contenu de la modal */
.house-modal-content {
  padding: 0;
  min-height: 400px;
  max-height: calc(85vh - 200px);
  overflow-y: auto;
  background: rgba(10, 10, 20, 0.3);
}

.house-modal-tab-content {
  display: none;
  padding: 30px;
  animation: fadeInUp 0.3s ease-out;
}

.house-modal-tab-content.active {
  display: block;
}

/* Character edit modal footer with house styles */
.character-edit-modal .house-modal-footer {
  padding: 20px;
}

/* =============================================================
   MODAL D'ASSIGNATION DE MAISON - STYLES
   ============================================================= */

.house-assignment-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 15000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.house-assignment-overlay.active {
  opacity: 1;
  visibility: visible;
}

.house-assignment-modal {
  background: linear-gradient(135deg, rgba(15, 15, 25, 0.95), rgba(30, 30, 45, 0.98));
  border-radius: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(100, 150, 255, 0.2);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  transform: translateY(30px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(100, 150, 255, 0.3);
}

.house-assignment-overlay.active .house-assignment-modal {
  transform: translateY(0) scale(1);
}

/* En-tête de la modal */
.house-assignment-header {
  background: linear-gradient(135deg, rgba(10, 10, 20, 0.9), rgba(25, 25, 40, 0.95));
  padding: 24px;
  border-bottom: 2px solid rgba(100, 150, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 24px 24px 0 0;
}

/* Contenu de la modal */
.house-assignment-content {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

/* Cartes de maisons */
.house-selection-card {
  background: rgba(40, 40, 60, 0.6);
  border: 2px solid rgba(100, 150, 255, 0.2);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.house-selection-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981, #059669);
  transform: scaleX(0);
  transition: transform 0.3s;
}

.house-selection-card:hover {
  background: rgba(50, 50, 80, 0.8);
  border-color: rgba(100, 150, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(100, 150, 255, 0.15);
}

.house-selection-card:hover::before {
  transform: scaleX(1);
}

.house-card-icon {
  font-size: 32px;
  width: 60px;
  height: 60px;
  background: rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(16, 185, 129, 0.3);
  flex-shrink: 0;
}

.house-card-info {
  flex: 1;
  min-width: 0;
}

.house-card-name {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.house-card-type {
  font-size: 14px;
  color: rgba(16, 185, 129, 0.9);
  font-weight: 500;
  margin-bottom: 2px;
}

.house-card-address {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  margin-bottom: 8px;
}

.house-card-occupancy {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.occupancy-status.house-available {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.occupancy-status.house-full {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* États des cartes de maisons */
.house-selection-card.house-full {
  border-color: rgba(245, 158, 11, 0.3);
}

.house-selection-card.house-full:hover {
  border-color: rgba(245, 158, 11, 0.5);
}

.house-selection-card.house-full .house-card-icon {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.3);
}

.house-selection-card.house-available .house-card-icon {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.3);
}

.house-card-arrow {
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s;
  flex-shrink: 0;
}

.house-selection-card:hover .house-card-arrow {
  color: rgba(16, 185, 129, 0.9);
  transform: translateX(4px);
}

/* =============================================================
   MODAL DES MAISONS MODERNISÉE - STYLES
   ============================================================= */

/* Onglet Informations */
.house-info-modern {
  padding: 20px;
}

/* =============================================================
   RESPONSIVE STYLES FOR HOUSE MODALS
   ============================================================= */

/* Responsive */
@media (max-width: 768px) {
  .house-modal {
    width: 95%;
    margin: 20px;
    max-height: 90vh;
  }
  
  .house-modal-header {
    padding: 15px 20px;
  }
  
  .house-modal-title {
    font-size: 20px;
  }
  
  .house-modal-tabs {
    overflow-x: auto;
  }
  
  .house-modal-tab {
    white-space: nowrap;
    min-width: 120px;
  }

  /* House assignment modal responsive */
  .house-assignment-modal {
    width: 95%;
    max-height: 90vh;
  }
  
  .house-assignment-header {
    padding: 20px;
  }
  
  .house-selection-card {
    padding: 16px;
  }
  
  .house-card-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
}

/* =============================================================
   ANIMATIONS FOR HOUSE MODALS
   ============================================================= */

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =============================================================
   BUILDING-RELATED SHOP ITEMS (House-related)
   ============================================================= */

/* Catégories spéciales */
.shop-item.building {
  border-left: 4px solid #3498db;
}
/* ─── Onglet Stats (proprio uniquement) ─────────────────────────── */
.house-stats-content { padding: 8px 4px; }
.hs-banner {
  background: linear-gradient(135deg, rgba(201,149,42,0.18), rgba(27,67,50,0.15));
  border: 1px solid rgba(201,149,42,0.35);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  text-align: center;
}
.hs-banner__label { font-size: 12px; color: rgba(255,255,255,0.65); text-transform: uppercase; letter-spacing: 0.5px; }
.hs-banner__value { font-size: 28px; font-weight: 700; color: #c9952a; margin: 4px 0; }
.hs-banner__hint  { font-size: 11px; color: rgba(255,255,255,0.45); }

.hs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.hs-card {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px 14px;
}
.hs-card__icon { font-size: 26px; flex-shrink: 0; }
.hs-card__body { flex: 1; min-width: 0; }
.hs-card__title { font-size: 11px; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.3px; }
.hs-card__total { font-size: 22px; font-weight: 700; color: #fff; line-height: 1.2; }
.hs-card__sub   { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }

.hs-section-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 8px 0 8px;
}
.hs-recent { list-style: none; padding: 0; margin: 0; }
.hs-recent__row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  margin-bottom: 4px;
  font-size: 13px;
}
.hs-recent__pseudo { font-weight: 600; color: #fff; min-width: 110px; }
.hs-recent__action { color: rgba(255,255,255,0.65); flex: 1; }
.hs-recent__coin {
  background: rgba(201,149,42,0.2);
  color: #c9952a;
  font-weight: 600;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}
.hs-recent__date { color: rgba(255,255,255,0.4); font-size: 11px; flex-shrink: 0; }
.hs-empty {
  text-align: center;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  padding: 18px 0;
  font-style: italic;
}
