@tailwind base;
@tailwind components;
@tailwind utilities;

/* --- Фиксированные ширины для таблицы параметров размещения --- */
#room-blocks-list th,
#room-blocks-list td {
  width: 33.3%;
  min-width: 220px;
  max-width: 400px;
  box-sizing: border-box;
}

#room-blocks-list .select2-container {
  width: 100% !important;
  min-width: 220px;
  max-width: 390px;
}

#room-blocks-list select {
  width: 100%;
}

/* 1. Цветовая палитра */
:root {
  --crm-primary:     #2563eb; /* насыщенный синий */
  --crm-primary-lt:  #eff6ff; /* очень светлый синий */
  --crm-accent:      #10b981; /* зелёный акцент */
  --crm-bg:          #f9fafb; /* светло-серый фон */
}

/* 2. Компоненты */
@layer components {
  .crm-card {
    @apply bg-white shadow-lg rounded-lg p-6 mb-6;
  }

  .crm-btn {
    @apply inline-block font-medium text-white py-2 px-4 rounded;
  }

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

  .crm-btn-primary:hover {
    background-color: #1e40af; /* чуть темнее */
  }

  .crm-btn-accent {
    background-color: var(--crm-accent);
  }

  .crm-btn-accent:hover {
    background-color: #059669;
  }

  .crm-table {
    @apply w-full bg-white rounded-lg overflow-hidden shadow;
  }

  .crm-table th {
    @apply bg-[var(--crm-primary-lt)] text-left font-semibold p-3;
  }

  .crm-table td {
    @apply p-3;
  }

  .crm-table tr:nth-child(odd) {
    @apply bg-white;
  }

  .crm-table tr:nth-child(even) {
    @apply bg-gray-50;
  }

  .crm-table tr:hover {
    @apply bg-[var(--crm-primary-lt)];
  }

  /* === ДОБАВЛЕНО: Красивая форма клиента === */

  .input-field {
    @apply w-full p-2 border border-gray-300 rounded text-sm;
  }

  .input-field:focus {
    outline: none;
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 1px var(--crm-primary);
  }

  .btn-primary {
    @apply bg-[var(--crm-primary)] text-white py-2 px-4 rounded font-medium transition;
  }

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

  .btn-secondary {
    @apply bg-gray-200 text-gray-700 py-2 px-4 rounded font-medium transition;
  }

  .btn-secondary:hover {
    background-color: #d1d5db;
  }

  /* === НОВЫЕ СТИЛИ ДЛЯ УЛУЧШЕННОЙ ТАБЛИЦЫ СДЕЛОК === */
  
  /* Анимации для hover эффектов */
  .deal-row-hover {
    @apply transition-all duration-200 ease-in-out;
  }

  /* Стили для бейджей типов сделок */
  .deal-type-badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
  }

  /* Стили для иконок действий */
  .action-icon {
    @apply p-1 rounded transition-colors duration-150;
  }

  .action-icon:hover {
    @apply transform scale-110;
  }

  /* Стили для статусов оплаты */
  .payment-status {
    @apply text-xs font-medium;
  }

  /* Градиентные заголовки */
  .table-header-gradient {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  }

  /* Тени для карточек */
  .deal-card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  }

  /* Стили для пустого состояния */
  .empty-state {
    @apply flex flex-col items-center justify-center py-12 text-gray-500;
  }

  /* Анимация появления строк */
  .deal-row {
    animation: fadeInUp 0.3s ease-out;
  }

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

  /* Стили для ID сделки */
  .deal-id-badge {
    @apply inline-flex items-center justify-center w-8 h-8 rounded-full text-sm font-semibold;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
  }

  /* Стили для дат */
  .date-range {
    @apply flex items-center space-x-1 text-sm;
  }

  .date-arrow {
    @apply text-gray-400 mx-1;
  }

  /* Стили для сумм */
  .amount-display {
    @apply font-semibold text-gray-900;
  }

  .amount-currency {
    @apply text-gray-600 ml-1;
  }

  /* Стили для иконок в дополнительной информации */
  .info-icon {
    @apply w-4 h-4 text-gray-500;
  }

  /* Hover эффекты для строк */
  .deal-row:hover {
    @apply bg-gradient-to-r from-blue-50 to-indigo-50;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  /* Стили для кнопок действий */
  .action-button {
    @apply p-1 rounded transition-all duration-150;
  }

  .action-button:hover {
    @apply transform scale-110;
  }

  .action-button.edit {
    @apply text-blue-600 hover:text-blue-800 hover:bg-blue-100;
  }

  .action-button.delete {
    @apply text-red-600 hover:text-red-800 hover:bg-red-100;
  }

  .action-button.documents {
    @apply text-green-600 hover:text-green-800 hover:bg-green-100;
  }
}
