/**
 * CORE Application - Global Theme
 * Version: 1.0.0
 *
 * Tento súbor obsahuje:
 * - CSS premenné (farby, spacing, typography)
 * - Reset štýly
 * - Základné body štýly
 * - Utility classes
 */

/* MPA Page Transitions (Chrome 126+, graceful degradation) */
@view-transition {
    navigation: auto;
}

/* Footer je izolovaný z root page-transition snapshot */
::view-transition-old(bottom-nav),
::view-transition-new(bottom-nav) {
    animation: none;
}

/* =============================================================================
   CSS PREMENNÉ
   ============================================================================= */

:root {
    /* Browser Native UI (date picker, scrollbars, form controls) */
    color-scheme: light;

    /* Farby - Pozadie */
    --bg-soft: #f2f2f7;
    --bg-page: #f2f2f7;
    --card-bg: #ffffff;
    --card-bg-hover: #fafafa;

    /* Farby - Text */
    --text-main: #1c1c1e;
    --text-secondary: #8e8e93;
    --text-tertiary: #aeaeb2;
    --text-placeholder: #c7c7cc;

    /* Farby - Akcenty */
    --accent-green: #34c759;
    --accent-green-hover: #2db84e;
    --accent-green-light: rgba(52, 199, 89, 0.1);

    --accent-blue: #007aff;
    --accent-blue-hover: #0066d6;
    --accent-blue-light: rgba(0, 122, 255, 0.1);

    --accent-red: #ff3b30;
    --accent-red-hover: #e6352b;
    --accent-red-light: rgba(255, 59, 48, 0.1);

    --accent-orange: #ff9500;
    --accent-orange-hover: #e68600;
    --accent-orange-light: rgba(255, 149, 0, 0.1);

    --accent-purple: #af52de;
    --accent-yellow: #ffcc00;

    /* Farby - Borders */
    --border-color: #e5e5ea;
    --border-color-light: #f0f0f5;
    --border-color-focus: var(--accent-blue);

    /* Farby - Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.05);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 24px;
    --spacing-3xl: 32px;
    --spacing-4xl: 40px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Typography - Font Family */
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-family-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Typography - Font Sizes */
    --font-size-xs: 0.7rem;
    --font-size-sm: 0.8rem;
    --font-size-base: 0.95rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.1rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.75rem;

    /* Typography - Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Typography - Line Heights */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Z-index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-toast: 600;

    /* Layout */
    --max-width-form: 440px;
    --max-width-card: 500px;
    --max-width-container: 800px;
    --max-width-wide: 1200px;

    /* Safe Areas (iOS) */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

/* =============================================================================
   DARK MODE - System Preference
   ============================================================================= */

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        /* Browser Native UI (date picker, scrollbars, form controls) */
        color-scheme: dark;

        /* Farby - Pozadie */
        --bg-soft: #1c1c1e;
        --bg-page: #121212;
        --card-bg: #2c2c2e;
        --card-bg-hover: #3a3a3c;

        /* Farby - Text */
        --text-main: #E2E8F0;
        --text-secondary: #8e8e93;
        --text-tertiary: #636366;
        --text-placeholder: #48484a;

        /* Farby - Akcenty (iOS dark mode values) */
        --accent-green: #30d158;
        --accent-green-hover: #28b94c;
        --accent-green-light: rgba(48, 209, 88, 0.15);

        --accent-blue: #0a84ff;
        --accent-blue-hover: #0077e6;
        --accent-blue-light: rgba(10, 132, 255, 0.15);

        --accent-red: #ff453a;
        --accent-red-hover: #e63d33;
        --accent-red-light: rgba(255, 69, 58, 0.15);

        --accent-orange: #ff9f0a;
        --accent-orange-hover: #e68f09;
        --accent-orange-light: rgba(255, 159, 10, 0.15);

        --accent-purple: #bf5af2;
        --accent-yellow: #ffd60a;

        /* Farby - Borders */
        --border-color: #38383a;
        --border-color-light: #2c2c2e;
        --border-color-focus: var(--accent-blue);

        /* Farby - Shadows (menej viditeľné v dark mode) */
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
        --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
}

/* =============================================================================
   DARK MODE - Manual Override (data-theme="dark")
   ============================================================================= */

[data-theme="dark"] {
    /* Browser Native UI (date picker, scrollbars, form controls) */
    color-scheme: dark;

    /* Farby - Pozadie */
    --bg-soft: #1c1c1e;
    --bg-page: #121212;
    --card-bg: #2c2c2e;
    --card-bg-hover: #3a3a3c;

    /* Farby - Text */
    --text-main: #E2E8F0;
    --text-secondary: #8e8e93;
    --text-tertiary: #636366;
    --text-placeholder: #48484a;

    /* Farby - Akcenty (iOS dark mode values) */
    --accent-green: #30d158;
    --accent-green-hover: #28b94c;
    --accent-green-light: rgba(48, 209, 88, 0.15);

    --accent-blue: #0a84ff;
    --accent-blue-hover: #0077e6;
    --accent-blue-light: rgba(10, 132, 255, 0.15);

    --accent-red: #ff453a;
    --accent-red-hover: #e63d33;
    --accent-red-light: rgba(255, 69, 58, 0.15);

    --accent-orange: #ff9f0a;
    --accent-orange-hover: #e68f09;
    --accent-orange-light: rgba(255, 159, 10, 0.15);

    --accent-purple: #bf5af2;
    --accent-yellow: #ffd60a;

    /* Farby - Borders */
    --border-color: #38383a;
    --border-color-light: #2c2c2e;
    --border-color-focus: var(--accent-blue);

    /* Farby - Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* =============================================================================
   RESET & BASE
   ============================================================================= */

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

/* Text Colors */
.text-main {
    color: var(--text-main);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-success {
    color: var(--accent-green);
}

.text-danger {
    color: var(--accent-red);
}

.text-warning {
    color: var(--accent-orange);
}

.text-info {
    color: var(--accent-blue);
}

/* Text Alignment */
.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* Font Weights */
.font-normal {
    font-weight: var(--font-weight-normal);
}

.font-medium {
    font-weight: var(--font-weight-medium);
}

.font-semibold {
    font-weight: var(--font-weight-semibold);
}

.font-bold {
    font-weight: var(--font-weight-bold);
}

/* Display */
.hidden {
    display: none !important;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.grid {
    display: grid;
}

/* Flexbox */
.flex-row {
    flex-direction: row;
}

.flex-col {
    flex-direction: column;
}

.items-start {
    align-items: flex-start;
}

.items-center {
    align-items: center;
}

.items-end {
    align-items: flex-end;
}

.justify-start {
    justify-content: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

/* Spacing - Margin */
.m-0 {
    margin: 0;
}

.mt-sm {
    margin-top: var(--spacing-sm);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mt-xl {
    margin-top: var(--spacing-xl);
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.mb-xl {
    margin-bottom: var(--spacing-xl);
}

/* Spacing - Padding */
.p-0 {
    padding: 0;
}

.p-sm {
    padding: var(--spacing-sm);
}

.p-md {
    padding: var(--spacing-md);
}

.p-lg {
    padding: var(--spacing-lg);
}

.p-xl {
    padding: var(--spacing-xl);
}

/* Width */
.w-full {
    width: 100%;
}

/* ============================================================
   Theme Selector (Shared Component pre Settings/Profile)
   ============================================================ */
.theme-selector {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.theme-option {
    flex: 1;
    cursor: pointer;
    margin: 0 !important;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-transform: none;
    letter-spacing: normal;
}

.theme-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--bg-soft);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.theme-option input[type="radio"]:checked + .theme-label {
    border-color: var(--accent-blue);
    background: var(--accent-blue-light);
}

.theme-icon {
    font-size: 1.5rem;
}

.theme-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.w-auto {
    width: auto;
}

.max-w-form {
    max-width: var(--max-width-form);
}

.max-w-card {
    max-width: var(--max-width-card);
}

.max-w-container {
    max-width: var(--max-width-container);
}

/* =============================================================================
   BASE BODY STYLES
   ============================================================================= */

body {
    font-family: var(--font-family);
    background-color: var(--bg-soft);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    padding-bottom: 90px;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

/* Stránky bez footer menu */
body.no-footer {
    padding-bottom: 0;
}

/* =============================================================================
   LAYOUT COMPONENTS
   ============================================================================= */

.container {
    width: 100%;
    max-width: var(--max-width-container);
    margin: 0 auto;
    padding-left: var(--spacing-xl);
    padding-right: var(--spacing-xl);
    box-sizing: border-box;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
}

.back-btn {
    text-decoration: none;
    color: var(--accent-blue);
    font-size: var(--font-size-md);
    display: flex;
    align-items: center;
    font-weight: var(--font-weight-semibold);
}

.empty-state {
    text-align: center;
    padding: var(--spacing-4xl);
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
}

/* =============================================================================
   ACTIVITY FEED
   ============================================================================= */

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.feed-item {
    background: var(--card-bg);
    padding: 15px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: flex-start;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border-color);
    transition: transform var(--transition-fast);
}

.feed-item:active {
    transform: scale(0.98);
    background: #f9f9fc;
}

.feed-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.icon-success {
    background: rgba(52, 199, 89, 0.15);
    color: var(--accent-green);
}

.icon-missed {
    background: var(--accent-red-light);
    color: var(--accent-red);
}

.icon-weight {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
}

.feed-content {
    flex: 1;
}

.feed-user {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-base);
    margin-bottom: 2px;
}

.feed-desc {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.4;
}

.feed-time {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    opacity: 0.8;
    margin-top: var(--spacing-xs);
    font-weight: var(--font-weight-semibold);
}

.feed-note-badge {
    color: var(--accent-blue);
    font-weight: var(--font-weight-semibold);
}

/* =============================================================================
   FORM COMPONENTS
   ============================================================================= */

.form-card {
    width: 100%;
    max-width: var(--max-width-form);
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.form-card h2 {
    margin-top: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-align: center;
    margin-bottom: 25px;
}

.form-card label {
    display: block;
    margin-top: 18px;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.form-card input,
.form-card select,
.form-card textarea {
    width: 100%;
    padding: 14px;
    margin-top: 5px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    font-size: var(--font-size-md);
    appearance: none;
}

.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-card textarea {
    resize: vertical;
    font-family: inherit;
}

.btn-save {
    width: 100%;
    padding: 16px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    margin-top: 30px;
    font-size: var(--font-size-md);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
    transition: transform var(--transition-fast);
}

.btn-save:active {
    transform: scale(0.98);
}

.btn-cancel {
    display: block;
    text-align: center;
    margin-top: 15px;
    padding: 14px;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    border-radius: 14px;
}

.error {
    background: var(--accent-red-light);
    color: var(--accent-red);
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-weight: var(--font-weight-semibold);
}

/* Centered body layout (for login/form pages without footer) */
.body-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
}

/* Button variant - green/success */
.btn-save-success {
    width: 100%;
    background: var(--accent-green);
    color: #fff;
    border: none;
    padding: 18px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    margin-top: 30px;
    font-weight: 800;
    font-size: var(--font-size-md);
    transition: transform var(--transition-fast);
    box-shadow: 0 4px 10px rgba(52, 199, 89, 0.3);
}

.btn-save-success:active {
    transform: scale(0.98);
}

/* =============================================================================
   SECTION CARDS & HEADERS
   ============================================================================= */

.section-card {
    background: var(--card-bg);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-xl);
}

.header {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
}

.btn-back {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-main);
    font-weight: var(--font-weight-bold);
}

/* =============================================================================
   LIBRARY LIST COMPONENTS (Exercises, Meals)
   ============================================================================= */

/* Header with title and action button */
.header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-top: 20px;
}

.header-with-action h2 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Primary action button (Add) */
.btn-add {
    background: var(--accent-blue);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.2);
    transition: transform var(--transition-fast);
}

.btn-add:active {
    transform: scale(0.98);
}

/* Category header label */
.category-header {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 25px 0 10px 5px;
    letter-spacing: 1px;
}

/* Exercise/Meal card */
.ex-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 20px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.ex-info span {
    color: var(--accent-blue);
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 2px;
}

.ex-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Card actions container */
.card-actions {
    display: flex;
    gap: 15px;
}

.card-actions a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 5px;
}

/* Meal card */
.meal-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 20px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    text-decoration: none;
    color: inherit;
}

.meal-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.meal-info p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.meal-category-badge {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--accent-blue);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
}

/* =============================================================================
   FORM INPUTS (Global - outside .form-card)
   ============================================================================= */

.section-card label {
    display: block;
    margin-top: 15px;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.section-card input,
.section-card select,
.section-card textarea {
    width: 100%;
    padding: 14px;
    margin-top: 5px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    box-sizing: border-box;
    font-size: var(--font-size-md);
    appearance: none;
}

.section-card input:focus,
.section-card select:focus,
.section-card textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* =============================================================================
   DELETE BUTTONS (Globálne tlačidlo na mazanie - kôš)
   ============================================================================= */

.btn-delete-plan {
    background: transparent;
    border: 1px solid var(--accent-red, #e53e3e);
    color: var(--accent-red, #e53e3e);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-delete-plan:hover {
    background: var(--accent-red, #e53e3e);
    color: #fff;
}

/* =============================================================================
   TOGGLE BUTTONS
   ============================================================================= */

.toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 25px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.toggle-btn:active {
    transform: scale(0.97);
}

.toggle-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

.toggle-btn .icon {
    font-size: 1.1rem;
}

/* =============================================================================
   EXERCISE ROW (Workout Planning)
   ============================================================================= */

.exercise-row {
    background: #f9f9f9;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin-top: 15px;
    position: relative;
    border: 1px solid var(--border-color);
}

.remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--accent-red);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    line-height: 28px;
    text-align: center;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.3);
    z-index: 10;
}

.remove-btn:hover {
    background: #e0342c;
    transform: scale(1.05);
}

.grid-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.exercise-note-input {
    margin-top: 10px;
    font-size: var(--font-size-sm);
    padding: 10px 12px;
    border: 1px dashed var(--border-color);
    background: rgba(52, 199, 89, 0.03);
}

.exercise-note-input::placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

.btn-add-row {
    width: 100%;
    background: rgba(0, 122, 255, 0.05);
    color: var(--accent-blue);
    border: 2px dashed rgba(0, 122, 255, 0.3);
    padding: 14px;
    border-radius: 14px;
    cursor: pointer;
    margin-top: var(--spacing-xl);
    font-weight: var(--font-weight-bold);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-add-row:active {
    background: rgba(0, 122, 255, 0.15);
}

/* =============================================================================
   INPUT VALIDATION
   ============================================================================= */

.input-error {
    border: 2px solid var(--accent-red) !important;
    background-color: #fff2f2 !important;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

/* =============================================================================
   DAYS CHECKBOXES (Recurring Workouts)
   ============================================================================= */

.days-checkboxes {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 20px;
    justify-items: center;
}

.days-checkboxes label {
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
}

.days-checkboxes input[type="checkbox"],
.end-options input[type="radio"] {
    display: none;
}

.day-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: var(--font-weight-bold);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    user-select: none;
}

.days-checkboxes input:checked+.day-toggle {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

/* =============================================================================
   END OPTIONS (Recurring Workouts)
   ============================================================================= */

.end-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.end-option-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    margin-top: 0;
    margin-bottom: 0;
}

.end-option-row:has(input:checked) {
    border-color: var(--accent-blue);
    background: rgba(0, 122, 255, 0.03);
}

.end-option-row:has(input:checked) .custom-radio {
    border-color: var(--accent-blue);
    background: var(--accent-blue);
}

.custom-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
}

.custom-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s;
}

.end-option-row:has(input:checked) .custom-radio::after {
    transform: translate(-50%, -50%) scale(1);
}

.end-label-text {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-md);
    flex: 1;
}

/* =============================================================================
   MEAL PLANNING
   ============================================================================= */

.week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    padding: 15px;
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
}

.week-nav a {
    text-decoration: none;
    color: var(--accent-blue);
    font-weight: var(--font-weight-bold);
}

.btn-copy-plan {
    display: block;
    text-align: center;
    background: var(--bg-soft);
    color: var(--accent-blue);
    padding: 10px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--border-color);
}

.day-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--border-color);
}

.day-title {
    font-weight: 800;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meal-list {
    margin-bottom: 15px;
}

.meal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.meal-row:last-child {
    border-bottom: none;
}

.meal-row .type {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: var(--font-weight-bold);
    width: 80px;
}

.meal-row .name {
    font-weight: var(--font-weight-semibold);
    flex: 1;
}

.btn-delete {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c7c7cc;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-delete svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.btn-delete:active {
    background: var(--accent-red-light);
    color: var(--accent-red);
}

.add-form {
    background: #f9f9fc;
    padding: 15px;
    border-radius: 14px;
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.add-form select {
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.btn-submit {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
}

.btn-notify {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: var(--radius-lg);
    font-weight: 800;
    text-align: center;
    font-size: var(--font-size-md);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
    margin-bottom: var(--spacing-xl);
    transition: transform 0.2s;
}

.btn-notify:active {
    transform: scale(0.98);
}

.alert-success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xl);
    border: 1px solid #c3e6cb;
    text-align: center;
    font-weight: var(--font-weight-semibold);
}

/* =============================================================================
   MESSAGES & ALERTS
   ============================================================================= */

.message {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: var(--font-weight-semibold);
}

.success {
    background: #e5f9e7;
    color: #007f1f;
}

/* =============================================================================
   TRANSFER / CONFIRMATION PAGE
   ============================================================================= */

.form-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.highlight-name {
    font-size: 1.2rem;
    color: var(--text-main);
}

.btn-cancel-danger {
    display: block;
    width: 100%;
    padding: 15px;
    border-radius: var(--radius-md);
    background: var(--bg-soft);
    color: var(--accent-red);
    text-decoration: none;
    font-weight: 700;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    font-size: var(--font-size-md);
    text-align: center;
}

/* =============================================================================
   FAB Keyboard - Floating Action Buttons pri klávesnici
   Požiadavka: body.fab-page musí mať position: fixed, scroll na vnútornom kontajneri
   ============================================================================= */

/* Body layout pre stránky s FAB keyboard */
body.fab-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* Použijeme dvh pre presnú výšku viewportu (mobil) */
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background-color: var(--bg-soft);
    z-index: 0;
}

body.fab-page>.fab-scroll {
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
    /* Basic safe area padding + min 20px */
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* Body-centered vo fab-scroll (napr. add_meal, add_exercise) */
body.fab-page>.fab-scroll.body-centered {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 100%;
    /* Prekreslenie paddingu pre centrovaný layout + spacing */
    /* padding-top: calc(var(--spacing-xl) + max(20px, env(safe-area-inset-top))); */
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: calc(var(--spacing-xl) + max(20px, env(safe-area-inset-bottom)));
    padding-left: var(--spacing-xl);
    padding-right: var(--spacing-xl);
}

body.fab-page>.fab-scroll.body-centered>.form-card {
    margin: 0 auto;
    width: 100%;
    max-width: var(--max-width-form);
    flex-shrink: 0;
}

/* FAB kontajner */
.fab-keyboard {
    display: none;
    position: fixed;
    top: 350px;
    left: 0;
    right: 0;
    justify-content: space-between;
    pointer-events: none;
    z-index: 9999;
}

.fab-keyboard.visible {
    display: flex;
}

/* FAB tlačidlá */
.fab-kb-btn {
    width: 56px;
    height: 56px;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
}

.fab-kb-btn:active {
    opacity: 0.85;
}

/* Uložiť - modrý, pravá strana */
.fab-kb-save {
    background: var(--accent-blue);
    color: white;
    box-shadow: -2px 0 12px rgba(0, 122, 255, 0.4);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

/* Zrušiť - červený, ľavá strana */
.fab-kb-cancel {
    background: var(--accent-red);
    color: white;
    box-shadow: 2px 0 12px rgba(255, 59, 48, 0.4);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* =============================================================================
   VIEW TRAINEE / MOBILE PROFILE
   MIGRATED TO: css/view-trainee.css
   ============================================================================= */

/* =============================================================================
   INTENSITY RATING BADGE
   Zdieľané medzi simpleplan, trainingplan a workouts
   ============================================================================= */

/* Heading Row - kontajner pre heading + rating badge */
.heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

/* Intensity Rating Badge */
.intensity-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    margin-right: -5px;
    flex-shrink: 0;
}

/* =============================================================================
   TP-TABS COMPONENT (Shared between SimplePlan and TrainingPlan)
   ============================================================================= */

.tp-tabs {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    /* Odstránený border-bottom pre čistejší vzhľad tabletiek */
}

.tp-tabs::-webkit-scrollbar {
    height: 4px;
}

.tp-tabs::-webkit-scrollbar-thumb {
    background: var(--border-color, #ddd);
    border-radius: 2px;
}

.tp-tab {
    flex-shrink: 0;
    padding: 10px 16px;
    border: 1px solid var(--border-color, #ddd); /* Pridaný jemný border pre lepšie oddelenie */
    background: var(--card-bg, #fff); /* Biele v light mode, tmavé v dark mode */
    border-radius: 8px; /* Tvar tabletky */
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main); /* Klasická farba textu (prispôsobuje sa dark mode) */
    cursor: pointer;
    transition: var(--tp-transition, all 0.2s ease);
    white-space: nowrap;
}

.tp-tab:hover {
    background: rgba(74, 144, 217, 0.1); /* Jemný hover efekt */
    border-color: var(--tp-primary, #4a90d9); /* Rámik sa pri hoveri zafarbí do modra */
    color: var(--tp-primary, #4a90d9);
}

.tp-tab.active {
    background: rgba(74, 144, 217, 0.15); /* Jemná modrastá (priesvitná) - lepšie pre dark mode */
    border-color: var(--tp-primary, #4a90d9); /* Modrý border pre zvýraznenie */
    color: var(--tp-primary, #4a90d9); /* Modrý text */
}

.tp-tab .day-name {
    display: block;
}

.tp-tab .day-status {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* =============================================================================
   PWA & Touch Devices - Global Scrollbar Hide (Scenár B)
   ============================================================================= */
@media all and (display-mode: standalone) and (pointer: coarse) {
    /* Pre Firefox / IE */
    * {
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }
    
    /* Pre Chrome, Safari, iOS, atď. */
    *::-webkit-scrollbar {
        display: none !important;
    }
}