/* Единый файл стилей для TGBooster */

/* ОСНОВНЫЕ СТИЛИ ДЛЯ ТЕМНОЙ ТЕМЫ */
:root {
  --dark-bg: #1e1e1e;
  --dark-card: #252525;
  --dark-card-hover: #2a2a2a;
  --dark-header: #252525;
  --dark-border: #3a3a3a;
  --dark-text: #e0e0e0;
  --dark-text-secondary: #9ca3af;
  --dark-primary: #535353;
}

/* Базовые элементы */
html, body {
  background-color: var(--dark-bg) !important;
  color: var(--dark-text) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.5 !important;
  box-sizing: border-box !important;
}

/* Заголовок */
header {
  background-color: var(--dark-header) !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
  padding: 1rem 1.5rem !important;
  border-bottom: 1px solid var(--dark-border) !important;
}

/* Карточки и контейнеры */
.card, 
.card-container, 
.bg-\[\#252525\] {
  background-color: var(--dark-card) !important;
  border: 1px solid rgba(156, 163, 175, 0.2) var(--dark-border) !important;
  border-radius: 0.375rem !important;
}

/* Кнопки */
.btn-primary, 
.bg-primary, 
button[type="submit"],
#login-button,
#login-button-main, 
#login-button-cta {
  background-color: var(--dark-primary) !important;
  color: white !important;
  border-radius: 0.375rem !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
  padding: 0.5rem 1rem !important;
}

button.bg-primary:hover, 
.bg-primary:hover,
button.hover\:bg-opacity-90:hover {
  opacity: 0.9 !important;
}

/* Текст и ссылки */
.text-white {
  color: white !important;
}
.text-gray-300 {
  color: #d1d5db !important;
}
.text-gray-400 {
  color: #9ca3af !important;
}

a {
  color: #4dabf7 !important;
  text-decoration: none !important;
}

a:hover {
  color: #74c0fc !important;
  text-decoration: underline !important;
}

/* Контейнеры и макет */
.container {
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

/* Сетка и выравнивание */
.mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}
.flex {
  display: flex !important;
}
.grid {
  display: grid !important;
}
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
}
.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
.gap-4 {
  gap: 1rem !important;
}
.gap-6 {
  gap: 1.5rem !important;
}
.items-center {
  align-items: center !important;
}
.justify-center {
  justify-content: center !important;
}
.justify-between {
  justify-content: space-between !important;
}

/* Отступы */
.p-6 {
  padding: 1.5rem !important;
}
.px-4 {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}
.py-2 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}
.px-6 {
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}
.py-3 {
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}
.px-8 {
  padding-left: 2rem !important;
  padding-right: 2rem !important;
}
.pt-6 {
  padding-top: 1.5rem !important;
}
.py-4 {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}
.py-6 {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}
.py-8 {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}
.mt-4 {
  margin-top: 1rem !important;
}
.mb-2 {
  margin-bottom: 0.5rem !important;
}
.mb-4 {
  margin-bottom: 1rem !important;
}
.mb-6 {
  margin-bottom: 1.5rem !important;
}
.mb-8 {
  margin-bottom: 2rem !important;
}
.mt-8 {
  margin-top: 2rem !important;
}
.mt-12 {
  margin-top: 3rem !important;
}
.mr-1 {
  margin-right: 0.25rem !important;
}
.mr-2 {
  margin-right: 0.5rem !important;
}
.ml-1 {
  margin-left: 0.25rem !important;
}
.ml-2 {
  margin-left: 0.5rem !important;
}

/* Типографика */
.text-sm {
  font-size: 0.875rem !important;
}
.text-lg {
  font-size: 1.125rem !important;
}
.text-xl {
  font-size: 1.25rem !important;
}
.text-2xl {
  font-size: 1.5rem !important;
}
.font-medium {
  font-weight: 500 !important;
}
.font-semibold {
  font-weight: 600 !important;
}
.font-bold {
  font-weight: 700 !important;
}
.whitespace-nowrap {
  white-space: nowrap !important;
}

/* Формы */
input, select, textarea {
  background-color: var(--dark-card) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
  padding: 0.5rem 0.75rem !important;
  border-radius: 0.375rem !important;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--dark-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(83, 83, 83, 0.2) !important;
}

/* Подвал */
footer {
  background-color: var(--dark-header) !important;
  border-top: 1px solid var(--dark-border) !important;
  padding: 2rem 0 !important;
}

/* Специальные стили для таблиц */
table {
  border-collapse: collapse !important;
  width: 100% !important;
  margin-bottom: 1rem !important;
}

table th, table td {
  padding: 0.75rem !important;
  border-bottom: 1px solid var(--dark-border) !important;
}

table th {
  font-weight: 600 !important;
  text-align: left !important;
}

/* Медиа-запросы */
@media (min-width: 640px) {
  .container {
    max-width: 640px !important;
  }
}
@media (min-width: 768px) {
  .container {
    max-width: 768px !important;
  }
  .md\:flex-row {
    flex-direction: row !important;
  }
  .md\:mt-0 {
    margin-top: 0 !important;
  }
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}
@media (min-width: 1024px) {
  .container {
    max-width: 1024px !important;
  }
}
@media (min-width: 1280px) {
  .container {
    max-width: 1280px !important;
  }
}
@media (min-width: 1536px) {
  .container {
    max-width: 1536px !important;
  }
}

.order-card {
  background-color: var(--dark-card);
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.order-card .flex {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.order-card .flex-shrink-0 {
  min-width: fit-content;
}

.order-card .text-center {
  text-align: center;
  margin: 0 0.5rem;
}

.order-card .space-x-2 {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

@media (max-width: 768px) {
  .order-card .flex {
    justify-content: center;
  }

  .order-card .space-x-2 {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: center;
  }
}

/* Выпадающее меню пользователя */
.user-dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.user-dropdown .dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 2px);
    background-color: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 8px;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
}

/* Расширяем область срабатывания на весь блок */
.user-dropdown .user-block,
#user-menu-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 48px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.user-dropdown .user-block:hover,
#user-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Создаем невидимый мостик между элементами */
.user-dropdown::after,
#user-menu-wrapper::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    height: 8px;
    z-index: 999;
    pointer-events: none;
}

/* Обработка наведения на весь блок */
.user-dropdown:hover .dropdown-content,
#user-menu-wrapper:hover .user-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown .dropdown-content:hover,
.user-menu:hover {
    display: block;
}