/* Сетка для карточек */
.drafts-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
   gap: 25px;
   padding: 20px 0;
}

/* Сама карточка */
.draft-card {
   background: #1a1c23;
   border: 1px solid #2d303e;
   border-radius: 16px;
   overflow: hidden;
   transition: all 0.3s ease;
   display: flex;
   flex-direction: column;
   height: 100%;
}

.draft-card:hover {
   transform: translateY(-8px);
   border-color: #3498db;
   box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Изображение в карточке */
.card-preview {
   width: 100%;
   height: 180px;
   background: #111;
   position: relative;
   overflow: hidden;
}

.card-preview img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   opacity: 0.7;
}

.card-status-tag {
   position: absolute;
   top: 15px;
   right: 15px;
   background: rgba(0, 0, 0, 0.7);
   backdrop-filter: blur(5px);
   padding: 5px 12px;
   border-radius: 20px;
   font-size: 0.75rem;
   font-weight: bold;
   color: #fff;
   border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Контентная часть */
.card-content {
   padding: 20px;
   flex-grow: 1;
}

.card-title {
   font-size: 1.25rem;
   font-weight: 700;
   color: #fff;
   margin-bottom: 10px;
   display: block;
   text-decoration: none;
}

.card-meta {
   font-size: 0.85rem;
   color: #888;
   display: flex;
   flex-wrap: wrap;
   gap: 10px;
}

/* Кнопки действий */
.card-footer {
   padding: 15px 20px;
   background: rgba(255, 255, 255, 0.02);
   border-top: 1px solid #2d303e;
   display: flex;
   gap: 10px;
}

.btn-rich {
   flex: 1;
   padding: 10px;
   border-radius: 8px;
   text-align: center;
   text-decoration: none;
   font-size: 0.9rem;
   font-weight: 600;
   transition: 0.2s;
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 8px;
}

.btn-rich-edit {
   background: #3498db;
   color: #fff;
}

.btn-rich-edit:hover {
   background: #2980b9;
}

.btn-rich-del {
   background: rgba(231, 76, 60, 0.1);
   color: #e74c3c;
   border: 1px solid rgba(231, 76, 60, 0.2);
}

.btn-rich-del:hover {
   background: #e74c3c;
   color: #fff;
}

.btn-rich-submit {
   background: #2ecc71;
   color: #fff;
   width: 100%;
   margin-bottom: 10px;
}

/* Аватар профиля с анимированной обводкой */
.profile-avatar {
   width: 70px;
   height: 70px;
   position: relative;
   aspect-ratio: 1 / 1;
}

/* Изображение аватара */
.profile-avatar img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   border-radius: 50%;
   transition: transform 0.2s;
   position: relative;
   z-index: 2;
}

.profile-avatar img:hover {
   transform: scale(1.05);
}

.profile-avatar img,
.profile-avatar .rounded-circle {
   width: 100%;
   height: 100%;
   object-fit: cover;
   /* для изображений, чтобы не искажались */
}

/* Для заглушки (буквы) дополнительно центрируем текст и убираем лишние фоны */
.profile-avatar .rounded-circle {
   display: flex;
   align-items: center;
   justify-content: center;
   background: linear-gradient(45deg, #3498db, #2ecc71);
   color: white;
   font-size: 1.8rem;
   /* базовый размер, будет масштабироваться пропорционально */
}

/* Заглушка (буква) если нет аватара */
.profile-avatar .rounded-circle {
   width: 100%;
   height: 100%;
   display: flex;
   align-items: center;
   justify-content: center;
   background: linear-gradient(45deg, #3498db, #2ecc71);
   border-radius: 50%;
   color: white;
   font-size: 1.8rem;
   position: relative;
   z-index: 2;
}

/* Анимированная градиентная обводка (работает и для img, и для заглушки) */
.profile-avatar::after {
   content: '';
   position: absolute;
   top: -3px;
   left: -3px;
   right: -3px;
   bottom: -3px;
   border-radius: 50%;
   background: linear-gradient(45deg, #1b002b, #9b59b6, #6a01f3, #470a70);
   background-size: 300% 300%;
   animation: gradient-shift 4s ease infinite;
   z-index: 1;
   pointer-events: none;
}

@keyframes gradient-shift {
   0% {
      background-position: 0% 50%;
   }

   50% {
      background-position: 100% 50%;
   }

   100% {
      background-position: 0% 50%;
   }
}

/* Кнопка редактирования аватара */
.profile-avatar .btn-dark {
   background: #2a1f3a;
   border: 1px solid #5a4b7a;
   color: #b0a0c0;
   display: flex;
   align-items: center;
   justify-content: center;
   z-index: 3;
   position: absolute;
   bottom: 0;
   right: 0;
   width: 28px;
   height: 28px;
   border-radius: 50%;
   padding: 0;
}

.profile-avatar .btn-dark:hover {
   background: #3a2a5a;
   border-color: #8b6fc7;
   color: #fff;
}

/* Модальное окно */
.modal-content.bg-dark {
   background-color: #1e1e2d !important;
   border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
   border-bottom-color: #3a2a5a;
}

.modal-footer {
   border-top-color: #3a2a5a;
}

.modal .form-control {
   background-color: #2d2d3f !important;
   border-color: #4a4a60 !important;
   color: #fff;
}

.modal .form-control:focus {
   border-color: #6e45e2 !important;
   box-shadow: 0 0 0 0.2rem rgba(110, 69, 226, 0.25);
}

/* ========== АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ ========== */
@media (max-width: 768px) {
   .profile-avatar {
      width: 60px;
      height: 60px;
   }

   .profile-avatar .rounded-circle {
      font-size: 1.5rem;
   }

   .profile-avatar .btn-dark {
      width: 22px;
      height: 22px;
      bottom: -2px;
      right: -2px;
   }

   .profile-avatar::after {
      top: -2.5px;
      left: -2.5px;
      right: -2.5px;
      bottom: -2.5px;
   }

   .d-flex.gap-2.flex-wrap.justify-content-end {
      width: 100%;
      justify-content: center !important;
      gap: 8px !important;
   }

   .d-flex.gap-2.flex-wrap.justify-content-end .btn {
      flex: 1 1 auto;
      min-width: 150px;
      margin: 0;
      font-size: 0.9rem;
   }

   .col-6 {
      flex: 0 0 50%;
      max-width: 50%;
   }

   .table-token-header th:nth-child(2),
   .table-token-header td:nth-child(2) {
      display: none;
   }

   .btn-token-action {
      width: 36px !important;
      height: 36px !important;
   }

   .btn-token-action i {
      font-size: 1.1rem !important;
   }
}

@media (max-width: 576px) {
   .d-flex.gap-2.flex-wrap.justify-content-end .btn {
      flex: 1 1 100%;
      min-width: unset;
   }

   .col-6 {
      flex: 0 0 100%;
      max-width: 100%;
   }

   .table-token-header th:nth-child(3),
   .table-token-header td:nth-child(3) {
      display: none;
   }

   .table-token-header th:nth-child(4),
   .table-token-header td:nth-child(4) {
      width: auto !important;
   }
}

@media (max-width: 425px) {
   .profile-avatar {
      width: 55px;
      height: 55px;
   }

   .profile-avatar .rounded-circle {
      font-size: 1.3rem;
   }

   .profile-avatar .btn-dark {
      width: 20px;
      height: 20px;
   }

   .profile-avatar::after {
      top: -2px;
      left: -2px;
      right: -2px;
      bottom: -2px;
   }
}

@media (max-width: 375px) {
   .profile-avatar {
      width: 50px;
      height: 50px;
   }

   .profile-avatar .btn-dark {
      width: 18px;
      height: 18px;
   }

   .profile-avatar::after {
      top: -2px;
      left: -2px;
      right: -2px;
      bottom: -2px;
   }
}

@media (max-width: 320px) {
   .profile-avatar {
      width: 45px;
      height: 45px;
   }

   .profile-avatar .btn-dark {
      width: 16px;
      height: 16px;
   }

   .profile-avatar::after {
      top: -1.5px;
      left: -1.5px;
      right: -1.5px;
      bottom: я-1.5px;
   }
}

.sphere-color-overlay {
   mix-blend-mode: overlay;
   /* Прозрачность можно регулировать здесь, если убрать её из inline-стиля */
   /* opacity: 0.6; */
}