/* Unified component styles for buttons, cards, forms, and navigation */

/* Button styles */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background-color: var(--gray-100);
  color: var(--text-light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dark .btn-secondary {
  background-color: var(--gray-700);
  color: var(--text-dark);
}

.btn-secondary:hover {
  background-color: var(--gray-200);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dark .btn-secondary:hover {
  background-color: var(--gray-600);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-block {
  width: 100%;
}

/* Card styles */
.card {
  background-color: var(--card-light);
  border-radius: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  border: 1px solid var(--gray-100);
  overflow: hidden;
}

.dark .card {
  background-color: var(--card-dark);
  border-color: var(--gray-800);
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.dark .card-header {
  border-bottom-color: var(--gray-800);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--gray-100);
}

.dark .card-footer {
  border-top-color: var(--gray-800);
}

/* Form styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.dark .form-label {
  color: var(--text-dark);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  font-size: 1rem;
  background-color: var(--white);
  color: var(--text-light);
  transition: all 0.2s ease;
}

.dark .form-input {
  background-color: var(--gray-800);
  color: var(--text-dark);
  border-color: var(--gray-700);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2);
}

.form-input:disabled {
  background-color: var(--gray-100);
  cursor: not-allowed;
}

.dark .form-input:disabled {
  background-color: var(--gray-900);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* Navigation styles */
.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0;
  text-decoration: none;
  color: var(--subtext-light);
  transition: color 0.2s ease;
  position: relative;
}

.dark .nav-link {
  color: var(--subtext-dark);
}

.nav-link.active {
  color: var(--primary);
}

.nav-link:hover {
  color: var(--primary);
}

.nav-icon {
  font-size: 1.5rem;
}

.nav-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Input field with icon */
.input-with-icon {
  position: relative;
}

.input-with-icon .icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
}

.input-with-icon .form-input {
  padding-left: 2.5rem;
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-primary {
  background-color: var(--primary);
  color: var(--white);
}

.badge-secondary {
  background-color: var(--gray-100);
  color: var(--text-light);
}

.dark .badge-secondary {
  background-color: var(--gray-800);
  color: var(--text-dark);
}

/* Alert styles */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-success {
  background-color: var(--green-100);
  border-color: var(--green-200);
  color: var(--green-800);
}

.alert-error {
  background-color: var(--red-100);
  border-color: var(--red-200);
  color: var(--red-800);
}

.alert-warning {
  background-color: var(--yellow-100);
  border-color: var(--yellow-200);
  color: var(--yellow-800);
}

.alert-info {
  background-color: var(--blue-100);
  border-color: var(--blue-200);
  color: var(--blue-800);
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--card-light);
  border-radius: 1.5rem;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal.open .modal-content {
  transform: translateY(0);
}

.dark .modal-content {
  background-color: var(--card-dark);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dark .modal-header {
  border-bottom-color: var(--gray-800);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.dark .modal-footer {
  border-top-color: var(--gray-800);
}

/* Tab styles */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 1rem;
}

.dark .tabs {
  border-bottom-color: var(--gray-700);
}

.tab {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  font-weight: 600;
}

.tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.tab:hover:not(.active) {
  color: var(--text-light);
}

.dark .tab:hover:not(.active) {
  color: var(--text-dark);
}

/* Avatar ring — tier visual indicator component */
.avatar-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 999px;
  overflow: hidden;
  box-sizing: border-box;
}

.avatar-ring__inner {
  position: relative;
  z-index: 1;
  border-radius: inherit;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  box-sizing: border-box;
  background-color: var(--avatar-ring-inner-bg, #ffffff);
}

@keyframes avatarRingVipSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.avatar-ring--vip {
  padding: 3px;
}

.avatar-ring--vip::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    #515bd4 0deg,
    #8134af 70deg,
    #dd2a7b 150deg,
    #f58529 230deg,
    #feda77 300deg,
    #515bd4 360deg
  );
  animation: none;
}

html.dark .avatar-ring--vip .avatar-ring__inner {
  background-color: #0f172a;
}

/* Solid ring variants for non-VIP tiers */
.avatar-ring--free {
  padding: 0;
  background: transparent;
}

.avatar-ring--basic {
  padding: 2px;
  background: #22c55e;
}

.avatar-ring--premium {
  padding: 2px;
  background: #ea580c;
}

/* ==============================
   Notification Toast
   ============================== */
#notification-container {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.notification-toast {
  width: 340px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  position: relative;
  border-left: 4px solid var(--toast-info, #3b82f6);
}

.notification-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.notification-toast.hiding {
  transform: translateX(120%);
  opacity: 0;
}

.notification-toast--success {
  border-left-color: var(--toast-success, #22c55e);
}

.notification-toast--warning {
  border-left-color: var(--toast-warning, #f59e0b);
}

.notification-toast--error {
  border-left-color: var(--toast-error, #ef4444);
}

.notification-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}

.notification-toast--info .notification-icon {
  color: var(--toast-info, #3b82f6);
}

.notification-toast--success .notification-icon {
  color: var(--toast-success, #22c55e);
}

.notification-toast--warning .notification-icon {
  color: var(--toast-warning, #f59e0b);
}

.notification-toast--error .notification-icon {
  color: var(--toast-error, #ef4444);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 2px;
  line-height: 1.3;
}

.notification-message {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

.notification-close {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  flex-shrink: 0;
  border-radius: 4px;
  transition: background 0.15s ease;
  margin-left: auto;
}

.notification-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #6b7280;
}

.notification-close .material-symbols-rounded {
  font-size: 16px;
}

/* Dark theme */
.dark .notification-toast {
  background: #1f2937;
  color: #e5e7eb;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.dark .notification-title {
  color: #e5e7eb;
}

.dark .notification-message {
  color: #9ca3af;
}

.dark .notification-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #d1d5db;
}

/* ==============================
   Notification Panel (Drawer)
   ============================== */

/* Backdrop */
.notification-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 11000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.notification-panel-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* Panel */
.notification-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #ffffff;
  z-index: 11001;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.notification-panel.open {
  transform: translateX(0);
}

@media (max-width: 480px) {
  .notification-panel {
    width: 100vw;
  }
}

/* Header */
.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
}

.notification-panel-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.notification-panel-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: background 0.15s ease;
}

.notification-panel-close:hover {
  background: #e5e7eb;
  color: #111827;
}

.notification-panel-close .material-symbols-rounded {
  font-size: 20px;
}

/* List */
.notification-panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

/* Item */
.notification-panel-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  transition: background 0.15s ease;
  cursor: default;
}

.notification-panel-item:hover {
  background: #f9fafb;
}

.notification-panel-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.notification-panel-item-icon--info {
  background: #eff6ff;
  color: #3b82f6;
}

.notification-panel-item-icon--success {
  background: #f0fdf4;
  color: #22c55e;
}

.notification-panel-item-icon--warning {
  background: #fffbeb;
  color: #f59e0b;
}

.notification-panel-item-icon--error {
  background: #fef2f2;
  color: #ef4444;
}

.notification-panel-item-content {
  flex: 1;
  min-width: 0;
}

.notification-panel-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 2px;
  line-height: 1.3;
}

.notification-panel-item-message {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

.notification-panel-item-time {
  font-size: 11px;
  color: #9ca3af;
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 2px;
}

/* Empty state */
.notification-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  color: #9ca3af;
}

.notification-panel-empty .material-symbols-rounded {
  font-size: 48px;
  margin-bottom: 12px;
  color: #d1d5db;
}

.notification-panel-empty p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Bell button */
.notification-bell {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  border-radius: 50%;
  transition: background .15s ease;
}

.notification-bell:hover {
  background: rgba(0, 0, 0, 0.05);
}

#notification-bell,
button[aria-label="Поиск"] {
  border: none;
  background: transparent;
  color: #374151;
  box-shadow: none;
}

#notification-bell:hover,
button[aria-label="Поиск"]:hover {
  background: rgba(0, 0, 0, 0.05);
}

.notification-bell .material-symbols-rounded {
  font-size: 24px;
}

.notification-bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border-radius: 999px;
  padding: 0 5px;
  border: 2px solid #ffffff;
  box-sizing: border-box;
  pointer-events: none;
}

/* Floating bell variant (no .top-actions available) */
.notification-bell--floating {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border: 1px solid #f3f4f6;
}

.notification-bell--floating:hover {
  background: #f9fafb;
}

/* Dark theme */
.dark .notification-panel-backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.dark .notification-panel {
  background: #1f2937;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
}

.dark .notification-panel-header {
  border-bottom-color: #374151;
}

.dark .notification-panel-title {
  color: #f3f4f6;
}

.dark .notification-panel-close {
  background: #374151;
  color: #9ca3af;
}

.dark .notification-panel-close:hover {
  background: #4b5563;
  color: #f3f4f6;
}

.dark .notification-panel-item:hover {
  background: #111827;
}

.dark .notification-panel-item-icon--info {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.dark .notification-panel-item-icon--success {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.dark .notification-panel-item-icon--warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.dark .notification-panel-item-icon--error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.dark .notification-panel-item-title {
  color: #f3f4f6;
}

.dark .notification-panel-item-message {
  color: #9ca3af;
}

.dark .notification-panel-item-time {
  color: #6b7280;
}

.dark .notification-panel-empty {
  color: #6b7280;
}

.dark .notification-panel-empty .material-symbols-rounded {
  color: #4b5563;
}

.dark .notification-bell {
  color: #e5e7eb;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.dark .notification-bell:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dark #notification-bell,
.dark button[aria-label="Поиск"] {
  border-color: transparent;
  background: transparent;
  color: #e5e7eb;
  box-shadow: none;
}

.dark #notification-bell:hover,
.dark button[aria-label="Поиск"]:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dark .notification-bell-badge {
  border-color: #1f2937;
}

.dark .notification-bell--floating {
  background: #1f2937;
  border-color: #374151;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.dark .notification-bell--floating:hover {
  background: #111827;
}
