/* CoachDiary Custom Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        "Noto Color Emoji",
        "Apple Color Emoji",
        "Segoe UI Emoji",
        "Segoe UI Symbol",
        Oxygen,
        Ubuntu,
        Cantarell,
        "Helvetica Neue",
        Arial,
        sans-serif;

    line-height: 1.65;
    letter-spacing: -0.01em;

    background-color: #f5f7fa;
    color: var(--dark-color);

    text-rendering: optimizeLegibility;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* inherit font for form controls */
input,
button,
select,
textarea {
    font: inherit;
}


/* Typography */
h1, h2, h3, h4, h5, h6,
.fw-bold,
.fw-semibold {
    letter-spacing: -0.02em;
}

.lead {
    font-size: 1.125rem;
    line-height: 1.75;
}

p,
.text-muted,
.card-body p,
.workout-ex-desc,
.workout-note,
.workout-meta-card {
    line-height: 1.7;
}

/* Brand / navbar */
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.5rem;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-decoration: none;
}

.logo-coachdiary {
    display: block;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    max-width: 56px;
    max-height: 56px;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
    overflow: hidden;
}

.brand-home-link {
    min-width: 0;
    max-width: 100%;
}

.brand-home-text {
    display: inline-block;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card styling */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 0.5rem;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Stats cards */
.card.border-primary .bi,
.card.border-success .bi,
.card.border-info .bi,
.card.border-warning .bi {
    opacity: 0.9;
}

/* Improve text readability inside cards */
.card-body {
    padding: 1.25rem;
}

.card-body p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.card-body .small {
    font-size: 0.95rem !important;
    line-height: 1.7;
}

/* Home page helpers */
.home-feature-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    font-size: 0.98rem;
    line-height: 1.7;
    color: #6c757d;
}

.home-feature-list > div {
    display: flex;
    align-items: flex-start;
}

.home-feature-list i {
    margin-top: 0.2rem;
}

.home-dual-card .card-body {
    padding: 2rem;
}

.home-dual-card h4 {
    font-size: 2rem;
    margin-bottom: 0;
}

.home-dual-card p {
    font-size: 1.05rem;
    line-height: 1.8;
}

.home-section-title {
    letter-spacing: -0.03em;
}

.home-section-subtitle {
    font-size: 1.05rem;
    line-height: 1.75;
}

/* Footer */
.footer-main {
    color: #4f5d6b;
    padding: 0 0 1rem;
}

.footer-surface {
    background-color: #eef2f5;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.5rem 1.5rem 0 0;
    padding: 2.25rem 2rem 0;
}

.footer-grid {
    padding-bottom: 1.5rem;
}

.footer-brand {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.footer-brand-link {
    flex-shrink: 0;
}

.footer-logo {
    width: 92px;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 0.875rem;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 0.3rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.footer-eyebrow {
    color: #6b7280;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.footer-title {
    font-size: 1.04rem;
    font-weight: 800;
    line-height: 1.3;
    color: #243140;
}

.footer-description,
.footer-company,
.footer-support {
    color: #5f6b7a;
    font-size: 0.92rem;
    line-height: 1.58;
}

.footer-heading {
    color: #344154;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.footer-links a,
.footer-brand-link {
    color: #4f5d6b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus,
.footer-brand-link:hover,
.footer-brand-link:focus {
    color: var(--primary-color);
}

.footer-column p {
    margin-bottom: 0.3rem;
}

.footer-bottom {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding: 0.8rem 0 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    color: #7b8794;
    font-size: 0.86rem;
}

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

/* Button styling */
.btn {
    border-radius: 0.375rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    letter-spacing: -0.01em;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

/* Table styling */
.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
    background-color: var(--light-color);
}

/* Exercise image placeholder */
.exercise-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.exercise-img-placeholder {
    width: 100%;
    height: 200px;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Workout editor */
.exercise-row {
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

.day-tab {
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Tom Select customization */
.ts-control {
    border-color: #dee2e6 !important;
}

.ts-control.focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* ===== WORKOUT PAGE STYLES ===== */

.workout-page {
    max-width: 980px;
    margin: 24px auto;
    padding: 0 18px 34px;
}

.workout-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 3px solid #0f172a;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.workout-header h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.02em;
}

.workout-sub {
    margin: 6px 0 0;
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.35;
}

.workout-meta-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 13px;
    color: #1e293b;
}

.workout-divider {
    border-bottom: 3px solid #0f172a;
    margin: 14px 0;
}

.workout-note {
    margin: 12px 0 16px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 13px;
    color: #1e293b;
}

.workout-note b {
    font-weight: 900;
}

/* Day sections */
.workout-section {
    background: #fff;
    border: 1px solid #d6dee9;
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.08);
    padding: 16px;
    margin: 14px 0;
    break-inside: avoid;
    page-break-inside: avoid;
}

.workout-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.workout-section-head h2 {
    margin: 0;
    font-size: 16px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.workout-pill {
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    background: #1e3a8a;
    padding: 6px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

/* Table */
.workout-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #d6dee9;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.workout-table thead th {
    background: #eef2f7;
    text-align: left;
    padding: 10px 10px;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid #d6dee9;
}

.workout-table tbody td {
    padding: 10px 10px;
    border-bottom: 1px solid #e5edf6;
    vertical-align: middle;
    font-size: 14px;
}

.workout-table tbody tr:last-child td {
    border-bottom: none;
}

.workout-table .img-col {
    width: 92px;
    text-align: center;
}

.workout-table .sets-col {
    width: 88px;
    text-align: center;
}

.workout-table .reps-col {
    width: 120px;
    text-align: center;
}

.workout-table .notes-col {
    width: 180px;
}

/* Exercise thumbnail */
.workout-thumb {
    width: 74px;
    height: 56px;
    object-fit: contain;
    background: #fff;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid #d6dee9;
    display: block;
    margin: 0 auto;
    cursor: zoom-in;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.workout-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.12);
}

.workout-thumb-placeholder {
    width: 74px;
    height: 56px;
    border-radius: 10px;
    border: 1px dashed #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    margin: 0 auto;
    background: #f8fafc;
}

/* Exercise info */
.workout-ex {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.workout-ex-name {
    font-weight: 800;
}

.workout-ex-desc {
    color: #475569;
    font-size: 12.5px;
}

/* Lightbox */
.workout-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.86);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 32px;
}

.workout-lightbox.active {
    display: flex;
}

.workout-lightbox-content {
    position: relative;
    max-width: 96vw;
    max-height: 92vh;
}

.workout-lightbox-img {
    display: block;
    max-width: 96vw;
    max-height: 92vh;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.workout-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.workout-lightbox-close:hover {
    background: rgba(15, 23, 42, 0.95);
}

.workout-lightbox-meta {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

/* Print styles */
@media print {
    .no-print,
    .navbar,
    footer,
    .btn,
    .alert,
    .page-actions {
        display: none !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    body {
        background-color: white !important;
        font-size: 12pt;
    }

    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    table {
        page-break-inside: avoid;
    }

    .workout-page {
        margin: 0;
        max-width: none;
    }

    .workout-section {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .workout-lightbox {
        display: none !important;
    }

    .workout-thumb {
        cursor: default;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .workout-thumb:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2.5rem;
        line-height: 1.15;
    }

    .navbar-brand {
        gap: 10px;
        font-size: 1.25rem;
    }

    .logo-coachdiary {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        max-width: 38px;
        max-height: 38px;
        object-fit: contain;
        object-position: center;
        flex-shrink: 0;
        overflow: hidden;
    }

    .brand-home-text {
        line-height: 1.05;
    }

    .card-body {
        padding: 1rem;
    }

    .home-dual-card .card-body {
        padding: 1.35rem;
    }

    .home-dual-card h4 {
        font-size: 1.5rem;
    }

    .home-dual-card p,
    .home-feature-list,
    .card-body .small {
        font-size: 0.98rem !important;
    }

    .footer-main {
        padding-bottom: 0.75rem;
    }

    .footer-surface {
        border-radius: 1.25rem 1.25rem 0 0;
        padding: 1.6rem 1.25rem 0;
    }

    .footer-brand {
        flex-direction: column;
        gap: 0.75rem;
    }

    .footer-logo {
        width: 78px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.7rem 0 0.85rem;
    }

    .workout-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .workout-table {
        font-size: 13px;
    }

    .workout-table .img-col {
        width: 70px;
    }

    .workout-table .sets-col,
    .workout-table .reps-col {
        width: auto;
    }

    .workout-thumb {
        width: 60px;
        height: 45px;
    }

    .workout-thumb-placeholder {
        width: 60px;
        height: 45px;
    }
}
