/* Samson-fit Custom Styles */

/* Vibration icon — vibrogrif with emanating waves */
.bi-vibration {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
}

:root {
    --samson-primary: #0d6efd;
    --samson-secondary: #6c757d;
    --samson-success: #198754;
    --samson-danger: #dc3545;
    --samson-warning: #ffc107;
    --samson-info: #0dcaf0;
    --samson-purple: #6f42c1;
}

/* Bootstrap extension — purple utility */
.bg-purple {
    background-color: var(--samson-purple) !important;
}

/* Base styles */
body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, sans-serif;
    background-color: #f8f9fa;
}

/* Navbar customization */
.navbar-brand i {
    color: var(--samson-primary);
}

/* Keep top-level navbar items on a single line.
   Long translated labels (e.g. Russian «Возможности», «Управление»,
   «Информация») can overflow on narrow screens. Force nowrap and tighten
   padding/font-size so all dropdown toggles fit on one row. */
.navbar-expand-lg .navbar-nav .nav-link.dropdown-toggle {
    white-space: nowrap;
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .navbar-expand-lg .navbar-nav .nav-link {
        padding-left: 0.35rem;
        padding-right: 0.35rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    .navbar-brand {
        font-size: 1.1rem;
        margin-right: 0.5rem;
    }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .navbar-expand-lg .navbar-nav .nav-link {
        padding-left: 0.45rem;
        padding-right: 0.45rem;
        white-space: nowrap;
    }
}

/* Card styles */
.card {
    border: none;
    border-radius: 10px;
}

.card-shadow {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Button styles */
.btn-primary {
    background-color: var(--samson-primary);
    border-color: var(--samson-primary);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Form styles */
.form-control:focus {
    border-color: var(--samson-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Error pages */
.error-page {
    padding: 3rem 0;
}

.error-page h1.display-1 {
    font-size: 8rem;
    line-height: 1;
}

/* Footer */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer a:hover {
    color: var(--samson-primary) !important;
}

/* Timer styles */
.timer-display {
    font-size: 4rem;
    font-weight: bold;
    font-family: monospace;
}

.timer-controls .btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    font-size: 1.5rem;
}

/* Workout cards */
.workout-card {
    transition: transform 0.2s ease-in-out;
}

.workout-card:hover {
    transform: translateY(-5px);
}

/* Exercise list */
.exercise-item {
    border-left: 3px solid var(--samson-primary);
    padding-left: 1rem;
    margin-bottom: 1rem;
}

/* Profile styles */
.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .timer-display {
        font-size: 3rem;
    }

    .timer-controls .btn {
        width: 80px;
        height: 80px;
        font-size: 1.2rem;
    }
}

/* Compact workout table styles */
.workout-table {
    margin: 20px 0;
    max-height: 600px;
    overflow-y: auto;
}

.compact-table {
    width: 100%;
    border-collapse: collapse;
}

.compact-table th,
.compact-table td {
    padding: 4px 8px;
    border: 1px solid #ddd;
    text-align: center;
}

.compact-table .set-header {
    background-color: #f0f0f0;
    font-weight: bold;
    width: 80px;
}

.compact-input,
.compact-select {
    width: 100%;
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
    font-size: 12px;
}

.compact-table .input-row td {
    padding: 2px;
}

.compact-table .spacer-row td {
    border: none;
    padding: 0;
}

/* Exercise header styling */
.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    background-color: #f0f0f0;
    margin-top: 5px;
    margin-bottom: 5px;
}

.exercise-name {
    padding: 8px 12px;
    color: #212529;
}

.exercise-sets {
    background-color: #f0f0f0;
    padding: 8px 12px 8px 0;
    color: #6c757d;
}

/* Exercise buttons styling */
.exercise-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.exercise-buttons + .exercise-header,
.exercise-buttons + .table-responsive {
    margin-top: 5px;
}

/* Scrollbar styling for workout table */
.workout-table::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.workout-table::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.workout-table::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.workout-table::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Exercise calculate button styling */
.exercise-calculate {
    margin-top: 5px;
    margin-bottom: 5px;
}

/* Exercise metrics styling */
.exercise-metrics {
    font-size: 13px;
    line-height: 1.6;
}

.metric-row {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
}

.metric-label {
    font-weight: 600;
    margin-right: 8px;
}

.metric-value {
    font-weight: bold;
    color: #0d6efd;
    margin-right: 5px;
}

.metric-unit {
    color: #6c757d;
    font-size: 12px;
}

/* ── Cup Rating System (5-level trophy cups) — global styles ── */
.cup-rating-select {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}
.cup-rating-select label {
    cursor: pointer;
    text-align: center;
}
.cup-rating-select input[type="radio"] {
    display: none;
}
.cup-rating-select .cup-label {
    font-size: 2rem;
    opacity: 0.3;
    transition:
        opacity 0.2s,
        transform 0.2s;
    display: inline-block;
}
.cup-rating-select input[type="radio"]:checked + .cup-label {
    opacity: 1;
    transform: scale(1.2);
}
.cup-rating-select .cup-label:hover {
    opacity: 0.8;
}
.cup {
    display: inline-block;
}
.cup-bronze {
    color: #cd7f32;
}
.cup-silver {
    color: #c0c0c0;
}
.cup-gold {
    color: #ffd700;
}
.cup-platinum {
    color: #e5e4e2;
}
.cup-diamond {
    color: #b9f2ff;
}
.cup-empty {
    color: #dee2e6;
}
.cup-bronze-bg {
    background-color: #cd7f32;
}
.cup-silver-bg {
    background-color: #c0c0c0;
}
.cup-gold-bg {
    background-color: #ffd700;
}
.cup-platinum-bg {
    background-color: #e5e4e2;
}
.cup-diamond-bg {
    background-color: #b9f2ff;
}
.rating-average {
    font-size: 2.5rem;
    font-weight: 700;
}
.rating-cups {
    font-size: 1.5rem;
}
.rating-bar {
    height: 0.75rem;
    border-radius: 0.375rem;
    background-color: #e9ecef;
    margin-top: 0.25rem;
}
.rating-bar-fill {
    height: 100%;
    border-radius: 0.375rem;
    transition: width 0.3s;
}
.review-item {
    border-bottom: 1px solid #dee2e6;
    padding: 1.5rem 0;
}
.review-item:last-child {
    border-bottom: none;
}
.review-cups {
    font-size: 1.25rem;
}
[data-theme="dark"] .cup-empty {
    color: #495057;
}
[data-theme="dark"] .cup-bronze {
    color: #cd7f32;
}
[data-theme="dark"] .cup-silver {
    color: #c0c0c0;
}
[data-theme="dark"] .cup-gold {
    color: #ffd700;
}
[data-theme="dark"] .cup-platinum {
    color: #e5e4e2;
}
[data-theme="dark"] .cup-diamond {
    color: #b9f2ff;
}
[data-theme="dark"] .rating-bar {
    background-color: #495057;
}

/* =============================================
   Scroll-to-Top / Scroll-to-Bottom Button
   ============================================= */
.scroll-btn-group {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(1rem);
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease,
        transform 0.3s ease;
}
.scroll-btn-group.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.25);
    transition:
        background-color 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;
    background: linear-gradient(135deg, #6f42c1 0%, #0d6efd 100%);
    color: #fff;
}
.scroll-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0.35rem 1rem rgba(111, 66, 193, 0.4);
}
.scroll-btn:active {
    transform: scale(0.95);
}
[data-theme="dark"] .scroll-btn {
    background: linear-gradient(135deg, #9b6fd4 0%, #3d8bfd 100%);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .scroll-btn:hover {
    box-shadow: 0 0.35rem 1rem rgba(155, 111, 212, 0.5);
}
@media (max-width: 576px) {
    .scroll-btn-group {
        bottom: 1rem;
        right: 1rem;
    }
    .scroll-btn {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
}
