/* css/trig.css - стили раздела "Тригонометрия" на CSS-переменных темы */

.trig-hero {
    padding: 30px 16px 4px;
}

.trig-hero-inner {
    max-width: 900px;
    margin: 0 auto;
}

.trig-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 20px;
    background: var(--bg-surface);
    color: var(--accent-chart);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.trig-crumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-decoration: none;
    margin-bottom: 12px;
    transition: color 0.2s;
}

.trig-crumb:hover {
    color: var(--text-primary);
}

.trig-hero h1 {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
}

.trig-lead {
    margin-top: 10px;
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 720px;
}

.trig-panel {
    background: var(--bg-base);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 22px;
}

.trig-section {
    padding: 8px 16px 36px;
}

.trig-section .trig-panel {
    max-width: 900px;
    margin: 0 auto;
}

.trig-section h2 {
    max-width: 900px;
    margin: 0 auto 18px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.trig-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

.trig-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-base);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.trig-card:hover {
    border-color: var(--border-focus);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.trig-card img {
    width: 100%;
    border-radius: 10px;
    background: var(--bg-canvas);
}

.trig-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

.trig-card .trig-card-arrow {
    margin-top: auto;
    color: var(--accent-chart);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.trig-card .trig-card-arrow i {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.trig-card-badge {
    position: absolute;
    top: 7px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--accent-chart);
    color: #fff;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.trig-card-badge i {
    font-size: 0.8rem;
}

.trig-card:hover .trig-card-arrow i {
    transform: translateX(3px);
}

.trig-visual {
    text-align: center;
    padding: 24px 16px 8px;
}

.trig-visual img {
    max-width: 100%;
    max-height: 520px;
    border-radius: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.trig-note {
    margin-top: 22px;
    padding: 12px 14px;
    background: var(--bg-surface);
    border-left: 3px solid var(--accent-chart);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ---- Тренажёр: панель задания ---- */

.ballswrap {
    display: flex;
    justify-content: center;
    padding: 14px 16px 0;
}

.top_line.top_line_p {
    width: 100%;
    max-width: 860px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    background: var(--bg-base);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.top_line .tr_line {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.top_line .tr_line p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.top_line .sumballs {
    font-weight: 500;
    color: var(--text-secondary);
}

.angle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.set_ang {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    position: relative;
    padding: 0 4px 9px;
    font-weight: 700;
    color: var(--text-primary);
}

.set_ang:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    height: 2px;
    border-radius: 1px;
    background: var(--text-primary);
}

.set_ang.ang_line {
    padding: 0;
}

.set_ang.ang_line:after {
    display: none;
}

.set_ang .okr_step_kol,
.set_ang .gradus,
.angle .okr_step {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.set_ang .chislo_pi,
.set_ang .simbol {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    font-style: normal;
}

.angle .okr_step {
    padding-top: 4px;
}

.set_ang1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.top_line .tr_line .set_ang,
.top_line .tr_line .set_ang1 {
    margin-left: 6px;
}

.top_line .btn_cost,
.ballswrap .btn_cost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.top_line .btn_cost:active,
.ballswrap .btn_cost:active {
    transform: scale(0.97);
}

#reload {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

#reload:hover {
    background: var(--btn-primary-hover);
}

#reset_balls {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-color: var(--border-light);
}

#reset_balls:hover {
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.current_ball {
    min-width: 30px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--btn-primary-bg);
}

/* ---- Тренажёр: canvas ---- */

.circule_wrap {
    display: flex;
    justify-content: center;
    padding: 20px 16px;
}

.circule_wrap canvas {
    width: 300px;
    height: 300px;
    touch-action: manipulation;
}

/* ---- Объяснение / пример ---- */

.example_wrap {
    padding: 20px 0 44px;
}

.example_wrap .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
}

.example_wrap .title-arrow {
    margin-bottom: 18px;
}

.example_wrap .title-arrow h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.example_wrap .title-arrow p {
    color: var(--text-secondary);
}

.text_left {
    color: var(--text-secondary);
    line-height: 1.6;
}

.text_left p {
    margin-bottom: 8px;
}

.text_left > ul {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
}

.text_left > ul > li {
    position: relative;
    padding: 18px 18px 18px 44px;
    background: var(--bg-base);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin-bottom: 14px;
}

.text_left > ul > li:before {
    content: "";
    position: absolute;
    top: 18px;
    left: 16px;
    width: 18px;
    height: 18px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-chart);
    border-radius: 50%;
}

.text_left .list_ok {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.02rem;
    margin-bottom: 8px;
}

.text_left ul.list_ok_text {
    list-style: disc;
    padding-left: 20px;
    margin: 4px 0 0;
    color: var(--text-secondary);
}

.text_left ul.list_ok_text li {
    margin: 5px 0;
}

.text_left .circule_wrap {
    padding: 16px 0 6px;
}

.text_note {
    font-size: 0.92rem;
    font-style: italic;
    color: var(--text-tertiary);
    background: var(--bg-surface);
    border-left: 3px solid var(--border-focus);
    border-radius: 0 8px 8px 0;
    padding: 12px 14px;
    margin-top: 12px;
}

@media (max-width: 700px) {
    .trig-hero h1 {
        font-size: 1.45rem;
    }

    .top_line.top_line_p {
        flex-direction: column;
        align-items: flex-start;
    }

    .trig-cards {
        grid-template-columns: 1fr;
    }
}

/* ---- Двухколоночная раскладка тренажёра (как в тренажёрах сечений) ---- */

.trig-trainer {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 24px auto 40px;
    padding: 0 24px;
    align-items: flex-start;
}

.trig-task-sidebar {
    flex: 0 0 320px;
    max-width: 320px;
    position: sticky;
    top: 90px;
}

.trig-task-sidebar .trig-hero {
    padding: 0;
    margin-bottom: 18px;
}

.trig-task-sidebar .trig-hero-inner {
    max-width: none;
    margin: 0;
}

.trig-task-sidebar .trig-hero .trig-crumb {
    margin-bottom: 10px;
}

.trig-task-sidebar .trig-hero .trig-badge {
    margin-bottom: 12px;
}

.trig-task-sidebar .trig-hero h1 {
    font-size: 1.3rem;
}

.trig-task-sidebar .trig-hero .trig-lead {
    font-size: 0.92rem;
    margin-top: 6px;
}

.trig-task-sidebar .top_line.top_line_p {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    max-width: none;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.trig-task-sidebar .top_line .tr_line {
    gap: 10px;
}

.trig-task-sidebar .top_line .tr_line p {
    font-size: 1rem;
    line-height: 1.45;
}

.trig-task-sidebar .top_line .btn_cost {
    width: 100%;
    padding: 11px 18px;
    font-size: 0.92rem;
}

.trig-task-sidebar .sumballs {
    font-size: 0.95rem;
}

.trig-task-sidebar .current_ball {
    min-width: 44px;
    font-size: 1.5rem;
}

.trig-task-sidebar .angle .set_ang,
.trig-task-sidebar .angle .okr_step,
.trig-task-sidebar .set_ang .okr_step_kol,
.trig-task-sidebar .set_ang .gradus,
.trig-task-sidebar .set_ang1 {
    font-size: 1.6rem;
}

.trig-task-sidebar .set_ang .chislo_pi,
.trig-task-sidebar .set_ang .simbol {
    font-size: 1.25rem;
}

.trig-trainer-canvas {
    flex: 1;
    min-width: 0;
}

.trig-trainer-canvas .circule_wrap {
    background: var(--bg-base);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 26px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.06);
}

@media (max-width: 992px) {
    .trig-trainer {
        flex-direction: column;
        gap: 20px;
    }

    .trig-task-sidebar {
        flex: none;
        width: 100%;
        max-width: none;
        position: static;
    }

    .trig-task-sidebar .top_line .btn_cost {
        width: auto;
        min-width: 180px;
    }
}

/* ---- Квадратные кнопки в сайдбаре тренажёра ---- */

.trig-task-sidebar .top_line .tr_line {
    justify-content: space-between;
    width: 100%;
}

.trig-task-sidebar .top_line .btn_cost {
    flex: none;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    font-size: 1rem;
}

/* ---- Хлебные крошки на главной странице раздела ---- */
.trig-page > .breadcrumbs {
    max-width: 900px;
    margin: 0 auto 12px;
    padding: 24px 16px 0;
}
