/* =========================================================================
   STYLE GLOBALNE (Reset i czcionki pod urządzenia mobilne / iPhone)
   ========================================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #F5F5F5;
    color: #333333;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* =========================================================================
   EKRAN LOGOWANIA (Login.razor)
   ========================================================================= */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-color: #F5F5F5;
}

.login-container {
    width: 100%;
    max-width: 360px;
    text-align: center;
    background: #ffffff;
    padding: 30px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.app-title {
    font-size: 26px;
    font-weight: bold;
    color: #000000;
    margin-bottom: 15px;
}

.image-wrapper {
    margin-bottom: 25px;
}

.logo-image {
    width: 150px;
    height: 150px;
    object-fit: contain;
}

.form-group {
    margin-bottom: 16px;
}

.form-control {
    width: 100%;
    height: 46px;
    padding: 10px 16px;
    font-size: 15px;
    border: 1px solid #CCCCCC;
    border-radius: 10px;
    background-color: #FAFAFA;
}

    .form-control:focus {
        outline: none;
        border-color: #7A3FFF;
        background-color: #ffffff;
    }

.checkbox-group {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 15px 0 25px 5px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333333;
}

.btn-login {
    width: 100%;
    height: 46px;
    background-color: #7A3FFF;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.info-label {
    font-size: 14px;
    color: #666666;
    margin-top: 15px;
}

.warning-label {
    font-size: 14px;
    font-weight: bold;
    margin-top: 15px;
}

/* =========================================================================
   PANEL GŁÓWNY & DIETA (MainPage.razor)
   ========================================================================= */
.main-page-container {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.tabs-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    height: 40px;
    background-color: transparent;
    color: #7A3FFF;
    border: 1px solid #7A3FFF;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}

    .tab-btn.active {
        background-color: #7A3FFF;
        color: #ffffff;
    }

.macro-border-card {
    background: #ffffff;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

    .macro-border-card strong {
        font-size: 12px;
        color: #000000;
    }

.meals-dynamic-container {
    margin-top: 20px;
}

.meal-section {
    margin-bottom: 20px;
}

.meal-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
}

.meal-grid-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    font-size: 11px;
}

    .meal-grid-table th, .meal-grid-table td {
        padding: 8px 6px;
        text-align: left;
    }

    .meal-grid-table th {
        background-color: #FAFAFA;
        border-bottom: 1px solid #E0E0E0;
    }

.bold-row {
    font-weight: bold;
}

.summary-row {
    border-top: 2px solid #E0E0E0;
    background-color: #FDFDFD;
}

/* =========================================================================
   AKCJE, SUB-TABY I ĆWICZENIA (Trening / Historia)
   ========================================================================= */
.action-buttons-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.btn-action {
    padding: 8px 16px;
    background-color: #7A3FFF; /* 🔥 Zmiana z szarego na fioletowy */
    color: #ffffff; /* 🔥 Zmiana tekstu na biały */
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: bold; /* Pogrubienie dla spójności */
    cursor: pointer;
    white-space: nowrap;
}

.btn-start-train {
    background-color: #7A3FFF;
    color: #ffffff;
    font-weight: bold;
}

.training-tabs-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.sub-tab-btn {
    padding: 6px 12px;
    background-color: transparent;
    color: #7A3FFF;
    border: 1px solid #7A3FFF;
    border-radius: 10px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}

    .sub-tab-btn.active-purple {
        background-color: #7A3FFF;
        color: #ffffff;
    }

.category-header {
    font-size: 15px;
    font-weight: bold;
    color: #000000;
    margin: 12px 0 4px 0;
}

.category-spacer {
    height: 15px;
}

.exercise-row {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
    color: #000000;
}

.ex-name {
    font-weight: 500;
}

.ex-detail {
    font-size: 13px;
}

.text-gray {
    color: #888888;
}

/* =========================================================================
   HISTORIA TRENINGÓW (Historia)
   ========================================================================= */
.history-warning-lbl {
    font-size: 12px;
    color: #2F4F4F;
    margin-bottom: 15px;
}

.history-day-block {
    margin-bottom: 16px;
    background: #ffffff;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #E0E0E0;
}

.history-date-header {
    font-size: 15px;
    font-weight: bold;
    color: #000000;
    margin-bottom: 6px;
    border-bottom: 1px solid #F0F0F0;
    padding-bottom: 4px;
}

.history-row-padding {
    padding-left: 10px;
}

/* =========================================================================
   SUPLEMENTY (Suplementy)
   ========================================================================= */
.suplementy-single-column {
    background: #ffffff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #E0E0E0;
}

.suplementy-grid-split {
    display: flex;
    gap: 15px;
}

.supl-column {
    flex: 1;
    background: #ffffff;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #E0E0E0;
}

.supl-main-header {
    font-size: 14px;
    font-weight: bold;
    color: #7A3FFF;
    margin-bottom: 10px;
    border-bottom: 1px solid #F0F0F0;
    padding-bottom: 4px;
}

.supl-group-block {
    margin-bottom: 12px;
}

.supl-pora-title {
    font-size: 15px;
    font-weight: bold;
    color: #000000;
    display: block;
    margin-bottom: 4px;
}

.supl-list-items {
    list-style: none;
    padding-left: 15px;
}

    .supl-list-items li {
        font-size: 13px;
        margin-bottom: 2px;
        display: flex;
        gap: 6px;
    }

/* =========================================================================
   WIDOK STOPERA (In-Train Stoper Interface)
   ========================================================================= */
.stoper-main-view {
    background: #ffffff;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stoper-time-display {
    font-family: monospace;
    font-weight: bold;
    color: #000000;
}

    .stoper-time-display.round-time {
        font-size: 36px;
        margin-bottom: 2px;
    }

    .stoper-time-display.total-time {
        font-size: 20px;
        color: #666666;
        margin-bottom: 15px;
    }

.stoper-grid-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.btn-stoper-control {
    height: 36px;
    font-size: 13px;
    font-weight: bold;
    background-color: #FAFAFA;
    border: 1px solid #CCCCCC;
    border-radius: 8px;
    cursor: pointer;
}

.stoper-lbl-info {
    font-size: 11px;
    color: #2F4F4F;
    margin: 8px 15px 15px 15px;
    line-height: 1.4;
}

.btn-stoper-action {
    width: 100%;
    height: 42px;
    font-size: 13px;
    font-weight: bold;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
}

.btn-green {
    background-color: #008000;
}

.btn-red {
    background-color: #FF0000;
    margin-bottom: 0;
}

/* =========================================================================
   STOPKA (Wylogowanie)
   ========================================================================= */
.logout-footer {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.btn-logout {
    padding: 10px 24px;
    background-color: #FF4444;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

/* =========================================================================
   FORMULARZ MODYFIKACJI PLANU (CreateTrainingPage.razor)
   ========================================================================= */
.create-training-page {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
    background-color: #F5F5F5;
    min-height: 100vh;
}

.header-container {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 20px;
}

.header-title {
    font-size: 16px;
    font-weight: bold;
    color: #333333;
}

.header-training-nr {
    font-size: 16px;
    font-weight: bold;
    color: #7A3FFF;
}

.rows-container {
    margin-bottom: 20px;
}

.loading-msg {
    text-align: center;
    color: #666666;
    font-size: 14px;
    padding: 20px 0;
}

.training-row-view {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 4px 0 8px 0;
}

.exercise-title {
    font-size: 14px;
    font-weight: bold;
    color: #000000;
    margin-bottom: 4px;
}

.parameters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.input-group-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .input-group-inline label {
        font-size: 13px;
        color: #333333;
        white-space: nowrap;
    }

.input-entry {
    height: 32px;
    padding: 4px 6px;
    font-size: 13px;
    border: 1px solid #CCCCCC;
    border-radius: 6px;
    background-color: #ffffff;
    text-align: center;
}

    .input-entry:focus {
        outline: none;
        border-color: #7A3FFF;
    }

/* Sztywne szerokości pól wejściowych - odwzorowanie z MAUI */
.width-40 {
    width: 45px;
}

.width-75 {
    width: 85px;
    text-align: left;
}

.width-45 {
    width: 55px;
}

.width-55 {
    width: 65px;
}

.row-divider {
    border: none;
    height: 1px;
    background-color: #E0E0E0;
    margin-top: 10px;
    margin-bottom: 6px;
}

.footer-actions {
    padding: 10px 0;
    margin-top: 15px;
}

.btn-action {
    width: 100%;
    height: 42px;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

    .btn-action.btn-green {
        background-color: #008000;
    }

        .btn-action.btn-green:active {
            background-color: #006400;
        }

#blazor-error-ui {
    display: none !important;
}