/* ============================================================
   ОБЩИЕ СТИЛИ ДЛЯ ВСЕХ СТРАНИЦ
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #333;
}

.container {
  flex: 1;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  min-height: 100vh;
}

.content {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  padding-bottom: 80px;
}

/* ============================================================
   НОВЫЙ КОМПАКТНЫЙ HEADER
   ============================================================ */

.header {
  position: sticky;           /* ✅ ДОБАВЛЕНО */
  top: 0;                     /* ✅ ДОБАВЛЕНО */
  z-index: 100;               /* ✅ ДОБАВЛЕНО */
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  min-height: 55px;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-logo {
  height: 35px;
  width: auto;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.header-user-info {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.header-login {
  font-size: 11px;
  opacity: 0.9;
  line-height: 1.2;
}

.header-balance {
  font-size: 15px;
  font-weight: 700;
  color: #ffeb3b;
  line-height: 1.2;
}

/* ============================================================
   ИНФОРМАЦИОННЫЕ БЛОКИ
   ============================================================ */

.info-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  border: 1px solid #e9ecef;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e9ecef;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 13px;
  color: #6c757d;
}

.info-value {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.balance {
  color: #28a745;
  font-size: 22px;
  font-weight: 700;
}

/* ============================================================
   КНОПКИ
   ============================================================ */

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  text-decoration: none;
  margin-bottom: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(235, 51, 73, 0.3);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-outline {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-icon .icon {
  font-size: 18px;
}

/* ============================================================
   ФОРМЫ
   ============================================================ */

.form-group {
  margin-bottom: 15px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
  font-size: 13px;
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 15px;
  transition: border 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: #667eea;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ============================================================
   СПИСОК КОНТАКТОВ (ОБНОВЛЕНО)
   ============================================================ */

.contact-list {
  list-style: none;
}

.contact-item {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #e9ecef;
  transition: all 0.3s;
  position: relative;
}

.contact-item:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.contact-info {
  flex: 1;
}

.contact-name {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 2px;
}

.contact-sponsor-balance {
  font-size: 12px;
  color: #28a745;
  font-weight: 600;
  margin-top: 4px;
}

.contact-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-icon-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-call {
  color: #28a745;
}

.btn-call:active {
  transform: scale(0.95);
  background: #28a745;
  color: white;
}

.btn-menu {
  color: #6c757d;
}

.btn-menu:active {
  transform: scale(0.95);
  background: #6c757d;
  color: white;
}

/* Dropdown меню для контакта */
.contact-dropdown {
  position: absolute;
  right: 10px;
  top: 55px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 100;
  min-width: 180px;
  display: none;
}

.contact-dropdown.active {
  display: block;
}

.contact-dropdown-item {
  padding: 12px 15px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
}

.contact-dropdown-item:last-child {
  border-bottom: none;
}

.contact-dropdown-item:hover {
  background: #f8f9fa;
}

.contact-dropdown-item:active {
  background: #e9ecef;
}

/* ============================================================
   АКТИВНЫЙ СОЗВОН (НОВОЕ)
   ============================================================ */

.call-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  transition: all 0.3s;
}

.call-card.active {
  border-color: #28a745;
  background: #f0fff4;
}

.call-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.call-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #333;
}

.call-card-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.call-card-status.waiting {
  background: #fff3cd;
  color: #856404;
}

.call-card-status.active {
  background: #d4edda;
  color: #155724;
}

.call-card-info {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 8px;
}

.call-card-participants {
  margin: 10px 0;
}

.call-card-participants-title {
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 5px;
}

.call-participant {
  display: inline-block;
  background: #e9ecef;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  margin-right: 5px;
  margin-bottom: 5px;
}

.call-participant.online {
  background: #d4edda;
  color: #155724;
  font-weight: 600;
}

.call-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-join-call {
  flex: 1;
  background: #28a745;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-join-call:active {
  transform: scale(0.98);
  background: #218838;
}

.btn-delete-call {
  width: 45px;
  background: #dc3545;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-delete-call:active {
  transform: scale(0.98);
  background: #c82333;
}

/* ============================================================
   КНОПКА "СОЗВОНИТЬСЯ" (НОВОЕ)
   ============================================================ */

.btn-create-call {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  border: none;
  width: 100%;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 15px;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  transition: all 0.3s;
}

.btn-create-call:active {
  transform: scale(0.98);
}

/* ============================================================
   ВЫБОР КОНТАКТОВ ДЛЯ СОЗВОНА (НОВОЕ)
   ============================================================ */

.contact-selector {
  display: none;
  background: white;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  border: 2px solid #667eea;
}

.contact-selector.active {
  display: block;
}

.contact-selector-header {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #333;
}

.contact-select-item {
  display: flex;
  align-items: center;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.contact-select-item:hover {
  background: #e9ecef;
}

.contact-select-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  cursor: pointer;
}

.contact-select-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ============================================================
   НИЖНЯЯ НАВИГАЦИЯ (ОБНОВЛЕНО)
   ============================================================ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 100;
  max-width: 480px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #6c757d;
  transition: all 0.3s;
  padding: 6px 16px;
  border-radius: 10px;
  min-width: 65px;
}

.nav-item:hover {
  background: #f8f9fa;
}

.nav-item.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.nav-icon {
  font-size: 22px;
  margin-bottom: 3px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
}

/* ============================================================
   МОДАЛЬНЫЕ ОКНА
   ============================================================ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 25px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-icon {
  font-size: 56px;
  margin-bottom: 15px;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.modal-text {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 8px;
}

/* ============================================================
   УВЕДОМЛЕНИЯ / АЛЕРТЫ
   ============================================================ */

.alert {
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.alert-icon {
  font-size: 20px;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */

@media (max-width: 480px) {
  .content {
    padding: 12px;
  }
  
  .header-logo {
    height: 30px;
  }
  
  .header-user-info {
    font-size: 12px;
  }
  
  .header-balance {
    font-size: 13px;
  }
}

/* ============================================================
   ЗАГРУЗКА
   ============================================================ */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: #6c757d;
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 15px;
  opacity: 0.5;
}

