/**
 * Account v2.0 - Base Styles
 * @description Базовые стили, reset, типографика
 * @version 2.0.0
 * @date 2026-02-05
 */

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-base); }
h6 { font-size: var(--font-size-sm); }

p {
    margin: 0 0 var(--space-md);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

/* ═══════════════════════════════════════
   LISTS
   ═══════════════════════════════════════ */
ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ═══════════════════════════════════════
   IMAGES
   ═══════════════════════════════════════ */
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* ═══════════════════════════════════════
   BUTTONS RESET
   ═══════════════════════════════════════ */
button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
}

button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════
   ACCOUNT PAGE SHELL
   ═══════════════════════════════════════ */
.account-page {
    min-height: 100vh;
    min-height: 100dvh;
}

.account-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ═══════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════ */
.account-main {
    flex: 1;
    padding: var(--space-lg);
   /* margin-left: var(--sidebar-width); */
    min-height: 100vh;
    min-height: 100dvh;
}

@media (max-width: 768px) {
    .account-main {
        margin-left: 0;
        padding: var(--space-md);
        padding-top: calc(var(--header-height) + var(--space-md));
        padding-bottom: calc(var(--bottom-nav-height) + var(--space-md));
    }
}

/* ═══════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
}

.section-subtitle {
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

/* ═══════════════════════════════════════
   FALLBACK BANNER
   ═══════════════════════════════════════ */
.fallback-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-info);
    color: white;
    font-size: var(--font-size-sm);
    z-index: var(--z-toast);
}

.fallback-banner__content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.fallback-banner__text {
    flex-shrink: 0;
}

.fallback-banner__link {
    color: white;
    text-decoration: underline;
    font-weight: var(--font-weight-medium);
}

.fallback-banner__link:hover {
    color: rgba(255, 255, 255, 0.9);
}

.fallback-banner__close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: var(--space-xs);
    margin-left: var(--space-sm);
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.fallback-banner__close:hover {
    opacity: 1;
}

/* На мобильных учесть bottom nav */
@media (max-width: 768px) {
    .fallback-banner {
        bottom: var(--bottom-nav-height);
    }
}

/* ═══════════════════════════════════════
   TRY NEW VERSION BANNER (для старого ЛК)
   ═══════════════════════════════════════ */
.try-new-version-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    /* (d) gold gradient → dark text for contrast */
    color: var(--color-black);
    text-align: center;
    margin-bottom: var(--space-lg);
    border-radius: var(--border-radius);
}

.try-new-version-banner a {
    color: var(--color-black);
    background: rgba(0, 0, 0, 0.12);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius-sm);
    font-weight: var(--font-weight-medium);
    transition: background var(--transition-fast);
}

.try-new-version-banner a:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ═══════════════════════════════════════
   ACCOUNT SECTIONS
   ═══════════════════════════════════════ */
.account-section {
  outline: none;
  animation: fadeIn var(--transition-normal);
}

.account-section[hidden] {
  display: none !important;
}

.account-section__title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

.account-section__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-muted);
  font-size: var(--font-size-lg);
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .account-section {
    animation: none;
  }
}

/* ═══════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════ */
.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-success {
    color: var(--color-success);
}

.text-error {
    color: var(--color-error);
}

.text-warning {
    color: var(--color-warning);
}

/* ═══════════════════════════════════════
   SKELETON LOADERS
   ═══════════════════════════════════════ */

/* Базовый skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--border-radius);
}

@keyframes skeleton-pulse {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
        background: var(--bg-tertiary);
    }
}

/* Текстовые skeleton */
.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text--sm {
    width: 60%;
}

.skeleton-text--md {
    width: 80%;
}

.skeleton-text--lg {
    width: 100%;
}

.skeleton-text--title {
    height: 1.5em;
    width: 50%;
    margin-bottom: 1em;
}

.skeleton-text--subtitle {
    height: 1.25em;
    width: 40%;
}

/* Аватар skeleton */
.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-avatar--sm {
    width: 32px;
    height: 32px;
}

.skeleton-avatar--md {
    width: 48px;
    height: 48px;
}

.skeleton-avatar--lg {
    width: 80px;
    height: 80px;
}

.skeleton-avatar--xl {
    width: 120px;
    height: 120px;
}

/* Карточка портфолио skeleton */
.skeleton-card {
    aspect-ratio: 1;
    border-radius: var(--border-radius-lg);
}

/* Поле формы skeleton */
.skeleton-input {
    height: var(--input-height, 48px);
    border-radius: var(--border-radius);
    width: 100%;
}

/* Кнопка skeleton */
.skeleton-button {
    height: var(--button-height, 48px);
    width: 120px;
    border-radius: var(--border-radius);
}

.skeleton-button--full {
    width: 100%;
}

/* Изображение skeleton */
.skeleton-image {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--border-radius-lg);
}

.skeleton-image--square {
    aspect-ratio: 1;
}

.skeleton-image--portrait {
    aspect-ratio: 3/4;
}

/* Группа элементов */
.skeleton-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Строка с аватаром и текстом */
.skeleton-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.skeleton-row__content {
    flex: 1;
    min-width: 0;
}

/* Линия-разделитель skeleton */
.skeleton-divider {
    height: 1px;
    width: 100%;
    margin: var(--space-md) 0;
}

/* Badge skeleton */
.skeleton-badge {
    height: 24px;
    width: 60px;
    border-radius: 12px;
}

/* Chip skeleton */
.skeleton-chip {
    height: 32px;
    width: 80px;
    border-radius: 16px;
    display: inline-block;
}

/* Icon skeleton */
.skeleton-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--border-radius);
}

.skeleton-icon--sm {
    width: 16px;
    height: 16px;
}

.skeleton-icon--lg {
    width: 32px;
    height: 32px;
}

/* ═══════════════════════════════════════
   SKELETON LAYOUTS (готовые шаблоны)
   ═══════════════════════════════════════ */

/* Профиль skeleton */
.skeleton-profile {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.skeleton-profile__header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
}

.skeleton-profile__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.skeleton-profile__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Портфолио grid skeleton */
.skeleton-portfolio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

@media (max-width: 768px) {
    .skeleton-portfolio {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Список skeleton */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Карточка skeleton */
.skeleton-card-block {
    padding: var(--space-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    background: var(--bg-secondary);
}

.skeleton-card-block__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.skeleton-card-block__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Таблица skeleton */
.skeleton-table {
    width: 100%;
}

.skeleton-table__row {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-color);
}

.skeleton-table__cell {
    flex: 1;
}

.skeleton-table__cell--narrow {
    flex: 0 0 100px;
}
