:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --success-color: #10b981;
    --error-color: #ef4444;
    --text-color: #1f2937;
    --bg-color: #f9fafb;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: 0.3s;
}

/* Main Content */
main {
    min-height: calc(100vh - 200px);
    padding: 1rem 0;
}

/* Hero */
.hero {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--white);
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.hero p {
    font-size: 1.25rem;
    color: var(--secondary-color);
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Cards */
.card {
    background-color: var(--white);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 1rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.card p {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-secondary:hover {
    background-color: var(--bg-color);
    border-color: var(--secondary-color);
}

.btn-danger {
    background-color: transparent;
    color: var(--error-color);
    border: 1px solid var(--error-color);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-danger:hover {
    background-color: var(--error-color);
    color: var(--white);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-icon {
    padding: 0.5rem;
    min-width: 36px;
}

.btn-icon-only {
    padding: 0.5rem;
    font-size: 1.125rem;
}

/* Button groups */
.btn-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-group-mobile {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 768px) {
    .btn-group-mobile {
        justify-content: space-between;
        width: 100%;
    }
    
    .btn-group-mobile .btn-primary {
        flex: 1;
    }
    
    .btn-group-mobile .btn-secondary,
    .btn-group-mobile .btn-danger {
        flex: 0 0 auto;
    }
}

/* Forms */
.form {
    background-color: var(--white);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.form-group label,
.form-group legend {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-control.error {
    border-color: var(--error-color);
    background-color: #fef2f2;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

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

.table th {
    background-color: var(--bg-color);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table tr:hover {
    background-color: var(--bg-color);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--text-color);
    margin: 0;
}

.page-header .mode-badge {
    align-self: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.empty-state p {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    font-size: 1.125rem;
}

/* Athlete List */
.athlete-list {
    list-style: none;
    margin-top: 1rem;
}

.athlete-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.athlete-list li:last-child {
    border-bottom: none;
}

.athlete-list a {
    color: var(--primary-color);
    text-decoration: none;
}

.athlete-list a:hover {
    text-decoration: underline;
}

/* Athlete Info */
.athlete-info {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.athlete-info p {
    margin-bottom: 0.5rem;
}

/* Stats */
.stats-section {
    margin-bottom: 3rem;
}

.stats-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.stat-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.125rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.stat-item span {
    color: var(--secondary-color);
}

.stat-item strong {
    color: var(--text-color);
}

/* Trainings */
.trainings-list {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.training-date {
    margin-bottom: 2rem;
}

.training-date:last-child {
    margin-bottom: 0;
}

.training-date h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.training-item {
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.training-item:last-child {
    margin-bottom: 0;
}

.exercise-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.video-link {
    color: var(--primary-color);
    font-size: 0.875rem;
    margin-left: 0.5rem;
    text-decoration: none;
}

.video-link:hover {
    text-decoration: underline;
}

.training-details {
    color: var(--secondary-color);
}

.total-weight {
    margin-left: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.feeling-indicator {
    margin-left: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background-color: var(--bg-color);
    font-size: 0.875rem;
    font-weight: 500;
}

.training-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

/* Run training session header responsive layout */
.training-run-header {
    gap: 0.75rem;
}
.training-run-header__item {
    display: flex;
    flex-direction: column;
}
@media (max-width: 768px) {
    .training-run-header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .training-run-header__item {
        width: 100%;
    }
}

.training-type-badge {
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

.training-type-label {
    color: var(--text-color);
    padding: 0.125rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: normal;
    background-color: #f5f5f5;
}

/* Exercises Grid */
.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.exercise-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.exercise-card:hover {
    transform: translateY(-2px);
}

.exercise-card h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.no-video {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* Suggestions */
.suggestions {
    position: absolute;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    -webkit-overflow-scrolling: touch;
    margin-top: 4px;
    width: 100%;
}

.suggestions.active {
    display: block;
}

.exercise-search-wrapper {
    position: relative;
}

#modal-overlay {
    display: none;
}

@media (max-width: 768px) {
    .suggestions {
        max-height: 250px;
    }
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: var(--bg-color);
}

@media (max-width: 768px) {
    .suggestion-item {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }
    
    .suggestion-item:active {
        background-color: var(--bg-color);
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--secondary-color);
}

.modal-close:hover {
    color: var(--text-color);
}

/* Footer */
.footer {
    background-color: var(--white);
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.footer p {
    text-align: center;
    color: var(--secondary-color);
}

/* Training Layout */
.training-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

.training-form .form {
    margin: 0;
}

/* Feeling Buttons */
.feeling-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin: 0.75rem 0;
    max-width: 280px;
}

.feeling-btn {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    padding: 0;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feeling-btn:hover {
    transform: scale(1.1);
    border-color: #fbbf24;
    background-color: #fffbf0;
    box-shadow: 0 4px 8px rgba(251, 191, 36, 0.2);
}

.feeling-btn.selected {
    border-color: #f59e0b;
    background-color: #fef3c7;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.feeling-btn.selected::after {
    content: '✓';
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #10b981;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    border: 2px solid white;
}

/* Training Type Buttons */
.training-type-buttons {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.training-type-btn {
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.375rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 0 0 auto;
    min-width: fit-content;
    text-align: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 0.75rem;
}

.training-type-btn:hover {
    border-color: #666;
    background-color: #f5f5f5;
}

.training-type-btn.selected {
    border-color: #333;
    background-color: #333;
    color: white;
    font-weight: 600;
}

/* Training type selection */
.training-type-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.selected-training-display {
    background-color: var(--text-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: none;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.5rem 0 1rem 0;
}

.selected-training-display.active {
    display: flex;
}

.selected-training-display .type-icon {
    font-size: 1.75rem;
}

.training-type-buttons {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .selected-training-display {
        margin: 0.5rem 0 1rem 0;
        border-radius: 8px;
        justify-content: center;
        text-align: center;
        padding: 1rem 0.75rem;
        font-size: 1.125rem;
    }
    
    .selected-training-display i {
        font-size: 1.25rem;
    }
}

.type-icon {
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    width: 1.25rem;
    justify-content: center;
}

.type-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive */
@media (max-width: 768px) {
    /* Container and general spacing */
    .container {
        padding: 0 12px;
    }
    
    /* Main content spacing */
    main {
        padding: 1rem 0;
    }
    
    /* Hero section */
    .hero {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .hero p {
        font-size: 0.875rem;
    }
    
    /* Page header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        margin-bottom: 0.75rem;
    }
    
    .page-header h1 {
        font-size: 1.25rem;
    }
    
    /* Cards */
    .card {
        padding: 0.75rem;
        border-radius: 6px;
        margin-bottom: 0.5rem;
    }
    
    .card h2 {
        font-size: 1.125rem;
        margin-bottom: 0.375rem;
    }
    
    .card p {
        margin-bottom: 0.75rem;
        font-size: 0.75rem;
    }
    
    /* Forms */
    .form {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
    
    .form-control {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1.5rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-primary {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-secondary,
    .btn-danger {
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
    }
    
    .btn-small {
        padding: 0.375rem 0.625rem;
        font-size: 0.625rem;
    }
    
    .btn-icon-only {
        padding: 0.625rem;
        font-size: 1rem;
    }
    
    /* Tables */
    .table-responsive {
        border-radius: 8px;
        margin: 0 -12px;
        padding: 0 12px;
    }
    
    .table {
        font-size: 0.75rem;
    }

    .table th,
    .table td {
        padding: 0.375rem 0.5rem;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .stat-card h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    /* Training specific */
    .training-layout {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .exercises-list {
        max-height: 200px;
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Interactive elements */
    .feeling-buttons {
        gap: 0.375rem;
        max-width: 240px;
        margin: 0.5rem auto;
    }

    .feeling-btn {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
    
    .feeling-btn.selected::after {
        width: 16px;
        height: 16px;
        font-size: 0.625rem;
    }

    .training-type-buttons {
        gap: 0.25rem;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        margin: 0.5rem -0.5rem;
        padding: 0 0.5rem;
    }

    .training-type-btn {
        padding: 0.375rem 0.5rem;
        flex: 0 0 auto;
        min-width: fit-content;
        font-size: 0.75rem;
    }

    .type-icon {
        font-size: 1rem;
    }
    
    .type-name {
        font-size: 0.625rem;
    }
    
    /* RPE buttons */
    .rpe-buttons {
        gap: 0.375rem;
        justify-content: center;
    }
    
    .rpe-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
        min-width: 36px;
        flex: 0 0 auto;
    }
    
    /* Motivation buttons */
    .motivation-section {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .motivation-buttons {
        gap: 0.375rem;
        justify-content: center;
    }
    
    .motivation-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
        min-width: 32px;
    }
    
    /* Empty state */
    .empty-state {
        padding: 2rem 1rem;
        border-radius: 8px;
    }
    
    .empty-state p {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    /* Modal */
    .modal-content {
        padding: 1rem;
        border-radius: 8px;
        width: 95%;
    }
    
    /* Training items */
    .training-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        font-size: 0.875rem;
    }
    
    .exercise-name {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
    
    .training-details {
        font-size: 0.75rem;
    }
    
    /* Alerts */
    .alert {
        padding: 0.75rem;
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    /* Grid adjustments */
    .grid {
        gap: 1rem;
    }
    
    .exercises-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .exercise-card {
        padding: 1rem;
    }
    
    /* Forms specific */
    .form-row {
        flex-direction: column;
    }
    
    /* Navigation (already handled by Tailwind) */
    .nav-toggle {
        display: flex;
    }
}

/* RPE Scale */
.rpe-scale {
    margin: 0.75rem 0;
}

.rpe-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.rpe-btn {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
}

.rpe-btn:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

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

.rpe-btn[data-value="1"],
.rpe-btn[data-value="2"] {
    border-color: #10b981;
}
.rpe-btn[data-value="1"].selected,
.rpe-btn[data-value="2"].selected {
    background-color: #10b981;
}

.rpe-btn[data-value="3"],
.rpe-btn[data-value="4"] {
    border-color: #3b82f6;
}
.rpe-btn[data-value="3"].selected,
.rpe-btn[data-value="4"].selected {
    background-color: #3b82f6;
}

.rpe-btn[data-value="5"],
.rpe-btn[data-value="6"] {
    border-color: #f59e0b;
}
.rpe-btn[data-value="5"].selected,
.rpe-btn[data-value="6"].selected {
    background-color: #f59e0b;
}

.rpe-btn[data-value="7"],
.rpe-btn[data-value="8"] {
    border-color: #ef4444;
}
.rpe-btn[data-value="7"].selected,
.rpe-btn[data-value="8"].selected {
    background-color: #ef4444;
}

.rpe-btn[data-value="9"],
.rpe-btn[data-value="10"] {
    border-color: #dc2626;
}
.rpe-btn[data-value="9"].selected,
.rpe-btn[data-value="10"].selected {
    background-color: #dc2626;
}

.rpe-description {
    background-color: var(--bg-color);
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

/* Motivation Section */
.motivation-section {
    display: flex;
    gap: 2rem;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}

.motivation-group {
    flex: 1;
    min-width: 200px;
}

.sub-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    display: block;
    margin-bottom: 0.5rem;
}

.motivation-buttons {
    display: flex;
    gap: 0.5rem;
}

.motivation-btn {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    padding: 0;
    width: 36px;
    height: 36px;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.motivation-btn:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.motivation-btn.selected {
    border-color: var(--success-color);
    background-color: var(--success-color);
    color: var(--white);
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    align-items: flex-end;
}

.form-group.half {
    /* flex: 1; */
}

.form-group.third {
    flex: 1;
    min-width: 80px;
}

@media (max-width: 768px) {
    .form-row {
        gap: 0.375rem;
    }
    
    .motivation-section {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .selected-training-type {
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .selected-training-type .type-icon {
        font-size: 1.25rem;
    }
    
    .selected-training-type .type-name {
        font-size: 0.875rem;
    }
    
    .training-type-selector {
        padding-top: 0.75rem;
        margin-top: 0.75rem;
    }
}

/* Mode Selection */
.mode-selection-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.mode-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.mode-card {
    background-color: var(--white);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.mode-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.mode-card.lifestyle {
    border-color: #ccc;
}

.mode-card.lifestyle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #666;
}

.mode-card.peak {
    border-color: #ccc;
}

.mode-card.peak::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #666;
}

.mode-icon {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1rem;
    font-family: monospace;
    font-weight: normal;
    color: var(--text-color);
}

.mode-card h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.75rem;
}

.mode-description {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

.mode-features {
    list-style: none;
    margin-bottom: 2rem;
}

.mode-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.mode-features li:last-child {
    border-bottom: none;
}

.btn-mode {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.mode-info {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    color: var(--secondary-color);
}

@media (max-width: 768px) {
    .mode-selection-container {
        padding: 1rem;
    }
    
    .mode-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1rem 0;
    }
    
    .mode-card {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .mode-icon {
        font-size: 3rem;
        margin-bottom: 0.5rem;
    }
    
    .mode-card h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .mode-description {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }
    
    .mode-features {
        margin-bottom: 1.5rem;
    }
    
    .mode-features li {
        padding: 0.5rem 0;
        font-size: 0.875rem;
    }
    
    .btn-mode {
        padding: 0.875rem;
        font-size: 1rem;
    }
    
    .mode-info {
        padding: 1rem;
        font-size: 0.875rem;
    }
}

/* Mode Indicators */
.mode-indicator {
    color: var(--secondary-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.mode-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    vertical-align: middle;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.mode-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mode-badge.lifestyle {
    background-color: #10b981;
    color: white;
    border: 1px solid #059669;
}

.mode-badge.lifestyle:hover {
    background-color: #059669;
}

.mode-badge.peak {
    background-color: #3b82f6;
    color: white;
    border: 1px solid #2563eb;
}

.mode-badge.peak:hover {
    background-color: #2563eb;
}

/* Mode Selection Modal */
.mode-selection-modal {
    max-width: 800px;
    width: 90%;
}

.mode-cards-modal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.mode-cards-modal .mode-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

.mode-cards-modal .mode-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mode-cards-modal .mode-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.mode-cards-modal .lifestyle .mode-icon {
    color: #10b981;
}

.mode-cards-modal .peak .mode-icon {
    color: #3b82f6;
}

.mode-cards-modal h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.mode-cards-modal .mode-description {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.mode-cards-modal .btn-mode {
    width: 100%;
    margin-top: 1rem;
}

.limb-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.limb-btn {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.limb-btn-half {
    flex: 1;
    margin: 0 0.25rem;
}

.limb-btn-half:first-child {
    margin-left: 0;
}

.limb-btn-half:last-child {
    margin-right: 0;
}

/* Training Session Form */

/* Compact exercise display */
.exercise-entry.saved {
    overflow: visible;
    cursor: pointer;
}

.exercise-entry .exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}

.exercise-entry .exercise-header h3 {
    font-size: 1rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 1rem;
}

.exercise-entry .exercise-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
}

.exercise-entry .exercise-summary .summary-values {
    display: flex;
    gap: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exercise-entry .exercise-summary .feeling-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.exercise-entry.saved .exercise-content {
    display: none;
}

/* Custom Overrides */
.training-session-form .card {
    margin-bottom: 1.5rem;
}

.training-type-buttons.compact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

@media (max-width: 768px) {
    .training-session-form .card {
        margin-bottom: 1rem;
    }

    .training-type-buttons.compact {
        justify-content: center;
    }
}


/* Datalist input styling */
input[list]::-webkit-calendar-picker-indicator {
    display: none;
}

input[list]:focus {
    outline: none;
    border-color: #e63946;
}

/* Ensure datalist shows on focus */
input[list]:focus::-webkit-input-placeholder {
    color: transparent;
}

/* Required field indicators */
input:required,
select:required,
textarea:required {
    border-left: 3px solid #ef4444;
}

input:required:valid,
select:required:valid,
textarea:required:valid {
    border-left: 3px solid #10b981;
}

input:required:focus,
select:required:focus,
textarea:required:focus {
    border-color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

/* Hide asterisks in labels */
.form-group label::after {
    content: none !important;
}

/* Category badges in exercise list */
.exercise-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exercise-item .exercise-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.exercise-item .exercise-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.category-badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    background-color: #f3f4f6;
}

.category-badge.category-warmup {
    background-color: #fef3c7;
    color: #d97706;
}

.category-badge.category-cooldown {
    background-color: #dbeafe;
    color: #2563eb;
}

.category-badge.category-conditioning {
    background-color: #fce7f3;
    color: #ec4899;
}

.image-gallery-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
}

.image-gallery-link:hover {
    color: var(--primary-hover);
}

.image-gallery-link .image-count {
    font-size: 0.75rem;
    background-color: #e5e7eb;
    padding: 0 0.25rem;
    border-radius: 0.25rem;
}

/* Image Gallery Modal */
.image-gallery-modal {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gallery-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.gallery-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.gallery-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    position: relative;
    min-height: 400px;
}

.gallery-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#galleryMainImage {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 1rem 0.75rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    z-index: 10;
}

.gallery-nav:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.gallery-prev {
    left: 0.5rem;
}

.gallery-next {
    right: 0.5rem;
}

.gallery-thumbnails {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    overflow-x: auto;
    max-height: 120px;
}

.gallery-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbnail.active {
    border-color: var(--primary-color);
}

.gallery-thumbnail:hover {
    border-color: #9ca3af;
}

/* Fullscreen support */
.modal.fullscreen .modal-content {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
}

.modal.fullscreen .gallery-main {
    height: calc(100vh - 200px);
}

.modal.fullscreen #galleryMainImage {
    max-height: calc(100vh - 200px);
}

/* Exercise header styles */
.exercise-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.info-toggle-btn {
    background: #3b82f6;
    border: 1px solid #3b82f6;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
}

.info-toggle-btn:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: scale(1.05);
}

.info-toggle-btn.active {
    background: #2563eb;
    border-color: #2563eb;
}

.exercise-media-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.exercise-media-compact {
    position: relative;
    display: inline-block;
}

.exercise-media-compact img {
    height: 100px;
    width: auto;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.exercise-media-compact img:hover {
    transform: scale(1.05);
}

.media-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-decoration: none;
}

.exercise-details-expandable {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-top: 0.5rem;
}

/* Exercise preview with multiple media items */
.exercise-preview-compact {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.exercise-preview-compact .exercise-media-compact {
    position: relative;
    flex-shrink: 0;
}

.text-muted {
    color: #9ca3af;
    font-size: 0.875rem;
    margin: 0 0.25rem;
}

/* Athletes Grid */
.athletes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.athlete-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.athlete-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.athlete-card-top {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.athlete-photo-wrapper {
    position: relative;
    flex-shrink: 0;
}

.athlete-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.athlete-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    font-size: 1.5rem;
    color: #9ca3af;
}

.athlete-content {
    flex: 1;
    min-width: 0;
}

.athlete-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.athlete-name-link {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s;
}

.athlete-name-link:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.athlete-phone,
.athlete-year {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.athlete-phone i,
.athlete-year i {
    font-size: 0.75rem;
    margin-right: 0.25rem;
}

.athlete-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: stretch;
}

.athlete-actions > * {
    flex: 1;
    text-align: center;
}

.btn-edit-athlete {
    background: #10b981;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
    align-self: center;
}

.btn-edit-athlete:hover {
    background: #059669;
    transform: scale(1.05);
}

.btn-text {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.btn-text.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-text.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.5);
}

.btn-text i {
    font-size: 0.875rem;
}
