/*
 * Lingo UI Components
 * Общие фирменные компоненты платформы.
 *
 * Bootstrap используется только для сетки и адаптивности.
 * Внешний вид компонентов задаётся здесь.
 */

/* =========================================================
   CARDS
   ========================================================= */

.lingo-card {
    position: relative;

    background: var(--lingo-surface);
    border: 1px solid var(--lingo-border);
    border-radius: var(--lingo-radius-lg);
    box-shadow: var(--lingo-shadow-sm);
}

.lingo-card--padded {
    padding: 20px 22px;
}

.lingo-card--interactive {
    transition:
        transform var(--lingo-transition-normal),
        box-shadow var(--lingo-transition-normal),
        border-color var(--lingo-transition-normal);
}

.lingo-card--interactive:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.22);
    box-shadow: var(--lingo-shadow-md);
}

.lingo-glass-card {
    position: relative;

    background: rgba(255, 255, 255, 0.84);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--lingo-radius-xl);
    box-shadow: var(--lingo-shadow-md);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* =========================================================
   BUTTONS
   ========================================================= */

.lingo-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 44px;
    padding: 10px 20px;

    border: 0;
    border-radius: var(--lingo-radius-pill);

    font-family: var(--lingo-font-heading);
    font-size: 15px;
    font-weight: 800;
    line-height: 1;

    text-decoration: none;
    cursor: pointer;

    transition:
        transform var(--lingo-transition-fast),
        box-shadow var(--lingo-transition-fast),
        background-color var(--lingo-transition-fast),
        color var(--lingo-transition-fast);
}

.lingo-button:hover {
    transform: translateY(-2px);
}

.lingo-button:active {
    transform: translateY(0);
}

.lingo-button--primary {
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--lingo-purple),
            var(--lingo-purple-dark)
        );
    box-shadow: 0 5px 18px rgba(139, 92, 246, 0.35);
}

.lingo-button--primary:hover {
    color: #ffffff;
    box-shadow: 0 8px 26px rgba(139, 92, 246, 0.48);
}

.lingo-button--success {
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--lingo-green),
            var(--lingo-green-dark)
        );
    box-shadow: 0 5px 18px rgba(61, 214, 140, 0.35);
}

.lingo-button--secondary {
    color: var(--lingo-purple);
    background: var(--lingo-purple-light);
}

.lingo-button--secondary:hover {
    color: #ffffff;
    background: var(--lingo-purple);
}

.lingo-button--danger {
    color: #ffffff;
    background: var(--lingo-red);
}

.lingo-button--full {
    width: 100%;
}

.lingo-button--icon {
    width: 44px;
    min-width: 44px;
    padding: 0;
}

.lingo-button:disabled,
.lingo-button[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =========================================================
   TITLES
   ========================================================= */

.lingo-page-title {
    margin: 0;

    font-family: var(--lingo-font-heading);
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    line-height: 1.05;

    color: var(--lingo-purple);
}

.lingo-section-title {
    display: flex;
    align-items: center;
    gap: 8px;

    margin: 0 0 14px;

    font-family: var(--lingo-font-heading);
    font-size: 18px;
    font-weight: 800;

    color: var(--lingo-text);
}

.lingo-section-subtitle {
    margin: -8px 0 16px;

    color: var(--lingo-text-secondary);
    font-size: 13px;
    font-weight: 600;
}

/* =========================================================
   CHIPS AND BADGES
   ========================================================= */

.lingo-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    min-height: 30px;
    padding: 5px 12px;

    border-radius: var(--lingo-radius-pill);

    font-family: var(--lingo-font-heading);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.lingo-chip--purple {
    color: var(--lingo-purple);
    background: var(--lingo-purple-light);
}

.lingo-chip--orange {
    color: var(--lingo-orange);
    background: #fff7ed;
}

.lingo-chip--green {
    color: var(--lingo-green-dark);
    background: rgba(61, 214, 140, 0.12);
}

.lingo-chip--blue {
    color: var(--lingo-blue-dark);
    background: #eff6ff;
}

.lingo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 24px;
    height: 24px;
    padding: 0 7px;

    border-radius: var(--lingo-radius-pill);

    font-size: 11px;
    font-weight: 800;
}

.lingo-badge--level {
    color: #ffffff;
    background: var(--lingo-purple);
}

.lingo-badge--success {
    color: #ffffff;
    background: var(--lingo-green-dark);
}

.lingo-badge--warning {
    color: var(--lingo-text);
    background: var(--lingo-yellow);
}

/* =========================================================
   AVATARS
   ========================================================= */

.lingo-avatar {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border-radius: 50%;
    background:
        linear-gradient(
            135deg,
            var(--lingo-blue),
            var(--lingo-purple)
        );
}

.lingo-avatar--sm {
    width: 34px;
    height: 34px;
}

.lingo-avatar--md {
    width: 52px;
    height: 52px;
}

.lingo-avatar--lg {
    width: 80px;
    height: 80px;
}

.lingo-avatar--xl {
    width: 110px;
    height: 110px;
}

.lingo-avatar__status {
    position: absolute;
    right: 3px;
    bottom: 3px;

    width: 14px;
    height: 14px;

    border: 3px solid #ffffff;
    border-radius: 50%;
}

.lingo-avatar__status--online {
    background: var(--lingo-green-dark);
}

.lingo-avatar__status--offline {
    background: #d1d5db;
}

/* =========================================================
   PROGRESS
   ========================================================= */

.lingo-progress {
    width: 100%;
}

.lingo-progress__track {
    width: 100%;
    height: 10px;

    overflow: hidden;

    border-radius: var(--lingo-radius-pill);
    background: #e5e7eb;
}

.lingo-progress__fill {
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--lingo-purple),
            var(--lingo-pink)
        );

    transition: width 700ms cubic-bezier(0.4, 0, 0.2, 1);
}

.lingo-progress__fill--green {
    background:
        linear-gradient(
            90deg,
            var(--lingo-green),
            var(--lingo-green-dark)
        );
}

.lingo-progress__label {
    display: flex;
    justify-content: space-between;
    gap: 10px;

    margin-top: 4px;

    color: var(--lingo-text-muted);
    font-size: 11px;
    font-weight: 700;
}

/* =========================================================
   STAT CARDS
   ========================================================= */

.lingo-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;

    height: 100%;
    padding: 16px;

    background: var(--lingo-surface);
    border: 1px solid var(--lingo-border);
    border-radius: var(--lingo-radius-md);
    box-shadow: var(--lingo-shadow-sm);

    transition:
        transform var(--lingo-transition-normal),
        box-shadow var(--lingo-transition-normal);
}

.lingo-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--lingo-shadow-md);
}

.lingo-stat-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;
    flex: 0 0 46px;

    border-radius: 14px;

    font-size: 24px;
}

.lingo-stat-card__value {
    font-family: var(--lingo-font-heading);
    font-size: 24px;
    font-weight: 800;
    line-height: 1;

    color: var(--lingo-text);
}

.lingo-stat-card__label {
    margin-top: 3px;

    color: var(--lingo-text-muted);
    font-size: 12px;
    font-weight: 700;
}

/* =========================================================
   FORMS
   ========================================================= */

.lingo-form-group {
    margin-bottom: 16px;
}

.lingo-label {
    display: block;

    margin-bottom: 6px;

    color: var(--lingo-text);
    font-size: 13px;
    font-weight: 800;
}

.lingo-input,
.lingo-select,
.lingo-textarea {
    display: block;

    width: 100%;
    min-height: 46px;
    padding: 10px 14px;

    border: 1px solid rgba(139, 92, 246, 0.16);
    border-radius: var(--lingo-radius-md);

    color: var(--lingo-text);
    background: #ffffff;

    font-family: var(--lingo-font-body);
    font-size: 14px;
    font-weight: 600;

    transition:
        border-color var(--lingo-transition-fast),
        box-shadow var(--lingo-transition-fast);
}

.lingo-textarea {
    min-height: 120px;
    resize: vertical;
}

.lingo-input:focus,
.lingo-select:focus,
.lingo-textarea:focus {
    border-color: var(--lingo-purple);
    outline: none;
    box-shadow: var(--lingo-shadow-focus);
}

.lingo-input::placeholder,
.lingo-textarea::placeholder {
    color: var(--lingo-text-muted);
}

/* =========================================================
   EMPTY STATES
   ========================================================= */

.lingo-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;

    min-height: 140px;
    padding: 24px;

    border: 2px dashed rgba(139, 92, 246, 0.28);
    border-radius: var(--lingo-radius-lg);

    color: var(--lingo-text-secondary);
    background: rgba(237, 233, 254, 0.35);

    text-align: center;
}

.lingo-empty-state__icon {
    font-size: 36px;
}

.lingo-empty-state__title {
    font-family: var(--lingo-font-heading);
    font-size: 17px;
    font-weight: 800;
}

.lingo-empty-state__text {
    margin-top: 4px;

    color: var(--lingo-text-muted);
    font-size: 13px;
    font-weight: 600;
}

/* =========================================================
   TABS
   ========================================================= */

.lingo-tabs {
    display: flex;
    gap: 4px;

    overflow-x: auto;

    border-bottom: 2px solid #e5e7eb;

    scrollbar-width: none;
}

.lingo-tabs::-webkit-scrollbar {
    display: none;
}

.lingo-tab {
    flex: 0 0 auto;

    padding: 10px 18px;

    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 12px 12px 0 0;

    color: var(--lingo-text-muted);
    background: transparent;

    font-family: var(--lingo-font-heading);
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;
}

.lingo-tab:hover {
    color: var(--lingo-purple);
    background: var(--lingo-purple-light);
}

.lingo-tab.active {
    color: var(--lingo-purple);
    border-bottom-color: var(--lingo-purple);
    background: var(--lingo-purple-light);
}

/* =========================================================
   TOAST
   Не используем класс .toast, потому что он есть у Bootstrap.
   ========================================================= */

.lingo-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1090;

    max-width: min(380px, calc(100vw - 40px));
    padding: 13px 20px;

    border-radius: var(--lingo-radius-pill);

    color: #ffffff;
    background: rgba(43, 34, 96, 0.94);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);

    font-family: var(--lingo-font-heading);
    font-size: 14px;
    font-weight: 700;

    animation: lingoToastIn 220ms ease both;
}

@keyframes lingoToastIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   ANIMATIONS
   ========================================================= */

.lingo-animate-in {
    animation: lingoCardIn 400ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes lingoCardIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lingo-float {
    animation: lingoFloat 3s ease-in-out infinite;
}

@keyframes lingoFloat {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 575.98px) {
    .lingo-card--padded {
        padding: 16px;
    }

    .lingo-button {
        min-height: 42px;
        padding-right: 16px;
        padding-left: 16px;
    }

    .lingo-page-title {
        font-size: 28px;
    }

    .lingo-empty-state {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lingo-card--interactive,
    .lingo-button,
    .lingo-stat-card,
    .lingo-progress__fill,
    .lingo-animate-in,
    .lingo-float {
        animation: none;
        transition: none;
    }
}