/**
 * WNF Ecosystem - Shared UI Components
 * Единая система UI компонентов для всех продуктов
 *
 * Используется в: Clean, SNM, Pixel, WNF 2.0
 */

/* ===== БАЗОВЫЕ СТИЛИ ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

.wnf-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  outline: none;
}

.wnf-btn-primary {
  background: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.wnf-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.wnf-btn-primary:active {
  transform: translateY(0);
}

.wnf-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.wnf-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

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

.wnf-btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 239, 125, 0.4);
}

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

.wnf-btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(235, 51, 73, 0.4);
}

.wnf-btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

.wnf-btn-large {
  padding: 16px 32px;
  font-size: 16px;
}

.wnf-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

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

.wnf-form-group {
  margin-bottom: 20px;
}

.wnf-form-label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
}

.wnf-form-input,
.wnf-form-select,
.wnf-form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: all 0.3s;
}

.wnf-form-input:focus,
.wnf-form-select:focus,
.wnf-form-textarea:focus {
  outline: none;
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.wnf-form-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.wnf-form-textarea {
  min-height: 100px;
  resize: vertical;
}

.wnf-form-select {
  cursor: pointer;
}

.wnf-form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

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

/* ===== КАРТОЧКИ ===== */

.wnf-card {
  background: rgba(26, 26, 46, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.15);
}

.wnf-card-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.wnf-card-title {
  font-size: 20px;
  font-weight: 600;
  color: #00d4ff;
  margin-bottom: 8px;
}

.wnf-card-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.wnf-card-body {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

.wnf-card-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 212, 255, 0.2);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

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

.wnf-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.wnf-modal.active {
  display: flex;
}

.wnf-modal-content {
  background: rgba(26, 26, 46, 0.98);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 20px;
  padding: 32px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 212, 255, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wnf-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.wnf-modal-title {
  font-size: 24px;
  font-weight: 600;
  color: #00d4ff;
}

.wnf-modal-close {
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.3);
  color: rgba(255, 100, 100, 0.8);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s;
}

.wnf-modal-close:hover {
  background: rgba(255, 100, 100, 0.2);
  color: #ff6464;
}

.wnf-modal-body {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

.wnf-modal-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 212, 255, 0.2);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ===== ТУЛТИПЫ ===== */

.wnf-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.5);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: white;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.wnf-tooltip.visible {
  opacity: 1;
}

/* ===== АЛЕРТЫ ===== */

.wnf-alert {
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  animation: alertSlideIn 0.3s ease;
}

@keyframes alertSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.wnf-alert-info {
  background: rgba(0, 212, 255, 0.15);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #00d4ff;
}

.wnf-alert-success {
  background: rgba(56, 239, 125, 0.15);
  border: 1px solid rgba(56, 239, 125, 0.3);
  color: #38ef7d;
}

.wnf-alert-warning {
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

.wnf-alert-danger {
  background: rgba(235, 51, 73, 0.15);
  border: 1px solid rgba(235, 51, 73, 0.3);
  color: #eb3349;
}

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

/* ===== БЕЙДЖИ ===== */

.wnf-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.wnf-badge-primary {
  background: rgba(0, 212, 255, 0.2);
  color: #00d4ff;
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.wnf-badge-success {
  background: rgba(56, 239, 125, 0.2);
  color: #38ef7d;
  border: 1px solid rgba(56, 239, 125, 0.3);
}

.wnf-badge-danger {
  background: rgba(235, 51, 73, 0.2);
  color: #eb3349;
  border: 1px solid rgba(235, 51, 73, 0.3);
}

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

.wnf-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 212, 255, 0.3);
  border-top-color: #00d4ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.wnf-spinner-small {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.wnf-spinner-large {
  width: 60px;
  height: 60px;
  border-width: 4px;
}

/* ===== СПИСКИ ===== */

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

.wnf-list-item {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.3s;
  cursor: pointer;
}

.wnf-list-item:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.3);
}

.wnf-list-item.active {
  background: rgba(0, 212, 255, 0.2);
  border-color: #00d4ff;
}

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

@media (max-width: 768px) {
  .wnf-btn {
    padding: 10px 20px;
    font-size: 13px;
  }

  .wnf-card {
    padding: 16px;
    border-radius: 12px;
  }

  .wnf-modal-content {
    padding: 24px;
  }

  .wnf-modal-title {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .wnf-btn {
    width: 100%;
  }

  .wnf-card-footer,
  .wnf-modal-footer {
    flex-direction: column;
  }

  .wnf-card-footer .wnf-btn,
  .wnf-modal-footer .wnf-btn {
    width: 100%;
  }
}
