/* Template System Styles */
.workout-templates-section {
    margin-bottom: 2rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border: 1px solid rgba(102, 126, 234, 0.15);
    overflow: visible;
}

.workout-templates-section.hidden {
    display: none;
}

/* Collapsible Header Styles */
.templates-header.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
    margin-bottom: 0;
}

.templates-header.collapsible-header:hover {
    background: rgba(102, 126, 234, 0.08);
}

.templates-header-content {
    flex: 1;
}

.templates-header-content h3 {
    margin: 0 0 0.25rem 0;
    color: #333;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.templates-header-content h3 i {
    color: var(--primary-color, #667eea);
}

.templates-header-content p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
}

.collapse-toggle-btn {
    background: rgba(102, 126, 234, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.collapse-toggle-btn:hover {
    background: rgba(102, 126, 234, 0.2);
}

.collapse-toggle-btn .collapse-icon {
    color: var(--primary-color, #667eea);
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

/* Collapsed state */
.workout-templates-section.collapsed .collapse-toggle-btn .collapse-icon {
    transform: rotate(-90deg);
}

.workout-templates-section.collapsed .templates-header-content p {
    display: none;
}

/* Collapsible Content */
.templates-collapsible-content {
    max-height: 2000px;
    overflow: visible;
    transition: max-height 0.4s ease, padding 0.3s ease, opacity 0.3s ease;
    padding: 0 1.25rem 1.25rem 1.25rem;
    opacity: 1;
}

.workout-templates-section.collapsed .templates-collapsible-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

/* Removed duplicate - comprehensive definition at line 2690 */

.templates-header,
.exercise-selector-header {
    margin-bottom: 1.5rem;
}

.templates-header h3,
.exercise-selector-header h3 {
    margin: 0 0 0.25rem 0;
    color: #333;
    font-size: 1.5rem;
}

.templates-header p,
.exercise-selector-header p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.workout-start-options {
    margin-bottom: 2rem;
}

.start-options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.start-options-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.start-option-tabs {
    display: flex;
    gap: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
}

.start-option-tabs .tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.start-option-tabs .tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.start-option-tabs .tab-btn:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
}

.start-options-content .tab-content {
    display: none;
}

.start-options-content .tab-content.active {
    display: block;
    min-height: 500px;
}

.template-selector {
    min-height: 200px;
    height: auto;
}

.workout-templates-section.collapsed .template-selector {
    min-height: 0;
}

.template-section {
    margin-bottom: 2rem;
}

.template-section h4 {
    margin: 0 0 1rem 0;
    color: #555;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    min-height: 200px;
}

.btn-show-all-templates {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5rem;
    font-size: 0.85rem;
    text-align: center;
}

.btn-show-all-templates i {
    margin-right: 0.35rem;
}

.template-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.template-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.1);
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.template-header h5 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.favorite-star {
    color: #ffc107;
}

.template-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.template-description {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
}

.template-actions .share-btn {
    color: var(--primary-color, #667eea);
}

.template-actions .share-btn:hover {
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary-color, #667eea);
}

.template-main-actions {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.btn-icon.active {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.btn-icon.btn-danger {
    color: #dc3545;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.btn-icon.btn-danger:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-color: #dc3545;
}

.start-template-btn {
    flex: 1;
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Enhanced Template Editing Styles */
.modal-large .modal-content {
    max-width: 800px;
    width: 90vw;
}

.template-edit-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0.5rem 0;
    border-radius: 8px 8px 0 0;
}

.template-edit-tabs .tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    position: relative;
    border-bottom: 2px solid transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.template-edit-tabs .tab-btn.active {
    background: white;
    color: #333;
    border-bottom-color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid white;
}

.template-edit-tabs .tab-btn:hover:not(.active) {
    background: rgba(99, 102, 241, 0.1);
    color: #333;
    border-color: rgba(99, 102, 241, 0.3);
}

.template-exercises-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.template-exercises-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
}

.template-exercises-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: #f8f9fa;
}

.template-exercise-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: white;
    transition: all 0.2s ease;
    justify-content: space-between;
}

.template-exercise-item:last-child {
    border-bottom: none;
}

.template-exercise-item:hover {
    background: #f0f7ff;
}

.template-exercise-item.editing {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.exercise-drag-handle {
    color: #ccc;
    cursor: grab;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.exercise-drag-handle:hover {
    color: #999;
}

.exercise-drag-handle:active {
    cursor: grabbing;
}

.template-exercise-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.template-exercise-item.drag-over {
    border-top: 3px solid #667eea;
    background: #f0f7ff;
}

.template-exercise-item[draggable="true"]:hover {
    background: #f8f9fa;
}

.exercise-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.exercise-info h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exercise-type {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    font-weight: 500;
    white-space: nowrap;
}

.exercise-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 1rem;
    align-items: center;
}

.suggestion {
    font-size: 0.8rem;
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    white-space: nowrap;
}

.exercise-actions {
    display: flex;
    gap: 0.5rem;
}

.no-exercises {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.add-exercise-section {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    position: relative;
}

.add-exercise-section .search-icon {
    position: absolute;
    left: 2.5rem;
    top: 3rem;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    z-index: 2;
}

.add-exercise-section #modalExerciseSearch {
    padding-left: 3rem;
    width: 100%;
    box-sizing: border-box;
}

.exercise-edit-form {
    padding: 1.5rem;
    background: #fff;
    border-radius: var(--border-radius);
    border: 2px solid #ffc107;
}

.exercise-edit-form h5 {
    margin: 0 0 1.5rem 0;
    color: #333;
    font-size: 1.1rem;
}

.exercise-fields {
    margin: 1rem 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.search-result {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.search-result:hover {
    background: #f0f7ff;
}

.search-result:last-child {
    border-bottom: none;
}

.search-result-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.search-result-details {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.search-result-details .equipment {
    background: #e1f5fe;
    color: #0277bd;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
}

.search-result-details .muscles {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
}

.search-loading, .search-error, .no-results {
    padding: 1rem;
    text-align: center;
    color: #666;
    font-style: italic;
}

.search-error {
    color: #d32f2f;
}

/* Desktop Template Edit Modal Styles */
.template-edit-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.template-edit-modal .modal-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem 2rem;
    position: relative;
}

.template-edit-modal .modal-header h3 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.template-edit-modal .close-btn {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
}

.template-edit-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.template-edit-modal .close-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.template-edit-modal .modal-body {
    background: #ffffff;
    padding: 0;
    border-radius: 0 0 16px 16px;
    max-height: 70vh;
    overflow-y: auto;
}

.template-edit-modal .template-edit-tabs {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0 2rem;
    display: flex;
    gap: 0;
    margin-bottom: 0;
}

.template-edit-modal .template-edit-tabs .tab-btn {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
}

.template-edit-modal .template-edit-tabs .tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #ffffff;
}

.template-edit-modal .template-edit-tabs .tab-btn:hover:not(.active) {
    color: #495057;
    background: rgba(102, 126, 234, 0.05);
}

.template-edit-modal .tab-content {
    padding: 2rem;
}

.template-edit-modal .form-group {
    margin-bottom: 1.5rem;
}

.template-edit-modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
    font-size: 0.95rem;
}

.template-edit-modal .form-group input,
.template-edit-modal .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
}

.template-edit-modal .form-group input:focus,
.template-edit-modal .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.template-edit-modal .modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1.5rem 2rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    border-radius: 0 0 16px 16px;
}

.template-edit-modal .modal-footer .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.template-edit-modal .modal-footer .btn-secondary {
    background: #6c757d;
    color: #ffffff;
    border: 2px solid #6c757d;
}

.template-edit-modal .modal-footer .btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
    transform: translateY(-1px);
}

.template-edit-modal .modal-footer .btn-primary {
    background: #667eea;
    color: #ffffff;
    border: 2px solid #667eea;
}

.template-edit-modal .modal-footer .btn-primary:hover {
    background: #5a6fd8;
    border-color: #5a6fd8;
    transform: translateY(-1px);
}

/* Template Creation from Workout Modal Styles */
.template-edit-modal .workout-summary {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.template-edit-modal .workout-summary h4 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
}

.template-edit-modal .workout-summary p {
    margin: 0.25rem 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.template-edit-modal .exercise-preview {
    margin-bottom: 1.5rem;
}

.template-edit-modal .exercise-preview h4 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
}

.template-edit-modal .exercise-list {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.template-edit-modal .exercise-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.template-edit-modal .exercise-preview-item:last-child {
    border-bottom: none;
}

.template-edit-modal .exercise-name {
    font-weight: 500;
    color: #495057;
}

.template-edit-modal .exercise-sets {
    color: #6c757d;
    font-size: 0.85rem;
}

.template-edit-modal .template-form {
    margin-top: 1rem;
}

/* Template Add Button and Dropdown */
.template-actions-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.template-add-dropdown {
    position: relative;
}

.template-add-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 9999;
    overflow: visible;
}

.template-add-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary, #333);
    transition: background 0.2s ease;
}

.template-add-dropdown .dropdown-item:hover {
    background: var(--accent-color, #667eea);
    color: #fff;
}

.template-add-dropdown .dropdown-item i {
    width: 18px;
    text-align: center;
}

/* Share Code Display */
.share-template-section {
    padding: 1rem 0;
}

.share-template-section h4 {
    color: var(--text-primary, #333);
    margin-bottom: 0.5rem;
}

.share-template-section p.text-muted {
    color: var(--text-secondary, #666);
    margin-bottom: 1.5rem;
}

.share-code-display,
.share-link-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.share-code-box {
    background: #fff;
    padding: 1rem 2rem;
    border-radius: 8px;
    border: 2px dashed var(--accent-color, #667eea);
    text-align: center;
}

.share-code-placeholder {
    color: var(--text-secondary, #666);
    font-size: 0.9rem;
}

.share-link-box {
    width: 100%;
    max-width: 400px;
}

.share-link-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    border: 2px solid var(--accent-color, #667eea);
    border-radius: 8px;
    background: #fff;
    color: var(--text-primary, #333);
    text-align: center;
    font-family: inherit;
}

.share-link-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.share-code {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 4px;
    color: var(--accent-color, #667eea);
}

.share-code-actions,
.share-link-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.share-instructions {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.share-instructions p {
    margin: 0;
    color: var(--text-secondary, #666);
    font-size: 0.9rem;
}

/* Import Template Modal */
.share-code-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.share-code-input-wrapper input {
    flex: 1;
}

.template-preview {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color, #667eea);
}

.template-preview h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary, #333);
}

.preview-exercise-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.preview-exercise {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    font-size: 0.9rem;
}

.preview-exercise i {
    color: var(--accent-color, #667eea);
    width: 20px;
    text-align: center;
}

/* Template Badge on Workouts */
.workout-template-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.workout-template-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.workout-template-badge i {
    font-size: 0.7rem;
}

.workout-template-badge.clickable {
    cursor: pointer;
}

.workout-template-row {
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

.workout-template-info {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

/* User Profile Modal Styles */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

.profile-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: white;
}

.profile-info .username {
    margin: 0 0 0.25rem 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

.profile-info .join-date {
    margin: 0;
    opacity: 0.7;
    font-size: 0.8rem;
}

.enhanced-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.enhanced-stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.enhanced-stat-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.enhanced-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.95) !important;
    margin-bottom: 0.25rem;
}

.enhanced-stat-label {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.7) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.profile-actions .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.profile-actions .btn-primary {
    background: #667eea;
    color: white;
    border: 2px solid #667eea;
}

.profile-actions .btn-primary:hover {
    background: #5a6fd8;
    border-color: #5a6fd8;
    transform: translateY(-1px);
}

.profile-actions .btn-success {
    background: #28a745;
    color: white;
    border: 2px solid #28a745;
}

.profile-actions .btn-success:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-1px);
}

.profile-actions .btn-secondary {
    background: #6c757d;
    color: white;
    border: 2px solid #6c757d;
}

.profile-actions .btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
    transform: translateY(-1px);
}

/* Mobile Template Styles */
@media (max-width: 768px) {
    .template-edit-modal {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        overflow: hidden;
    }

    .template-edit-modal .modal-header {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        padding: 1rem 1.5rem;
        position: relative;
    }

    .template-edit-modal .modal-header h3 {
        color: #ffffff;
        font-size: 1.25rem;
        font-weight: 600;
        margin: 0;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

    .template-edit-modal .close-btn {
        position: absolute;
        top: 50%;
        right: 1rem;
        transform: translateY(-50%);
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: #ffffff;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 1.1rem;
        backdrop-filter: blur(10px);
    }

    .template-edit-modal .close-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: translateY(-50%) scale(1.1);
    }

    .template-edit-modal .close-btn:active {
        transform: translateY(-50%) scale(0.95);
    }

    .template-edit-modal .modal-body {
        background: #ffffff;
        padding: 0;
        border-radius: 0 0 16px 16px;
        max-height: 70vh;
        overflow-y: auto;
    }

    .template-edit-modal .template-edit-tabs {
        background: #f8f9fa;
        border-bottom: 1px solid #e9ecef;
        padding: 0 1.5rem;
        display: flex;
        gap: 0;
        margin-bottom: 0;
    }

    .template-edit-modal .template-edit-tabs .tab-btn {
        background: transparent;
        border: none;
        padding: 1rem 1.5rem;
        font-weight: 500;
        color: #6c757d;
        cursor: pointer;
        transition: all 0.3s ease;
        border-bottom: 3px solid transparent;
        font-size: 0.9rem;
    }

    .template-edit-modal .template-edit-tabs .tab-btn.active {
        color: #667eea;
        border-bottom-color: #667eea;
        background: #ffffff;
    }

    .template-edit-modal .template-edit-tabs .tab-btn:hover:not(.active) {
        color: #495057;
        background: rgba(102, 126, 234, 0.05);
    }

    .template-edit-modal .tab-content {
        padding: 1.5rem;
    }

    .template-edit-modal .form-group {
        margin-bottom: 1.5rem;
    }

    .template-edit-modal .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: #495057;
        font-size: 0.9rem;
    }

    .template-edit-modal .form-group input,
    .template-edit-modal .form-group textarea {
        width: 100%;
        padding: 0.75rem;
        border: 2px solid #e9ecef;
        border-radius: 8px;
        font-size: 1rem;
        transition: all 0.3s ease;
        background: #ffffff;
    }

    .template-edit-modal .form-group input:focus,
    .template-edit-modal .form-group textarea:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

    .template-edit-modal .modal-footer {
        background: #f8f9fa;
        border-top: 1px solid #e9ecef;
        padding: 1rem 1.5rem;
        display: flex;
        gap: 0.75rem;
        justify-content: flex-end;
        border-radius: 0 0 16px 16px;
    }

    .template-edit-modal .modal-footer .btn {
        min-width: 100px;
        padding: 0.75rem 1.5rem;
        border-radius: 6px;
        font-weight: 500;
        font-size: 0.9rem;
        transition: all 0.3s ease;
    }

    .template-edit-modal .modal-footer .btn-secondary {
        background: #6c757d;
        color: #ffffff;
        border: 2px solid #6c757d;
    }

    .template-edit-modal .modal-footer .btn-secondary:hover {
        background: #5a6268;
        border-color: #5a6268;
        transform: translateY(-1px);
    }

    .template-edit-modal .modal-footer .btn-primary {
        background: #667eea;
        color: #ffffff;
        border: 2px solid #667eea;
    }

    .template-edit-modal .modal-footer .btn-primary:hover {
        background: #5a6fd8;
        border-color: #5a6fd8;
        transform: translateY(-1px);
    }

    .template-exercises-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .exercise-suggestions {
        margin: 0.5rem 0 0 0;
    }

    .template-grid {
        grid-template-columns: 1fr;
        min-height: 150px;
    }

    .template-selector {
        min-height: 300px;
    }
}

.no-templates {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
    font-style: italic;
}

.loading-templates {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.save-as-template-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    max-width: 400px;
    width: 90%;
}

.template-save-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    animation: templateSlideIn 0.3s ease-out;
}

.template-save-content {
    padding: 1.5rem;
    text-align: center;
}

.template-save-content h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.template-save-content p {
    margin: 0 0 1.5rem 0;
    color: #666;
    line-height: 1.4;
}

.template-save-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.template-save-actions .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

@keyframes templateSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}
