/* =============================================================
   MODAL FORMS - STYLES
   ============================================================= */

/* =============================================================
   FORM INPUT STYLES - HOUSE RENAME
   ============================================================= */

.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);
}

/* =============================================================
   ADD RESIDENT FORM STYLES
   ============================================================= */

.add-resident-form {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(100, 150, 255, 0.3);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s;
  margin-bottom: 12px;
}

.add-resident-form.expanded {
  border-color: rgba(100, 150, 255, 0.5);
  background: rgba(0, 0, 0, 0.8);
  text-align: left;
}

.resident-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

/* =============================================================
   FORM COMPONENTS - GROUPS, LABELS, INPUTS
   ============================================================= */

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9) !important;
  margin-top: 15px;
  margin-bottom: 8px;
  font-size: 14px;
  letter-spacing: 0.3px;
}

.form-group label {
  display: block;
  margin-top: 15px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 600;
}

.form-input,
.form-textarea,
.form-select {
  padding: 10px 12px;
  border: 2px solid rgba(100, 150, 255, 0.2) !important;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.05) !important;
  color: white !important;
  font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: rgba(100, 150, 255, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(100, 150, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.5;
}

.form-select {
  cursor: pointer;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
  padding-right: 36px !important;
}

.form-select option {
  background: rgba(30, 30, 50, 0.95) !important;
  color: white !important;
}

/* Style pour les dates */
.form-input[type="date"] {
  color-scheme: dark;
}

.form-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

/* =============================================================
   FORM ACTIONS AND BUTTONS
   ============================================================= */

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: flex-end;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #f8f9fa;
  color: #666;
  border: 2px solid #e1e5e9;
}

.btn-secondary:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

/* =============================================================
   CHARACTER CREATOR FORM - STYLE SOMBRE
   ============================================================= */

.character-creator-form {
  width: 400px;
  padding: 25px;
  overflow-y: auto;
  background: rgba(30, 30, 45, 0.7) !important;
  backdrop-filter: blur(10px);
}

.character-creator-form h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 2px solid rgba(100, 150, 255, 0.5) !important;
  padding-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1024px) {
  .character-creator-form {
    width: 100%;
  }
}

/* =============================================================
   QUANTITY MODAL AND CONTROLS
   ============================================================= */

.quantity-modal {
  max-width: 500px;
  width: 90%;
}

.quantity-selection {
  padding: 20px;
}

.quantity-controls {
  margin-bottom: 25px;
}

.quantity-label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin-bottom: 12px;
}

.quantity-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.quantity-btn {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(100, 150, 255, 0.3);
  background: rgba(60, 60, 80, 0.8);
  color: white;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  border-color: rgba(100, 150, 255, 0.6);
  background: rgba(80, 80, 100, 0.9);
  transform: scale(1.05);
}

#quantityInput {
  width: 80px;
  height: 40px;
  border: 2px solid rgba(100, 150, 255, 0.3);
  background: rgba(60, 60, 80, 0.8);
  color: white;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  outline: none;
}

#quantityInput:focus {
  border-color: rgba(100, 150, 255, 0.6);
  background: rgba(80, 80, 100, 0.9);
}

/* =============================================================
   QUANTITY SHORTCUTS AND SUMMARY
   ============================================================= */

.quantity-shortcuts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quantity-shortcut {
  padding: 8px 16px;
  border: 2px solid rgba(100, 150, 255, 0.2);
  background: rgba(40, 40, 50, 0.8);
  color: white;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.quantity-shortcut:hover {
  border-color: rgba(100, 150, 255, 0.5);
  background: rgba(60, 60, 80, 0.9);
  transform: translateY(-1px);
}

.quantity-summary {
  margin-bottom: 25px;
  padding: 15px;
  background: rgba(40, 40, 50, 0.8);
  border-radius: 12px;
  border: 2px solid rgba(100, 150, 255, 0.2);
}

.quantity-total-price, .quantity-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.quantity-balance {
  margin-bottom: 0;
}

.price-label, .balance-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.total-price {
  font-size: 18px;
  font-weight: 700;
  color: #4CAF50;
}

.balance-amount {
  font-size: 16px;
  font-weight: 600;
  color: white;
}

.balance-amount.insufficient {
  color: #F44336;
}

/* =============================================================
   QUANTITY ACTION BUTTONS
   ============================================================= */

.quantity-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.cancel-btn, .confirm-purchase-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
}

.cancel-btn {
  background: rgba(80, 80, 100, 0.8);
  color: white;
  border: 2px solid rgba(100, 150, 255, 0.3);
}

.cancel-btn:hover {
  background: rgba(100, 100, 120, 0.9);
  border-color: rgba(100, 150, 255, 0.5);
}

.confirm-purchase-btn {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  border: 2px solid #4CAF50;
}

.confirm-purchase-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.confirm-purchase-btn:disabled {
  background: rgba(80, 80, 100, 0.8);
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(100, 150, 255, 0.2);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* =============================================================
   RESPONSIVE DESIGN FOR FORMS
   ============================================================= */

@media (max-width: 768px) {
  .quantity-modal {
    width: 95%;
    max-width: none;
  }
  
  .quantity-shortcuts {
    justify-content: center;
  }
  
  .quantity-actions {
    flex-direction: column;
  }
}