﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
    margin-bottom: 60px;
    padding-top: 72px;
}


h1 {
    font-size: 150%;
}

/* Dashboard cards */

.dashboard-card-link {
    color: inherit;
}

.dashboard-card {
    border-radius: 0.75rem;
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
}

    .dashboard-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 0.7rem 1.5rem rgba(15, 23, 42, 0.12);
        border-color: rgba(37, 99, 235, 0.4);
    }

.dashboard-icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: rgba(37, 99, 235, 0.08);
}

/* При желании можно отдельно стилизовать разные типы: */
.helix-icon {
    background: rgba(59, 130, 246, 0.12);
}

.cylinder-icon {
    background: rgba(168, 85, 247, 0.12);
}

.frame-icon {
    background: rgba(16, 185, 129, 0.12);
}

.ribbon-icon {
    background: rgba(245, 158, 11, 0.12);
}

/* Улучшения для badge на светлых фонах (если есть Bootstrap 5.3+) */
.bg-primary-subtle {
    background-color: rgba(37, 99, 235, 0.08) !important;
}

.text-primary-emphasis {
    color: #1d4ed8 !important;
}

.border-primary-subtle {
    border-color: rgba(37, 99, 235, 0.2) !important;
}

/* === Double Cylinder Diagram === */

.dc-diagram-card {
    border-radius: 0.75rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.dc-diagram-container {
    position: relative;
    min-height: 260px;
}

.dc-view {
    display: none;
}

    .dc-view.dc-view-active {
        display: block;
    }

/* hover по поверхностям */
.dc-outer-shape,
.dc-inner-shape {
    transition: stroke-width 0.15s ease, stroke 0.15s ease;
}

    .dc-outer-shape:hover {
        stroke-width: 4px;
        stroke: #ef4444; /* красный */
    }

    .dc-inner-shape:hover {
        stroke-width: 4px;
        stroke: #3b82f6; /* синий */
    }

/* анимация тока по окружности / эллипсу */
.dc-outer-current,
.dc-inner-current {
    stroke-linecap: round;
    stroke-dasharray: 400;
    animation: dc-current-flow 4s linear infinite;
}

.dc-inner-current {
    animation-direction: reverse;
}

@keyframes dc-current-flow {
    from {
        stroke-dashoffset: 0;
    }

    to {
        stroke-dashoffset: -400;
    }
}

/* чуть сгладим подписи */
.dc-label-outer,
.dc-label-inner {
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

/* === Rectangular Frame Diagram === */

.rf-diagram-card {
    border-radius: 0.75rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.rf-diagram-container {
    position: relative;
    min-height: 220px;
}

.rf-view {
    display: none;
}

    .rf-view.rf-view-active {
        display: block;
    }

.rf-frame-shape {
    transition: stroke-width 0.15s ease, stroke 0.15s ease;
}

    .rf-frame-shape:hover {
        stroke-width: 4px;
        stroke: #ef4444; /* красноватый при наведении */
    }

/* Анимация тока по контуру: используем ту же анимацию, что и для цилиндра */
.rf-current {
    stroke-linecap: round;
    stroke-dasharray: 400;
    animation: dc-current-flow 4s linear infinite;
}

/* Если в стилях для DoubleCylinder уже есть это @keyframes – второй раз не нужно добавлять */
@keyframes dc-current-flow {
    from {
        stroke-dashoffset: 0;
    }

    to {
        stroke-dashoffset: -400;
    }
}

/* === Rectangular Ribbon Diagram === */

.rr-diagram-card {
    border-radius: 0.75rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.rr-diagram-container {
    position: relative;
    min-height: 220px;
}

.rr-view {
    display: none;
}

    .rr-view.rr-view-active {
        display: block;
    }

.rr-ribbon-shape {
    transition: stroke-width 0.15s ease, stroke 0.15s ease, fill 0.15s ease;
}

    .rr-ribbon-shape:hover {
        stroke-width: 3px;
        stroke: #ef4444; /* красный */
        fill: #fee2e2; /* лёгкая подсветка */
    }

/* Анимация тока — используем ту же, что и для DoubleCylinder/RectFrame:
   если @keyframes dc-current-flow уже объявлен, второй раз не добавляй */
.rr-current {
    stroke-linecap: round;
    stroke-dasharray: 400;
    animation: dc-current-flow 4s linear infinite;
}
/* === Helix Diagram === */

.hx-diagram-card {
    border-radius: 0.75rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.hx-diagram-container {
    position: relative;
    min-height: 240px;
}

.hx-view {
    display: none;
}

    .hx-view.hx-view-active {
        display: block;
    }

/* Визуальное выделение цилиндра/окружности */
.hx-cylinder,
.hx-helix-circle {
    transition: stroke-width 0.15s ease, stroke 0.15s ease, fill 0.15s ease;
}

    .hx-cylinder:hover,
    .hx-helix-circle:hover {
        stroke-width: 3px;
        stroke: #3b82f6;
        fill: #eff6ff;
    }

/* Винтовой ток и ток по окружности — анимированная линия */
.hx-helix,
.hx-current {
    stroke-linecap: round;
    stroke-dasharray: 400;
    animation: dc-current-flow 4s linear infinite;
}

/* @keyframes dc-current-flow уже есть для других диаграмм.
   Если нет — добавь один раз:
@keyframes dc-current-flow {
    from { stroke-dashoffset: 0; }
    to   { stroke-dashoffset: -400; }
}
*/
/* Ограничение описания в карточках 3 строками */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


.as-diagram-card {
    border-radius: .75rem;
    border: 1px solid rgba(0,0,0,.05);
}

.as-diagram-container {
    position: relative;
    min-height: 220px;
}

.as-view {
    display: none;
}

    .as-view.as-view-active {
        display: block;
    }

.as-current {
    stroke-linecap: round;
    stroke-dasharray: 400;
    animation: dc-current-flow 4s linear infinite;
}


.hr-diagram-card {
    border-radius: .75rem;
    border: 1px solid rgba(0,0,0,.05);
}

.hr-diagram-container {
    position: relative;
    min-height: 220px;
}

.hr-view {
    display: none;
}

    .hr-view.hr-view-active {
        display: block;
    }

.hr-current {
    stroke-linecap: round;
    stroke-dasharray: 400;
    animation: dc-current-flow 4s linear infinite;
}
/* Chrome, Edge, Safari */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
}
/* Navbar active link styling */
.navbar .nav-link.active {
    font-weight: 600;
    /*border-bottom: 2px solid #0d6efd;*/ /* Bootstrap primary */
    padding-bottom: 0.4rem;
}
footer div.container a {
    text-decoration: none;
}

.footer a,
.footer a:visited {
    /*color: inherit !important;*/
}
a.nav-link,
a.nav-link:visited {
    color: inherit !important;
}



