/* =====================================================================
   REFERRAL BLOCK POLISH — правая колонка main dashboard
   Master ТЗ §7: полный редизайн реферального блока.
   ---------------------------------------------------------------------
   Этап 6 (2026-05-24).
   Шаблон: template/panel/Modules/Globals/Referral/widget_referral.tpl

   Старая структура — большая иконка 4× + "0 рефералов" крупно +
   1 кнопка. Демотивировала, не показывала ценность программы.

   Новая структура:
     1. Header: иконка + заголовок + статус (динамический)
     2. Главная выгода: крупный % + текст
     3. Аккордеон бонусов для друга
     4. Поле реф-ссылки + кнопка копирования
     5. CTA "Пригласить друга"
   ===================================================================== */

/* ===== Outer block ===== */
.block.referral-block {
    background: var(--tbc-bg-card, #252942) !important;
    border: 1px solid var(--tbc-border-default, #2F3454) !important;
    border-radius: var(--tbc-radius-block, 8px) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
    overflow: hidden;
}

.referral-block-content {
    padding: 18px 16px;
}

/* ===== 1. Header (иконка + заголовок + статус + info) ===== */
.referral-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    position: relative;
}
.referral-header-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(245, 166, 35, 0.12);
    border: 1px solid rgba(245, 166, 35, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tbc-accent-cta, #F5A623);
    font-size: 18px;
}
.referral-header-text {
    flex: 1;
    min-width: 0; /* для truncate если длинный текст */
    padding-top: 2px;
}
.referral-title {
    color: var(--tbc-text-primary, #FFFFFF);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
    line-height: 1.2;
}
.referral-status {
    color: var(--tbc-text-secondary, #8B90B0);
    font-size: 12px;
    line-height: 1.4;
}
.referral-info-link {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    color: var(--tbc-text-muted, #5A5F7A);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border: 1px solid var(--tbc-border-default, #2F3454);
}
.referral-info-link:hover {
    color: var(--tbc-accent-cta, #F5A623);
    border-color: rgba(245, 166, 35, 0.5);
    background: rgba(245, 166, 35, 0.08);
}

/* ===== 2. Главная выгода — крупный процент ===== */
.referral-benefit {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 14px;
    background: linear-gradient(135deg,
        rgba(245, 166, 35, 0.08) 0%,
        rgba(245, 166, 35, 0.02) 100%);
    border: 1px solid rgba(245, 166, 35, 0.15);
    border-radius: 6px;
    margin-bottom: 16px;
}
.referral-benefit-percent {
    flex-shrink: 0;
    color: var(--tbc-accent-cta, #F5A623);
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
    text-shadow: 0 2px 8px rgba(245, 166, 35, 0.25);
}
.referral-benefit-text {
    color: var(--tbc-text-primary, #FFFFFF);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 500;
}

/* ===== 3. Аккордеон: бонусы для друга ===== */
.referral-bonuses {
    margin-bottom: 16px;
}
.referral-bonuses-toggle {
    width: 100%;
    background: transparent;
    border: 1px solid var(--tbc-border-default, #2F3454);
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--tbc-text-primary, #FFFFFF);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}
.referral-bonuses-toggle:hover {
    background: rgba(245, 166, 35, 0.05);
    border-color: rgba(245, 166, 35, 0.30);
}
.referral-bonuses-toggle:focus {
    outline: none;
    box-shadow: var(--tbc-shadow-focus, 0 0 0 2px rgba(245, 166, 35, 0.5));
}
.referral-bonuses-icon {
    color: var(--tbc-accent-cta, #F5A623);
    font-size: 14px;
    flex-shrink: 0;
}
.referral-bonuses-label {
    flex: 1;
}
.referral-bonuses-chevron {
    color: var(--tbc-text-muted, #5A5F7A);
    font-size: 10px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}
.referral-bonuses-toggle[aria-expanded="true"] .referral-bonuses-chevron,
.referral-bonuses-toggle-open .referral-bonuses-chevron {
    transform: rotate(180deg);
}

.referral-bonuses-list {
    margin-top: 8px;
    padding: 6px 0;
}
.referral-bonus-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    color: var(--tbc-text-secondary, #8B90B0);
    font-size: 11.5px;
    line-height: 1.4;
}
.referral-bonus-icon {
    color: var(--tbc-accent-cta, #F5A623);
    font-size: 13px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ===== 4. Реферальная ссылка с кнопкой Копировать ===== */
.referral-link-section {
    margin-bottom: 16px;
}
.referral-link-label {
    color: var(--tbc-text-muted, #5A5F7A);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.referral-link-wrap {
    display: flex;
    gap: 6px;
    align-items: stretch;
}
.referral-link-input {
    flex: 1;
    min-width: 0;
    background: var(--tbc-bg-panel-end, #1A1D2E);
    border: 1px solid var(--tbc-border-default, #2F3454);
    border-radius: 4px;
    color: var(--tbc-text-secondary, #8B90B0);
    font-size: 11px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    padding: 8px 10px;
    cursor: text;
    transition: border-color 0.2s ease;
}
.referral-link-input:hover,
.referral-link-input:focus {
    border-color: rgba(245, 166, 35, 0.4);
    outline: none;
    color: var(--tbc-text-primary, #FFFFFF);
}
.referral-link-copy {
    flex-shrink: 0;
    width: 36px;
    background: var(--tbc-bg-panel-end, #1A1D2E);
    border: 1px solid var(--tbc-border-default, #2F3454);
    border-radius: 4px;
    color: var(--tbc-accent-cta, #F5A623);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.referral-link-copy:hover {
    background: rgba(245, 166, 35, 0.10);
    border-color: var(--tbc-accent-cta, #F5A623);
}
.referral-link-copy:focus {
    outline: none;
    box-shadow: var(--tbc-shadow-focus, 0 0 0 2px rgba(245, 166, 35, 0.5));
}
.referral-link-copy.referral-link-copy-success {
    background: rgba(58, 197, 105, 0.15) !important;
    border-color: var(--tbc-accent-success, #3AC569) !important;
    color: var(--tbc-accent-success, #3AC569) !important;
}
.referral-link-hint {
    color: var(--tbc-text-muted, #5A5F7A);
    font-size: 10.5px;
    margin-top: 6px;
    line-height: 1.4;
}

/* ===== 5. CTA-кнопка "Пригласить друга" ===== */
.referral-cta {
    width: 100%;
    background: linear-gradient(180deg, #F5A623 0%, #D68813 100%) !important;
    border: 1px solid #F4C66A !important;
    color: #1A1D2E !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
    padding: 11px 18px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: filter 0.22s ease, box-shadow 0.22s ease, transform 0.18s ease;
    box-shadow:
        0 2px 8px rgba(214, 136, 19, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    position: relative;
    overflow: hidden;
}
.referral-cta i {
    font-size: 13px;
}
.referral-cta:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow:
        0 4px 16px rgba(245, 166, 35, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.referral-cta:focus {
    outline: none;
    box-shadow:
        0 4px 16px rgba(245, 166, 35, 0.55),
        0 0 0 2px rgba(245, 166, 35, 0.4);
}
/* Shine как у "+ Создать игровой аккаунт" (для главной CTA уместно) */
.referral-cta::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,
        transparent 30%,
        rgba(255, 255, 255, 0.28) 50%,
        transparent 70%);
    transform: translateX(-110%);
    transition: transform 0.6s ease;
    pointer-events: none;
}
.referral-cta:hover::after {
    transform: translateX(110%);
}

@media (prefers-reduced-motion: reduce) {
    .referral-bonuses-toggle,
    .referral-bonuses-chevron,
    .referral-link-copy,
    .referral-cta,
    .referral-cta::after {
        transition: none !important;
    }
}
