/* Template System Styles */
.workout-templates-section {
    margin-bottom: 2rem;
}

.workout-templates-section.hidden {
    display: none;
}

/* 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.5rem 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: 400px;
    height: auto;
}

.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;
}

.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-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);
}

.tab-content {
    display: none;
    background: white;
    padding: 1.5rem;
    border-radius: 0 0 8px 8px;
    margin-top: -1px;
}

.tab-content.active {
    display: block;
}

.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;
}
    border-radius: var(--border-radius);
    border: 2px dashed var(--border-color);
}

.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;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 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);
}

/* Fix Modal Viewport Issues */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 1rem;
    box-sizing: border-box;
}

.modal.active {
    display: flex;
    animation: fadeInSimple 0.3s ease;
}

.modal-content {
    background: var(--card-background);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: auto;
}

.modal-large .modal-content {
    max-width: 800px;
    width: 90vw;
    max-height: calc(100vh - 2rem);
}

.modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 1.5rem;
}

/* 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;
}

/* 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);
}

@media (max-width: 768px) {
    .modal {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 1rem;
    }
    
    .modal-content {
        width: 95vw;
        max-width: none;
        max-height: calc(100vh - 2rem);
        margin: 0 auto;
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .modal-large .modal-content {
        width: 95vw;
        max-width: none;
        max-height: calc(100vh - 2rem);
        margin: 0 auto;
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .modal-body {
        padding: 1rem;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
        flex-shrink: 0;
    }
    
    .modal-footer {
        padding: 1rem 1.5rem;
        flex-shrink: 0;
    }
    
    .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;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .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: slideIn 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 slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Modal Styles for Save Template */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}


.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-header .close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #ffffff !important;
    padding: 0.5rem;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-header .close:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    font-size: 4rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

.loading-logo i {
    animation: spin 2s linear infinite;
}

.loading-content h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

.loading-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 1rem;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 2px;
    width: 0%;
    animation: loadingProgress 3s ease-out forwards;
}

.loading-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modern Fitness Tracker Styles */
:root {
    --primary-color: #6366f1;
    --primary-hover: #5145e5;
    --primary-light: #a5b4fc;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background: #f8fafc;
    --background-dark: #0f172a;
    --card-background: #ffffff;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #64748b 0%, #475569 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent horizontal scrolling on all devices */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Android-specific fixes for black background issue */
@supports (-webkit-appearance: none) {
    body {
        background: #f8fafc !important;
        background-color: #f8fafc !important;
        color: #1e293b !important;
    }
    
    .main-app {
        background: #f8fafc !important;
        background-color: #f8fafc !important;
    }
    
    .section {
        background: #f8fafc !important;
        background-color: #f8fafc !important;
    }
    
    .app-container {
        background: #f8fafc !important;
        background-color: #f8fafc !important;
    }
}

/* Force disable dark mode on Android browsers */
@media screen and (-webkit-min-device-pixel-ratio: 1) {
    :root {
        --background: #f8fafc !important;
        --card-background: #ffffff !important;
        --text-primary: #1e293b !important;
        --text-secondary: #64748b !important;
        --border-color: #e2e8f0 !important;
        color-scheme: light !important;
    }
    
    body {
        background: #f8fafc !important;
        background-color: #f8fafc !important;
        color: #1e293b !important;
    }
    
    * {
        color-scheme: light !important;
    }
}

/* Override dark mode specifically for Android WebKit browsers */
@media screen and (-webkit-min-device-pixel-ratio: 1) and (prefers-color-scheme: dark) {
    :root {
        --background: #f8fafc !important;
        --card-background: #ffffff !important;
        --text-primary: #1e293b !important;
        --text-secondary: #64748b !important;
        --border-color: #e2e8f0 !important;
        color-scheme: light !important;
    }
    
    body, .main-app, .section, .app-container {
        background: #f8fafc !important;
        background-color: #f8fafc !important;
        color: #1e293b !important;
    }
    
    .modal-content {
        background: #ffffff !important;
        color: #1e293b !important;
    }
    
    .card, .stat-card, .workout-card {
        background: #ffffff !important;
        color: #1e293b !important;
    }
}

/* Ensure all containers respect viewport width */
.main-app, .section, .container {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Modern Login Screen */
.login-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="loginGrid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23loginGrid)"/></svg>');
    opacity: 0.3;
}

.login-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
    animation: slideUp 0.8s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.donate-btn {
    display: inline-block;
    padding: 0.5rem 4rem;
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.donate-btn:hover {
    background: linear-gradient(135deg, #ff5252, #ff7979);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.donate-btn i {
    margin-right: 0.5rem;
}

.mobile-donate-container {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
}

.mobile-donate-container .donate-btn {
    position: static;
    transform: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

.login-logo i {
    font-size: 3.5rem;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.login-logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin: 0;
    letter-spacing: -0.02em;
}

.login-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-form .form-group {
    margin-bottom: 0;
}

.login-form label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: white;
    font-size: 0.95rem;
}

.login-form .form-input,
.login-form .form-select {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.login-form .form-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.login-form .form-input:focus,
.login-form .form-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1rem;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-footer p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* Mobile Login Styles */
@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: inline-block;
    }
    
    .navbar {
        position: fixed;
        bottom: 0;
        top: auto;
        width: 100%;
        left: 0;
        right: 0;
        border-top: 1px solid rgba(99, 102, 241, 0.1);
        border-bottom: none;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        z-index: 1000;
        padding: 0.25rem 0.25rem;
        box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    }
    
    .nav-content {
        padding: 0;
        max-width: none;
        justify-content: center;
        height: auto;
    }
    
    .nav-menu {
        width: 100%;
        gap: 0.25rem;
        display: flex;
        justify-content: space-between;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }
    
    .nav-btn {
        min-width: 100px;
        flex: 1;
        padding: 0.5rem 0.25rem;
    }
    
    /* Add bottom padding to content to account for fixed navbar */
    .app-container {
        padding-bottom: 70px;
    }
    
    .login-screen {
        padding: 1rem;
    }

    .login-container {
        padding: 2rem 1.5rem;
        border-radius: 20px;
        max-width: 100%;
    }

    .login-logo h1 {
        font-size: 2rem;
    }

    .login-logo i {
        font-size: 2.5rem;
    }

    .login-header p {
        font-size: 1rem;
    }

    .login-form .form-input,
    .login-form .form-select {
        padding: 0.875rem 1rem;
        border-radius: 12px;
    }

    .btn-full {
        padding: 0.875rem 1.25rem;
        border-radius: 12px;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.login-screen::after {
    content: '';
    position: absolute;
    bottom: 15%;
    right: 15%;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.user-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}

.user-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.user-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.app-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.app-icon {
    font-size: 3rem;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

.app-name {
    font-size: 2.5rem;
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

/* Enhanced Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}
    justify-content: space-between;
    height: 4rem;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    justify-content: space-between;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.username:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.logout-btn {
    color: var(--text-secondary);
    transition: var(--transition);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    transform: scale(1.05);
}

.logout-btn:active {
    transform: scale(0.95);
    background: rgba(239, 68, 68, 0.2);
}

.mobile-user-profile {
    display: none;
}

/* Desktop: profile on right, nav centered */
@media (min-width: 769px) {
    .user-header {
        display: block;
    }
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-content .donate-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    margin-right: 1rem;
}

.nav-brand i {
    font-size: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.username {
    font-weight: 600;
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 2rem;
    text-align: center;
}

.section-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.info-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.info-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}
    background-clip: text;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Enhanced Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    min-height: 48px;
    background: var(--gradient-primary);
    color: white;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

/* Navigation Button Styles */
.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border: none;
    background: rgba(255, 255, 255, 0.8);
    color: #64748b;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    min-height: 44px;
    min-width: 80px;
    justify-content: center;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-btn i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    transition: all 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.nav-btn span {
    font-size: 0.75rem;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(79, 70, 229, 0.2);
}

.nav-btn:hover i {
    transform: scale(1.05);
}

.nav-btn.active {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.nav-btn.active i {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.nav-btn.active:hover {
    background: linear-gradient(135deg, #4338ca 0%, #7c3aed 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(79, 70, 229, 0.4), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-btn .unread-count {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1;
}

/* Desktop navbar button styles */
@media (min-width: 769px) {
    .nav-btn {
        min-width: 130px;
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
        border-radius: 16px;
        gap: 0.375rem;
    }
    
    .nav-btn i {
        font-size: 1.5rem;
    }
    
    .nav-btn span {
        font-size: 0.8rem;
        font-weight: 600;
    }
    
    .nav-btn:hover {
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
    }
    
    .nav-btn.active {
        box-shadow: 0 8px 30px rgba(79, 70, 229, 0.35), 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .nav-btn.active:hover {
        box-shadow: 0 12px 40px rgba(79, 70, 229, 0.45), 0 2px 4px rgba(0, 0, 0, 0.1);
        transform: translateY(-3px);
    }
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-icon {
    width: 44px;
    height: 44px;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    cursor: pointer;
}

.btn-icon:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Modern Stats Grid - Single Row Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

.progress-card {
    background: var(--gradient-success);
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.progress-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.progress-value {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.progress-positive {
    color: white;
}

.progress-negative {
    color: #fca5a5; /* Light red for visibility on green background */
}

.progress-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.stat-icon {
    width: 4rem;
    height: 4rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow);
}

.stat-content h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b !important; /* Force dark color for light backgrounds */
}

/* Enhanced Exercise Grid */
.exercise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.exercise-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.exercise-card.default-exercise {
    border-left: 4px solid var(--primary-color);
}

.exercise-card.user-exercise {
    border-left: 4px solid var(--success-color);
}

.exercise-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    opacity: 0.1;
    border-radius: 0 var(--border-radius-lg) 0 80px;
}

.exercise-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.exercise-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.exercise-info h3 {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.exercise-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.exercise-badge, .category-badge, .level-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.default-badge {
    background: var(--primary-light);
    color: var(--primary-color);
}

.user-badge {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.category-badge {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.level-badge {
    background: rgba(100, 116, 139, 0.2);
    color: var(--secondary-color);
}

.level-badge.level-beginner {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.level-badge.level-intermediate {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.level-badge.level-expert {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.exercise-equipment, .exercise-mechanic, .exercise-muscles {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.exercise-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.exercise-equipment i, .exercise-mechanic i, .exercise-muscles i {
    color: var(--primary-color);
    width: 16px;
}

.exercise-muscles strong {
    color: var(--text-primary);
}

.exercise-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.filter-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-container i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--card-background);
    transition: var(--transition);
    box-sizing: border-box;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-container select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-background);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-container select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

@media (min-width: 768px) {
    .exercise-controls {
        flex-direction: column;
    }
    
    .filter-container {
        width: 100%;
        justify-content: flex-start;
    }
    
    .search-container {
        width: 100%;
    }
}

.exercise-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.exercise-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Modern Workout Builder */
.workout-builder {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.workout-exercise-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
    padding: 1.5rem;
    background: rgba(248, 250, 252, 0.8);
    border-radius: var(--border-radius);
    border: 1px solid rgba(99, 102, 241, 0.1);
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

/* Desktop collapsed state */
.workout-exercise-selector.collapsed {
    max-height: 80px;
    min-height: auto;
    height: auto;
    overflow: hidden;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.workout-exercise-selector.collapsed.empty {
    max-height: 70px;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.workout-exercise-selector.collapsed .exercise-selector-header {
    display: none;
}

.workout-exercise-selector.collapsed.empty .search-icon {
    display: none;
}

.workout-exercise-selector.expanded {
    max-height: none;
    overflow: visible;
    padding: 1.5rem;
}

.workout-exercise-selector.expanded .exercise-selector-header {
    display: block;
    animation: fadeInDown 0.3s ease;
}

.exercise-selector select {
    flex: 1;
    max-width: 400px;
}
}

.form-select {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    font-size: 1rem;
    transition: var(--transition);
    min-height: 48px;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Timer styles removed - simplified workout tracking */

.workout-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.workout-action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.workout-controls .btn-outline-danger {
    background: transparent;
    border: 2px solid #dc3545;
    color: #dc3545;
    transition: all 0.3s ease;
}

.workout-controls .btn-outline-danger:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.workout-exercise {
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: slideUp 0.3s ease;
}

.workout-exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.workout-exercise h4 {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.remove-exercise {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.remove-exercise:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

.sets-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.set-row {
    display: grid;
    grid-template-columns: auto 1fr 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.set-row:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.set-number {
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 40px;
    font-size: 0.9rem;
}

.set-input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
    min-height: 48px;
    width: 100%;
}

.set-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: white;
    transform: scale(1.02);
}

/* Effort Rating Styles */
.effort-rating-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.effort-rating-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 70px;
    margin: 0;
}

.effort-rating-slider {
    flex: 1;
    min-width: 120px;
    height: 8px;
    background: linear-gradient(to right, #10b981 0%, #f59e0b 50%, #ef4444 100%);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.effort-rating-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.effort-rating-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.effort-rating-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.effort-rating-value {
    min-width: 20px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Effort Rating Display in Workout Details */
.effort-rating-display {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Inline Effort Rating for Edit Mode */
.effort-rating-container.inline {
    flex-direction: row;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0 0.5rem;
    gap: 0.25rem;
}

.effort-rating-slider.inline {
    width: 100px;
    height: 6px;
    margin: 0;
}

.effort-rating-container.inline .effort-rating-value {
    font-size: 0.8rem;
    min-width: 15px;
}

/* Exercise-level effort rating */
.effort-rating-container.exercise-effort {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid var(--primary-color);
}

.add-set-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.add-set-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Forms */
.form-input, .form-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    min-height: 48px;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Messages */
/* Modern Notification System */
#message-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    width: calc(100vw - 40px);
    pointer-events: none;
}

@media (max-width: 768px) {
    #message-container {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: calc(100vw - 20px);
    }
}

.message {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border-radius: 16px;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.4;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transform: translateX(400px);
    opacity: 0;
    animation: slideInFromRight 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    position: relative;
    overflow: hidden;
}

.message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
    opacity: 0.8;
}

.message-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    margin-top: 1px;
    animation: iconPulse 2s ease-in-out infinite;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: currentColor;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 300;
    opacity: 0.7;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1px;
}

.message-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.2) rotate(90deg);
}

/* Success Messages */
.message-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.95) 100%);
    color: white;
    border-color: rgba(16, 185, 129, 0.4);
}

.message-success .message-icon {
    background: rgba(255, 255, 255, 0.2);
}

.message-success .message-icon::before {
    content: '✓';
}

/* Error Messages */
.message-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
    color: white;
    border-color: rgba(239, 68, 68, 0.4);
}

.message-error .message-icon {
    background: rgba(255, 255, 255, 0.2);
}

.message-error .message-icon::before {
    content: '✕';
}

/* Info Messages */
.message-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(29, 78, 216, 0.95) 100%);
    color: white;
    border-color: rgba(59, 130, 246, 0.4);
}

.message-info .message-icon {
    background: rgba(255, 255, 255, 0.2);
}

.message-info .message-icon::before {
    content: 'i';
    font-style: italic;
}

/* Warning Messages */
.message-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95) 0%, rgba(217, 119, 6, 0.95) 100%);
    color: white;
    border-color: rgba(245, 158, 11, 0.4);
}

.message-warning .message-icon {
    background: rgba(255, 255, 255, 0.2);
}

.message-warning .message-icon::before {
    content: '⚠';
}

/* Auth Messages */
.message-auth {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(79, 70, 229, 0.95) 100%);
    color: white;
    border-color: rgba(99, 102, 241, 0.4);
}

.message-auth .message-icon {
    background: rgba(255, 255, 255, 0.2);
}

.message-auth .message-icon::before {
    content: '🔐';
}

/* Animations */
@keyframes slideInFromRight {
    0% {
        transform: translateX(400px) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translateX(-20px) scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes slideOutToRight {
    0% {
        transform: translateX(0);
        opacity: 1;
        max-height: 100px;
        margin-bottom: 0.75rem;
    }
    100% {
        transform: translateX(400px);
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

.message-removing {
    animation: slideOutToRight 0.3s ease-in-out forwards;
}

/* Legacy message classes for backwards compatibility */
.success-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-weight: 500;
    animation: slideInFromRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.error-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-weight: 500;
    animation: slideInFromRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-weight: 500;
    animation: slideInFromRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    :root {
        --border-radius: 16px;
        --border-radius-lg: 24px;
        --mobile-margin: 1.25rem;
    }

    html {
        overflow-x: hidden;
    }

    body {
        font-size: 16px; /* Prevent zoom on input focus */
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    /* Ensure main content has proper horizontal spacing and no overflow */
    .main-content {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .main-content > * {
        margin-left: 0.25rem;
        margin-right: 0.25rem;
        max-width: calc(100% - 0.5rem);
        box-sizing: border-box;
    }

    /* Enhanced Workout Builder Mobile Layout */
    .workout-builder {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border: 1px solid rgba(255, 255, 255, 0.4);
        padding: 1.5rem;
        border-radius: var(--border-radius-lg);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        margin: 0 0 1.5rem 0;
    }

    .workout-exercises {
        margin-bottom: 1.5rem;
    }

    .workout-exercise {
        background: rgba(248, 250, 252, 0.95);
        border: 1px solid rgba(99, 102, 241, 0.15);
        border-radius: var(--border-radius);
        padding: 1.25rem;
        margin-bottom: 1rem;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    }

    .workout-exercise-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    }

    .workout-exercise h4 {
        font-weight: 700;
        color: var(--text-primary);
        font-size: 1.1rem;
        margin: 0;
    }

    .workout-subtitle {
        display: none !important;
    }

    .remove-exercise {
        color: var(--danger-color);
        background: rgba(239, 68, 68, 0.1);
        border: none;
        cursor: pointer;
        padding: 0.75rem;
        border-radius: var(--border-radius);
        transition: var(--transition);
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .remove-exercise:hover {
        background: var(--danger-color);
        color: white;
        transform: scale(1.05);
    }

    /* Enhanced Empty Workout State */
    .empty-workout {
        text-align: center;
        padding: 3rem 2rem;
        color: var(--text-secondary);
        background: rgba(99, 102, 241, 0.03);
        border-radius: var(--border-radius);
        border: 2px dashed rgba(99, 102, 241, 0.2);
        margin-bottom: 1.5rem;
    }

    .empty-icon {
        width: 4.5rem;
        height: 4.5rem;
        background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 1.5rem;
        font-size: 2rem;
        color: white;
        box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
    }

    .empty-workout h3 {
        font-size: 1.5rem;
        font-weight: 700;
        margin-bottom: 0.75rem;
        color: var(--text-primary);
    }

    .empty-workout p {
        font-size: 1rem;
        color: var(--text-secondary);
        line-height: 1.6;
        margin: 0;
    }

    .user-header {
        padding: 0.75rem 1.25rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(99, 102, 241, 0.1);
        min-height: 4rem;
        display: flex;
        align-items: center;
        box-sizing: border-box;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Purple background for app title on mobile */
    .app-title {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--gradient-primary);
        padding: 0.75rem;
        border-radius: 50%;
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        width: 3rem;
        height: 3rem;
    }

    .app-icon {
        font-size: 1.25rem;
        color: white;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .app-name {
        display: none; /* Hide on mobile */
    }

    .navbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        z-index: 999;
        height: 7rem;
        
        /* Contemporary glass morphism design */
        background: rgba(255, 255, 255, 0.88);
        backdrop-filter: blur(32px);
        -webkit-backdrop-filter: blur(32px);
        
        /* Professional gradient border */
        border-top: 1px solid rgba(255, 255, 255, 0.9);
        border-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent) 1;
        
        /* Modern shadow with depth */
        box-shadow: 
            0 -12px 48px rgba(0, 0, 0, 0.15),
            0 -4px 24px rgba(0, 0, 0, 0.08),
            0 -1px 6px rgba(0, 0, 0, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.95);
        
        /* Contemporary rounded corners */
        border-radius: 28px 28px 0 0;
        
        /* Layout and spacing */
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding: 1rem 0.5rem 1.5rem 0.5rem;
        box-sizing: border-box;
        overflow-x: hidden;
        
        /* Smooth premium transitions */
        transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
        
        /* Subtle gradient overlay for depth */
        background-image: linear-gradient(
            180deg, 
            rgba(255, 255, 255, 0.95) 0%, 
            rgba(255, 255, 255, 0.8) 100%
        );
    }

    .nav-content {
        height: 7rem;
        justify-content: center;
        padding: 0;
        max-width: none;
        margin: 0;
        align-items: center;
        display: flex;
        width: 100%;
    }

    .user-profile {
        display: none; /* Hide in mobile navbar */
    }

    .user-header-content {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        width: 100%;
    }

    .mobile-user-profile {
        position: static;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: rgba(255, 255, 255, 0.2);
        padding: 0.5rem 1rem;
        border-radius: var(--border-radius-lg);
        backdrop-filter: blur(10px);
        font-size: 0.9rem;
    }

    .mobile-user-profile .user-avatar {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.8rem;
    }

    .mobile-user-profile .logout-btn {
        min-width: 44px;
        min-height: 44px;
        width: auto;
        height: auto;
        color: rgba(255, 255, 255, 0.8);
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    .fab {
        bottom: 7.5rem;
        right: 1.5rem;
        width: 3.5rem;
        height: 3.5rem;
        font-size: 1.3rem;
    }


    /* Consolidated with main mobile rule */

    .modal-content {
        margin: 2% auto;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }


    .modal-body {
        padding: 1.5rem;
        max-height: calc(100vh - 200px);
    }

    .nav-menu {
        justify-content: space-around;
        flex: 1;
        max-width: 400px;
        background: transparent;
    }

    .nav-content {
        padding: 1rem;
        height: auto;
        min-height: 5rem;
        justify-content: center;
    }

    .nav-brand {
        display: none;
    }

    .user-profile {
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 300;
        background: rgba(255, 255, 255, 0.95);
        padding: 0.75rem 1rem;
        border-radius: var(--border-radius-lg);
        box-shadow: var(--shadow-lg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(99, 102, 241, 0.1);
    }

    .nav-menu {
        width: 100%;
        justify-content: space-around;
        gap: 0;
        max-width: 400px;
    }


    .main-content {
        padding: 1.5rem 1.25rem 8rem 1.25rem;
        margin-top: 7rem;
    }

    .section-header {
        padding-top: 0;
        margin-bottom: 2rem;
    }

    .section-header h1 {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .stat-icon {
        width: 3.5rem;
        height: 3.5rem;
        margin: 0 auto;
    }

    .exercise-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .exercise-card {
        padding: 1.5rem;
    }

    /* Enhanced Exercise Selector Mobile Layout */
    .workout-exercise-selector {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
        background: rgba(248, 250, 252, 0.9);
        border-radius: var(--border-radius);
        border: 1px solid rgba(99, 102, 241, 0.1);
        margin-bottom: 1.5rem;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .workout-exercise-selector {
        position: relative;
        width: 100%;
    }

    .workout-exercise-selector .search-icon {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-secondary);
        font-size: 1.1rem;
        z-index: 2;
    }

    .workout-exercise-selector #addExerciseSearch {
        padding-left: 3rem;
        background: white;
        border: 2px solid var(--border-color);
        border-radius: var(--border-radius);
        font-size: 1rem;
        min-height: 52px;
        width: 100%;
        box-sizing: border-box;
        transition: var(--transition);
    }

    .workout-exercise-selector #addExerciseSearch:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    /* Removed duplicate rule */

    /* Enhanced Workout Controls Mobile Layout */
    .workout-controls {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
        background: rgba(248, 250, 252, 0.9);
        border-radius: var(--border-radius);
        border: 1px solid rgba(99, 102, 241, 0.1);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    }
    
    .workout-action-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .workout-controls .btn {
        padding: 1.25rem;
        font-size: 1.1rem;
        font-weight: 700;
        border-radius: var(--border-radius);
        min-height: 56px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        transition: var(--transition);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
    }

    .workout-controls .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    }

    .workout-controls .btn-success {
        background: var(--gradient-success);
    }

    .workout-controls .btn-primary {
        background: var(--gradient-primary);
    }
    
    .workout-controls .btn-outline-danger {
        background: transparent;
        border: 2px solid #dc3545;
        color: #dc3545;
        font-weight: 700;
    }
    
    .workout-controls .btn-outline-danger:hover {
        background: #dc3545;
        color: white;
        box-shadow: 0 4px 20px rgba(220, 53, 69, 0.3);
    }


    /* Enhanced Set Row Mobile Layout - Use Flexbox instead of Grid */
    .workout-exercise .set-row {
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.75rem;
        padding: 1rem 0.75rem;
        background: white;
        border-radius: var(--border-radius);
        border: 2px solid var(--border-color);
        transition: var(--transition);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
        margin-bottom: 0.75rem;
    }
    
    /* Hide set-number on mobile */
    .workout-exercise .set-row .set-number {
        display: none !important;
    }
    
    /* Make inputs equal size */
    .workout-exercise .set-row .set-input {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;
    }
    
    /* Unit label and remove button take minimal space */
    .workout-exercise .set-row .unit-label,
    .workout-exercise .set-row .btn-icon {
        flex: none !important;
    }
    
    .set-row:focus-within {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .sets-container {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem;
    }

    .set-number {
        font-weight: 700;
        color: var(--text-secondary);
        min-width: 44px;
        min-height: 44px;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(99, 102, 241, 0.1);
        border-radius: var(--border-radius);
        padding: 0.75rem;
    }


    /* Enhanced Set Input Mobile Layout */
    
    .set-input:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        background: white;
        transform: scale(1.02);
    }
    
    .unit-label {
        color: var(--text-secondary);
        font-weight: 500;
        font-size: 0.85rem;
        margin-left: 0.75rem;
        text-align: center;
        min-width: 60px;
    }

    /* Enhanced Workout Timer Mobile Layout */
    /* Timer styles removed */ .removed-timer {
        font-size: 2.5rem;
        font-weight: 800;
        color: var(--primary-color);
        font-family: 'SF Mono', 'Monaco', monospace;
        text-align: center;
        padding: 1.5rem;
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.05));
        border-radius: var(--border-radius);
        margin-bottom: 1.5rem;
        border: 1px solid rgba(99, 102, 241, 0.2);
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }

    /* Timer container styles removed */ .removed-timer-container {
        display: flex;
        justify-content: center;
        margin-bottom: 1.5rem;
    }

    .form-input, .form-textarea, .form-select {
        padding: 1rem;
        font-size: 16px; /* Prevent zoom */
        min-height: 52px;
    }
    
    /* Enhanced Add Set Button Mobile Layout */
    .add-set-btn {
        background: var(--gradient-primary) !important;
        color: white !important;
        border: none !important;
        padding: 1rem 1.5rem !important;
        border-radius: var(--border-radius) !important;
        cursor: pointer;
        font-size: 1rem !important;
        font-weight: 600 !important;
        margin-top: 1rem !important;
        transition: var(--transition) !important;
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        min-height: 52px !important;
        width: 100% !important;
    }
    
    .add-set-btn:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4) !important;
    }
    
    .add-set-btn:active {
        transform: translateY(0) !important;
        box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3) !important;
    }
    
    /* Enhanced Mobile Effort Rating Sliders */
    .effort-rating-slider {
        min-width: 200px !important;
        width: 100% !important;
        max-width: 280px !important;
        height: 10px !important;
        border-radius: 5px !important;
        background: linear-gradient(to right, #10b981 0%, #f59e0b 50%, #ef4444 100%) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
    
    .effort-rating-slider::-webkit-slider-thumb {
        width: 22px !important;
        height: 22px !important;
        background: white !important;
        border: 3px solid var(--primary-color) !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2) !important;
        transition: var(--transition) !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
    
    .effort-rating-slider::-webkit-slider-thumb:hover {
        transform: scale(1.15) !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    }
    
    .effort-rating-slider::-moz-range-thumb {
        width: 22px !important;
        height: 22px !important;
        background: white !important;
        border: 3px solid var(--primary-color) !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2) !important;
        transition: var(--transition) !important;
    }
    
    
    .effort-rating-label {
        font-size: 0.95rem !important;
        color: var(--text-primary) !important;
        font-weight: 600 !important;
        min-width: 120px !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }
    
    .effort-rating-value {
        min-width: 30px !important;
        text-align: center !important;
        font-weight: 700 !important;
        color: var(--primary-color) !important;
        font-size: 1.1rem !important;
        background: white !important;
        padding: 0.5rem !important;
        border-radius: var(--border-radius) !important;
        border: 2px solid var(--primary-color) !important;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2) !important;
    }
    
    /* Enhanced mobile effort rating container layout */
    .effort-rating-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    
    .effort-rating-container .effort-rating-label {
        text-align: center !important;
        min-width: auto !important;
    }
    
    /* Slider and value in a row */
    .effort-rating-slider-row {
        display: flex !important;
        align-items: center !important;
        gap: 1rem !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Consolidated with main mobile rule */
    
    .user-header {
        padding: 0.75rem 1rem;
    }
    
    .navbar {
        margin: 0 0.25rem 0 0.25rem;
    }

    .section-header h1 {
        font-size: 1.75rem;
    }

    .set-row {
        gap: 0.75rem;
        padding: 0.75rem 0.5rem;
    }


    /* Ultra-mobile optimizations */
    .workout-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 1rem;
        min-height: auto;
    }

    .workout-status {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
        align-self: flex-end;
        position: absolute;
        top: 1rem;
        right: 1rem;
    }

    .workout-content {
        width: 100%;
        padding-right: 0;
    }

    .workout-actions {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        flex-shrink: 0;
        align-items: center;
    }

    .delete-workout {
        position: static;
        width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
        opacity: 0.7;
    }

    .recent-workouts-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .recent-workouts-header .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Enhanced Touch Optimizations and Animations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .nav-btn:hover,
    .btn-icon:hover {
        transform: none;
        background: var(--primary-hover) !important;
        border-color: var(--primary-color) !important;
        color: white !important;
    }
    
    .btn-secondary:hover {
        background: var(--secondary-color) !important;
        border-color: var(--secondary-color) !important;
        color: white !important;
    }
    
    .btn-outline-danger:hover {
        background: #dc3545 !important;
        border-color: #dc3545 !important;
        color: white !important;
    }

    .btn:active,
    .nav-btn:active {
        transform: scale(0.96);
        transition: all 0.15s ease-out;
    }
    
    /* Enhanced mobile navbar touch feedback */
    .nav-btn:active {
        transform: scale(0.94);
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 
            0 1px 6px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.95);
    }
    
    .nav-btn.active:active {
        transform: scale(0.96);
        background: linear-gradient(135deg, #3730a3 0%, #6d28d9 100%);
        box-shadow: 
            0 4px 16px rgba(79, 70, 229, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    
    /* Mobile-specific button animations */
    .workout-controls .btn:active {
        transform: scale(0.98);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .add-set-btn:active {
        transform: scale(0.98) !important;
        box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3) !important;
    }
    
    /* Mobile workout item tap animation */
    .workout-item:active {
        transform: scale(0.98);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    /* Mobile set input tap animation */
    .set-input:active {
        transform: scale(0.99);
    }
    
    /* Mobile delete button animation */
    .delete-workout:active {
        transform: scale(0.95);
    }
    
    .remove-exercise:active {
        transform: scale(0.95);
    }
}

/* Dark mode support (future) */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0f172a;
        --card-background: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --border-color: #334155;
    }
}

/* Empty states */
.empty-workout {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    width: 4rem;
    height: 4rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.empty-workout h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-workout p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Workout Timer */
/* Timer container styles removed */ .removed-timer-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

/* Workout Date Controls */
.workout-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.workout-date-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    min-height: 50px;
}

/* Removed label styles - no longer needed */

.date-input {
    flex: 1;
    min-width: 0;
}

.workout-date-container .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    max-width: 80px;
}

.workout-edit-controls {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.edit-controls-section h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.edit-controls-section .form-group {
    margin-bottom: 1rem;
}

.edit-controls-section .form-group:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    /* Enhanced Workout Header Mobile Layout */
    .workout-header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .workout-date-container {
        padding: 1rem 1.2rem;
        min-height: 60px;
    }
    
    /* Removed mobile label styles - no longer needed */
    
    .date-input {
        min-width: 150px;
        flex: 2;
        padding: 0.875rem 1rem;
        border: 2px solid var(--border-color);
        border-radius: var(--border-radius);
        background: white;
        font-size: 1.1rem;
        transition: var(--transition);
        min-height: 50px;
        font-weight: 500;
    }
    
    .date-input:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }
    
    .workout-date-container .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        font-weight: 600;
        border-radius: var(--border-radius);
        min-height: 44px;
        white-space: nowrap;
        flex: 0 0 auto;
        max-width: 80px;
    }
    
}

/* Pull-to-refresh effect */
@media (max-width: 768px) {
    .main-content {
        overscroll-behavior: contain;
        padding: 1.5rem 1.25rem 8rem 1.25rem;
        margin-top: 7rem;
    }
}

/* Enhanced Scroll Behavior and Mobile Animations */
html {
    scroll-behavior: smooth;
}

/* Mobile-specific smooth animations */
@media (max-width: 768px) {
    /* Workout section slide-in animation */
    .workout-builder,
    .workout-exercise,
    .workout-item {
        animation: slideInUp 0.6s ease-out;
    }
    
    /* Stagger animation for workout items */
    .workout-item:nth-child(1) { animation-delay: 0.1s; }
    .workout-item:nth-child(2) { animation-delay: 0.2s; }
    .workout-item:nth-child(3) { animation-delay: 0.3s; }
    .workout-item:nth-child(4) { animation-delay: 0.4s; }
    .workout-item:nth-child(5) { animation-delay: 0.5s; }
    .workout-item:nth-child(6) { animation-delay: 0.6s; }
    
    /* Set row animation */
    .set-row {
        animation: fadeInScale 0.4s ease-out;
    }
    
    /* Modal animation enhancement */
    .modal.active {
        animation: modalFadeIn 0.3s ease-out;
    }
    
    .modal-content {
        animation: modalSlideUp 0.3s ease-out;
    }
    
    /* Search dropdown animation */
    /* Removed duplicate .search-dropdown rule */
    
    /* Timer pulse animation */
    /* Timer styles removed */ .removed-timer {
        animation: timerPulse 2s ease-in-out infinite;
    }
    
    /* Empty state animation */
    .empty-icon {
        animation: iconBounce 2s ease-in-out infinite;
    }
}

/* Keyframe animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes timerPulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    }
}

@keyframes iconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* ====================================
   ENHANCED GOALS MODAL STYLES
   ==================================== */

/* Goals Modal Base Styles */
#goalsModal {
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.6);
    animation: modalFadeIn 0.3s ease-out;
}

#goalsModal .modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: modalSlideUp 0.3s ease-out;
}

/* Modal Header Improvements */
#goalsModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

#goalsModal .modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

#goalsModal .modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

#goalsModal .modal-header h2 i {
    font-size: 2rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#goalsModal .modal-header .close {
    color: white;
    font-size: 2rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#goalsModal .modal-header .close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}


/* Goals Summary Stats */
.goals-summary {
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.goal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Goals List Styles */
.goals-list {
    padding: 2rem;
    max-height: 50vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 transparent;
}

.goals-list::-webkit-scrollbar {
    width: 6px;
}

.goals-list::-webkit-scrollbar-track {
    background: transparent;
}

.goals-list::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.goals-list::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Enhanced Goal Cards */
.goal-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.goal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.goal-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.goal-card:hover::before {
    opacity: 1;
}

.goal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.goal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.goal-category {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: #e9ecef;
    color: #495057;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goal-category.strength { background: #e3f2fd; color: #1976d2; }
.goal-category.cardio { background: #fce4ec; color: #c2185b; }
.goal-category.body_composition { background: #e8f5e8; color: #388e3c; }
.goal-category.consistency { background: #fff3e0; color: #f57c00; }
.goal-category.progressive { background: #f3e5f5; color: #7b1fa2; }

.goal-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.goal-progress-section {
    margin-bottom: 1rem;
}

.goal-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.goal-progress-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
}

.goal-progress-percentage {
    font-size: 0.875rem;
    font-weight: 600;
    color: #667eea;
}

.goal-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.8s ease-out;
    position: relative;
}

.goal-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.goal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f1f3f4;
    font-size: 0.875rem;
    color: #6c757d;
}

.goal-actions {
    display: flex;
    gap: 0.5rem;
}

.goal-action-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.goal-action-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.goal-action-btn.primary {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.goal-action-btn.primary:hover {
    background: #5a6fd8;
    border-color: #5a6fd8;
}

/* Goal Creation Form Styles */
.goal-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.goal-type-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.goal-type-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
}

.goal-type-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.goal-type-card i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 1rem;
    display: block;
}

.goal-type-card h4 {
    margin: 0 0 0.5rem 0;
    color: #212529;
    font-weight: 600;
}

.goal-type-card p {
    margin: 0;
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.template-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.template-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.template-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.template-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.template-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.empty-state h4 {
    margin: 0 0 0.5rem 0;
    color: #495057;
    font-weight: 600;
}

.empty-state p {
    margin: 0 0 2rem 0;
    font-size: 0.95rem;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    #goalsModal .modal-content {
        width: 96%;
        max-width: calc(100vw - 2rem);
        max-height: 90vh;
        margin: 5vh 2% 0 2%;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    #goalsModal .modal-header {
        padding: 1rem 1rem 0.5rem 1rem;
        background: rgba(102, 126, 234, 0.03);
        flex-shrink: 0;
        border-radius: 16px 16px 0 0;
        border-bottom: 1px solid rgba(102, 126, 234, 0.08);
    }
    
    #goalsModal .modal-header h2 {
        font-size: 1.3rem;
        font-weight: 700;
        color: #1a202c;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    #goalsModal .modal-header h2 i {
        color: #667eea;
        font-size: 1.2rem;
    }
    
    #goalsModal .modal-header .close {
        font-size: 1.5rem;
        line-height: 1;
        padding: 0.5rem;
        right: 0.5rem;
        top: 0.5rem;
    }
    
    
    .goals-summary {
        padding: 1.5rem;
        flex-shrink: 0;
    }
    
    .goal-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .goals-list {
        padding: 1.5rem;
        max-height: 40vh;
    }
    
    .goal-card {
        padding: 1rem;
    }
    
    .goal-title {
        font-size: 1.1rem;
    }
    
    .goal-meta {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .goal-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .goal-types-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .goal-type-card {
        padding: 1rem;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    #goalsModal .modal-header {
        padding: 1rem;
    }
    
    #goalsModal .modal-header h2 {
        font-size: 1.25rem;
    }
    
    
    .goals-summary {
        padding: 1rem;
    }
    
    .goal-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .goals-list {
        padding: 1rem;
    }
    
    .goal-card-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .goal-category {
        align-self: flex-start;
    }
}

/* Dark mode support for goals modal */
@media (prefers-color-scheme: dark) {
    #goalsModal .modal-content {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .goals-summary {
        background: linear-gradient(135deg, #2a2a2a 0%, #333333 100%);
    }
    
    .stat-item {
        background: #2a2a2a;
        color: #ffffff;
    }
    
    .goal-card {
        background: #2a2a2a;
        border-color: #404040;
        color: #ffffff;
    }
    
    .goal-description {
        color: #b0b0b0;
    }
    
    .goal-progress-bar {
        background: #404040;
    }
}

/* Priority Indicators */
.priority-high {
    color: #dc3545 !important;
    font-weight: 600;
}

.priority-medium {
    color: #fd7e14 !important;
    font-weight: 500;
}

.priority-low {
    color: #6c757d !important;
    font-weight: 400;
}

.goal-meta .goal-priority {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.goal-meta .goal-timeline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.goal-meta .goal-timeline i {
    color: #6c757d;
}

/* Progress fill color variations */
.goal-progress-fill.completed {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.goal-progress-fill.high {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.goal-progress-fill.medium {
    background: linear-gradient(90deg, #ffc107 0%, #fd7e14 100%);
}

.goal-progress-fill.low {
    background: linear-gradient(90deg, #6c757d 0%, #adb5bd 100%);
}

/* Template specific styles */
.template-target {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: #667eea;
    font-weight: 500;
}

.template-priority {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced hover effects */
.goal-card:hover .goal-title {
    color: #667eea;
}

.template-card:hover .template-title {
    color: #667eea;
}

/* Loading states */
.goals-list.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #6c757d;
}

.goals-list.loading i {
    font-size: 2rem;
    margin-right: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Accessibility improvements */
.goal-action-btn:focus,
.goal-type-card:focus,
.template-card:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Dashboard Goals Preview Styles */
.goals-preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
    overflow: visible;
    max-height: none;
}

.primary-goal-preview {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.primary-goal-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
}

.goal-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.goal-summary-item.primary {
    margin-bottom: 0.5rem;
}

.goal-info h5 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.3;
}

.goal-info .goal-category {
    font-size: 0.75rem;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-block;
}

.goal-progress-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 120px;
}

.goal-progress-mini .progress-percentage {
    font-weight: 700;
    font-size: 1.1rem;
    color: #667eea;
    color: #667eea;
    font-size: 1rem;
    min-width: 35px;
}

.mini-progress-bar {
    width: 60px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.8s ease-out;
}

.primary-badge {
    position: absolute;
    top: -8px;
    right: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.other-goals-summary {
    text-align: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #dee2e6;
}

.other-goals-text {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.goals-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.view-all-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* Ensure dashboard goals list is not scrollable */
#dashboardGoalsList {
    overflow: visible;
    max-height: none;
    padding: 0;
}

.goals-empty {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.goals-empty i {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.goals-empty h4 {
    margin: 0 0 0.5rem 0;
    color: #495057;
    font-weight: 600;
}

.goals-empty p {
    margin: 0 0 1.5rem 0;
    font-size: 0.95rem;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .goals-preview {
        gap: 1rem;
        margin-top: 1rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .primary-goal-preview {
        padding: 1.25rem;
        border-radius: 16px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(102, 126, 234, 0.15);
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .goal-summary-item {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        width: 100%;
        overflow-x: hidden;
    }
    
    .goal-info {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .goal-info h5 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        color: #1a202c;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    .goal-info .goal-category {
        font-size: 0.75rem;
        padding: 0.3rem 0.75rem;
        border-radius: 20px;
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
        color: #667eea;
        font-weight: 600;
        display: inline-block;
        max-width: 100%;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }
    
    .goal-progress-mini {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem;
        background: rgba(102, 126, 234, 0.05);
        border-radius: 12px;
        border: 1px solid rgba(102, 126, 234, 0.1);
        box-sizing: border-box;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .goal-progress-mini .progress-percentage {
        font-size: 1.2rem;
        font-weight: 700;
        color: #667eea;
        min-width: 60px;
        text-align: right;
    }
    
    .mini-progress-bar {
        flex: 1;
        margin: 0 0.75rem;
        height: 6px;
        background: rgba(102, 126, 234, 0.1);
        border-radius: 8px;
        overflow: hidden;
        min-width: 60px;
    }
    
    .mini-progress-bar .progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
        border-radius: 8px;
        transition: width 0.3s ease;
    }
    
    .primary-badge {
        position: static;
        align-self: flex-start;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 0.4rem 0.8rem;
        border-radius: 16px;
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
        max-width: 100%;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        margin-top: 0.5rem;
    }
}

/* Print styles */
@media print {
    #goalsModal {
        position: static;
        background: white;
        backdrop-filter: none;
    }
    
    #goalsModal .modal-content {
        box-shadow: none;
        max-width: none;
        width: 100%;
        max-height: none;
    }
    
    .goal-actions {
        display: none !important;
    }
}

/* Touch callout disable for better mobile UX */
.btn, .nav-btn, .btn-icon, .set-input {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Enhanced Input Mobile Optimizations */
.set-input, .form-input, .form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Mobile-specific focus animations */
@media (max-width: 768px) {
    .set-input:focus,
    .form-input:focus,
    .form-select:focus {
        animation: inputFocus 0.2s ease-out;
    }
    
    .workout-exercise {
        transition: all 0.3s ease;
    }
    
    .workout-exercise:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }
    
    /* Enhanced button press feedback */
    .btn {
        position: relative;
        overflow: hidden;
    }
    
    .btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        transition: width 0.3s ease, height 0.3s ease;
    }
    
    .btn:active::before {
        width: 300px;
        height: 300px;
    }
    
    /* Smooth transitions for all interactive elements */
    .workout-item,
    .set-row,
    .remove-exercise,
    .delete-workout,
    .add-set-btn {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Enhanced hover states for mobile */
    .workout-item:hover .delete-workout {
        opacity: 1;
        transform: scale(1.1);
    }
    
    /* Progressive disclosure animation */
    .workout-exercises .workout-exercise {
        opacity: 0;
        animation: slideInLeft 0.5s ease-out forwards;
    }
    
    .workout-exercises .workout-exercise:nth-child(1) { animation-delay: 0.1s; }
    .workout-exercises .workout-exercise:nth-child(2) { animation-delay: 0.2s; }
    .workout-exercises .workout-exercise:nth-child(3) { animation-delay: 0.3s; }
    .workout-exercises .workout-exercise:nth-child(4) { animation-delay: 0.4s; }
    .workout-exercises .workout-exercise:nth-child(5) { animation-delay: 0.5s; }
}

@keyframes inputFocus {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0px rgba(99, 102, 241, 0.1);
    }
    100% {
        transform: scale(1.02);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Better tap targets for mobile */
@media (max-width: 768px) {
    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }
    
    .remove-exercise {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Smooth transitions for mobile */
@media (hover: none) and (pointer: coarse) {
    .nav-btn::before,
    .btn::before {
        transition: none;
    }
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    animation: fadeInSimple 0.3s ease;
}

.modal-content {
    background: var(--card-background);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-body {
    overflow-y: auto;
    flex: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #ffffff !important;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
}


.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Enhanced Modal Styling */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10001;
    animation: fadeInSimple 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

@keyframes fadeInSimple {
    from { opacity: 0; }
    to { opacity: 1; }
}


@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem;
    position: relative;
    text-align: center;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="modalGrid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23modalGrid)"/></svg>');
    opacity: 0.3;
}

.modal-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.modal-header h2::before {
    content: '💪';
    font-size: 2rem;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
    background: rgba(248, 250, 252, 0.5);
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100%;
    word-wrap: break-word;
}

/* Workout details specific styling */
#workoutDetailsModal .modal-content {
    max-width: min(90vw, 800px);
    width: 95%;
    margin: 2vh auto;
    max-height: 96vh;
}

#workoutDetailsModal .modal-body {
    max-height: calc(96vh - 160px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 1.5rem;
}

#workoutDetailsContent {
    width: 100%;
    overflow-x: hidden;
}

#workoutDetailsContent * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive workout details layout */
.workout-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}


.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.exercise-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.set-item {
    background: rgba(99, 102, 241, 0.1);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.9rem;
}

.set-number {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.set-details {
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #workoutDetailsModal .modal-content {
        width: 98%;
        margin: 1vh auto;
        max-height: 98vh;
        border-radius: var(--border-radius);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    #workoutDetailsModal .modal-body {
        padding: 1rem;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
    
    .exercise-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    
    .set-item {
        padding: 0.5rem;
    }
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label::before {
    content: '📝';
    font-size: 1rem;
}

.form-group:nth-child(2) label::before {
    content: '🏃';
}

.form-group:nth-child(3) label::before {
    content: '⚖️';
}

.form-input,
.form-select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    position: relative;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem 2rem 2rem;
    background: white;
}

.modal-footer .btn {
    min-width: 120px;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
}

/* FAB Enhancement */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 4rem;
    height: 4rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
    z-index: 500;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.fab:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.5);
}
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.set-row {
    animation: scaleIn 0.2s ease;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* Interactive feedback */
.btn:active {
    transform: scale(0.98);
}

.set-input:focus {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus-visible,
.nav-btn:focus-visible,
.set-input:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-secondary: #333;
    }
}

/* Recent Workouts Enhancement - 2x3 Grid */
.recent-workouts {
    margin-top: 2rem;
}

.recent-workouts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.recent-workouts-header .btn {
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Enhanced Friends & Messages System */
.friend-item, .conversation-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.friend-item:hover, .conversation-item:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

.friend-info, .conversation-info {
    flex: 1;
}

.friend-info h4, .conversation-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-weight: 600;
}

.username, .last-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.friend-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.friend-actions .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.friend-actions .btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.friend-actions .btn-secondary {
    background: var(--gradient-secondary);
    color: white;
}

.friend-actions .btn-outline {
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.friend-actions .btn-outline:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.friend-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Enhanced Chat Interface */
.chat-area {
    border-radius: var(--border-radius-lg);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(99, 102, 241, 0.15);
    backdrop-filter: blur(10px);
    margin-top: 1rem;
    overflow: hidden;
}

.chat-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    height: auto;
    overflow-y: visible;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 200px;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    animation: slideIn 0.3s ease;
    padding: 0 0.5rem;
}

.message.sent {
    justify-content: flex-end;
}

.message-content {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message.sent .message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-content {
    background: #f1f3f5;
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.25rem;
    gap: 0.5rem;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    white-space: nowrap;
}

.message-status {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    opacity: 0.8;
}

.message-status.read {
    color: #22c55e;
}

.message-status.sent {
    color: rgba(255, 255, 255, 0.8);
}

.message-status i {
    font-size: 0.65rem;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

.typing-dots {
    display: inline-flex;
    gap: 2px;
    margin-left: 0.5rem;
}

.typing-dots span {
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.message-input-area {
    padding: 1rem;
    background: white;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.chat-input-container {
    flex: 1;
    position: relative;
}

.message-input-area input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    background: #f8fafc;
    transition: all 0.3s ease;
    font-size: 16px; /* Prevent zoom on iOS */
    min-height: 44px; /* Touch target */
    resize: none;
    max-height: 120px;
    line-height: 1.5;
}

.message-input-area input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.message-input-area input::placeholder {
    color: #94a3b8;
}

.send-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.send-button i {
    font-size: 1rem;
}

.message-counter {
    position: absolute;
    bottom: -20px;
    right: 0;
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: none;
}

/* Mobile specific improvements */
@media (max-width: 768px) {
    .message-input-area {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .message-input-area input {
        font-size: 16px !important; /* Prevent zoom */
        border-radius: 18px;
    }
    
    .send-button {
        min-width: 40px;
        min-height: 40px;
        padding: 0.5rem;
    }
}

.chat-input {
    padding: 1rem;
    background: white;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 2rem;
    background: rgba(248, 250, 252, 0.8);
    transition: all 0.3s ease;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.chat-input button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-input button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}


.unread-badge {
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 1.5rem;
    text-align: center;
}

.friends-workouts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.friends-workouts-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.friends-workouts-header .btn-sm {
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.friends-workout-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .friends-workout-list {
        grid-template-columns: 1fr;
    }
}

.friend-workout-item {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.9rem;
}

.friend-workout-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.friend-workout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.friend-avatar {
    position: relative;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
}

.friend-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.workout-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.workout-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.workout-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.workout-stat i {
    color: var(--primary-color);
}

.workout-exercises-preview {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.friend-workout-item.expanded .workout-exercises-preview {
    display: block;
}

.exercise-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.exercise-item:last-child {
    border-bottom: none;
}

.exercise-name {
    font-weight: 500;
    color: var(--text-primary);
}

.exercise-sets {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.no-friends-workouts {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.no-friends-workouts i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.no-friends-workouts h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Mobile responsive for friends workouts */
@media (max-width: 768px) {
    .friends-workouts-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .friend-workout-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .workout-summary {
        flex-wrap: wrap;
    }
}

.workout-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    min-height: 200px;
}

/* Enhanced Mobile Workout List Layout */
@media (max-width: 768px) {
    .workout-list {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 1rem;
        min-height: auto;
    }

    /* Recent Workouts Header Enhancement */
    .recent-workouts {
        margin-bottom: 2rem;
    }

    .recent-workouts-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding: 1rem 1.5rem;
        background: rgba(255, 255, 255, 0.9);
        border-radius: var(--border-radius);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: 1px solid rgba(99, 102, 241, 0.1);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    }

    .recent-workouts-header h2 {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0;
    }

    .recent-workouts-header .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        font-weight: 600;
        border-radius: var(--border-radius);
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    }
}

.recent-workouts h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.workout-item {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 1rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
    height: 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Enhanced Mobile Workout Item Layout */
@media (max-width: 768px) {
    .workout-item {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border: 1px solid rgba(99, 102, 241, 0.15);
        padding: 1.5rem;
        border-radius: var(--border-radius-lg);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        transition: var(--transition);
        position: relative;
        cursor: pointer;
        height: auto;
        min-height: 80px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .workout-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    }

    .workout-status {
        width: 3rem;
        height: 3rem;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--gradient-success);
        color: white;
        font-size: 1.2rem;
        box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
        flex-shrink: 0;
    }

    .workout-content {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        flex: 1;
    }

    .workout-date {
        font-size: 0.85rem;
        color: var(--text-secondary);
        font-weight: 500;
        text-align: left;
        margin: 0;
    }

    .workout-details {
        text-align: left;
    }

    .workout-details h4 {
        font-weight: 700;
        margin: 0 0 0.25rem 0;
        color: var(--text-primary);
        font-size: 1.1rem;
        line-height: 1.2;
    }

    .workout-details p {
        color: var(--text-secondary);
        font-size: 0.85rem;
        margin: 0;
        line-height: 1.3;
    }

    .delete-workout {
        opacity: 0.7;
        color: var(--danger-color);
        background: rgba(239, 68, 68, 0.1);
        border: none;
        border-radius: var(--border-radius);
        width: 2.5rem;
        height: 2.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        position: static;
        font-size: 1rem;
        transition: var(--transition);
        flex-shrink: 0;
    }

    .delete-workout:hover {
        opacity: 1;
        background: var(--danger-color);
        color: white;
        transform: scale(1.05);
    }

    .workout-item:hover .delete-workout {
        opacity: 1;
    }
}

.workout-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.workout-item:hover .delete-workout {
    opacity: 1;
}

.workout-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.workout-actions .btn-icon {
    opacity: 0;
    transition: all 0.3s ease;
}

.workout-item:hover .workout-actions .btn-icon {
    opacity: 1;
}

.workout-actions .create-template {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.workout-actions .create-template:hover {
    background: #5a6fd8;
    transform: scale(1.05);
}

.delete-workout {
    opacity: 0;
    transition: var(--transition);
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
    border: none;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.7rem;
}
    cursor: pointer;
}

.delete-workout:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

.workout-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.workout-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

.workout-details {
    text-align: center;
}

.workout-details h4 {
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.workout-details p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0;
}

.workout-status {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success-color);
    color: white;
    margin: 0 auto;
    font-size: 0.8rem;
}
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.workout-status.completed {
    background: var(--gradient-success);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 6rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .fab {
        bottom: 7.5rem;
        right: 1rem;
        width: 3.5rem;
        height: 3.5rem;
    }
}

/* Clear Workout Button - Floating */
.clear-workout-btn {
    position: fixed;
    bottom: 6rem;
    left: 1.5rem;
    width: auto;
    height: 3rem;
    min-width: 3rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    border-radius: 2rem;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.clear-workout-btn:hover {
    background: linear-gradient(135deg, #c82333, #b21e2f);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(220, 53, 69, 0.4);
}

.clear-workout-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .clear-workout-btn {
        bottom: 12rem;
        left: 1rem;
        width: 3rem;
        height: 3rem;
        min-width: 3rem;
        padding: 0;
        border-radius: 50%;
        font-size: 1rem;
        justify-content: center;
    }

    .clear-workout-btn span {
        display: none;
    }
}

/* Floating Save Button */
.floating-save-btn {
    position: fixed;
    bottom: 2.5rem;
    left: 1.5rem;
    width: auto;
    height: 3rem;
    min-width: 3rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    border: none;
    border-radius: 2rem;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.floating-save-btn:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.4);
}

.floating-save-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .floating-save-btn {
        bottom: 8.5rem;
        left: 1rem;
        width: 3rem;
        height: 3rem;
        min-width: 3rem;
        padding: 0;
        border-radius: 50%;
        font-size: 1rem;
        justify-content: center;
    }

    .floating-save-btn span {
        display: none;
    }
}

/* Leaderboard */
.leaderboard-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Enhanced Leaderboard Styling */
.leaderboard-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.5rem;
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(10px);
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
}

.filter-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.filter-btn:hover:not(.active) {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.leaderboard-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.leaderboard-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.leaderboard-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.leaderboard-item.rank-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 255, 255, 0.95));
    border: 2px solid #ffd700;
}

.leaderboard-item.rank-1::before {
    background: linear-gradient(135deg, #ffd700, #ffb700);
}

.leaderboard-item.rank-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(255, 255, 255, 0.95));
    border: 2px solid #c0c0c0;
}

.leaderboard-item.rank-2::before {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
}

.leaderboard-item.rank-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(255, 255, 255, 0.95));
    border: 2px solid #cd7f32;
}

.leaderboard-item.rank-3::before {
    background: linear-gradient(135deg, #cd7f32, #b8651c);
}

.rank-badge {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    position: relative;
    font-size: 1.3rem;
    box-shadow: var(--shadow);
    min-width: 4rem;
}

.rank-1 .rank-badge {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.rank-2 .rank-badge {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    box-shadow: 0 6px 20px rgba(192, 192, 192, 0.4);
}

.rank-3 .rank-badge {
    background: linear-gradient(135deg, #cd7f32, #b8651c);
    box-shadow: 0 6px 20px rgba(205, 127, 50, 0.4);
}

.rank-badge:not(.rank-1):not(.rank-2):not(.rank-3) {
    background: var(--gradient-primary);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b !important; /* Force dark color for leaderboard visibility */
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.crown-icon {
    color: #ffd700;
    font-size: 1.5rem;
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(15deg) scale(1.1); }
}

.user-stats {
    display: flex;
    gap: 2rem;
    font-size: 0.95rem;
    color: #64748b !important; /* Force dark secondary color for leaderboard visibility */
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

/* Leaderboard specific overrides for visibility - CRITICAL: Purple text fix */
.leaderboard-item .user-info .user-stats .stat-item .stat-value,
.leaderboard-item .stat-item .stat-value,
.leaderboard-item .user-stats .stat-item .stat-value,
div.leaderboard-item div.user-info div.user-stats div.stat-item div.stat-value {
    color: #1a202c !important; /* Force very dark color for leaderboard visibility */
    font-weight: 700 !important;
    text-shadow: none !important;
}

.leaderboard-item .user-info .user-stats .stat-item .stat-label,
.leaderboard-item .stat-item .stat-label,
.leaderboard-item .user-stats .stat-item .stat-label,
div.leaderboard-item div.user-info div.user-stats div.stat-item div.stat-label {
    color: #4a5568 !important; /* Force dark secondary color for leaderboard visibility */
    font-weight: 500 !important;
    text-shadow: none !important;
}

/* Dark mode override for leaderboard stats */
@media (prefers-color-scheme: dark) {
    .leaderboard-item .user-info .user-stats .stat-item .stat-value,
    .leaderboard-item .stat-item .stat-value,
    .leaderboard-item .user-stats .stat-item .stat-value,
    div.leaderboard-item div.user-info div.user-stats div.stat-item div.stat-value {
        color: #1a202c !important; /* Keep dark text even in dark mode for contrast against purple */
        font-weight: 700 !important;
    }

    .leaderboard-item .user-info .user-stats .stat-item .stat-label,
    .leaderboard-item .stat-item .stat-label,
    .leaderboard-item .user-stats .stat-item .stat-label,
    div.leaderboard-item div.user-info div.user-stats div.stat-item div.stat-label {
        color: #4a5568 !important; /* Keep darker gray text even in dark mode for contrast against purple */
        font-weight: 500 !important;
    }
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b !important; /* Force dark color for leaderboard visibility */
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b !important; /* Force dark secondary color for leaderboard visibility */
}

.view-workouts {
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary) !important;
    color: white !important;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 1 !important;
}

.view-workouts:hover {
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.rank-badge .fa-crown {
    position: absolute;
    top: -8px;
    font-size: 1rem;
    color: #fbbf24;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.user-details h4 {
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.user-details p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.user-stats {
    text-align: right;
}

.user-stats .stat {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b !important; /* Force dark color for leaderboard visibility */
    display: block;
}

.user-stats small {
    color: #64748b !important; /* Force dark secondary color for leaderboard visibility */
    font-size: 0.8rem;
}

/* Leaderboard Info Styling */
.leaderboard-info {
    padding: 1rem 0;
}

.leaderboard-info h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.score-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.score-item {
    background: rgba(248, 250, 252, 0.8);
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    color: var(--text-primary) !important;
}

.score-item strong {
    color: var(--primary-color) !important;
    display: block;
    margin-bottom: 0.5rem;
}

.score-item p,
.score-item li {
    color: var(--text-primary) !important;
}

.score-item ul {
    color: var(--text-primary) !important;
}

/* Ensure all text content in leaderboard info has proper contrast */
.leaderboard-info,
.leaderboard-info * {
    color: var(--text-primary) !important;
}

.leaderboard-info strong,
.score-item strong {
    color: var(--primary-color) !important;
}

.leaderboard-info h3,
.leaderboard-info h4 {
    color: var(--primary-color) !important;
}

.ranking-note {
    background: rgba(99, 102, 241, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1.5rem;
    text-align: center;
}

.workout-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* Editable Workout Styling */
.exercise-detail.editable {
    background: rgba(99, 102, 241, 0.05);
    border: 2px dashed rgba(99, 102, 241, 0.2);
}

.set-detail.editable {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
}


.btn-outline {
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    color: white;
}

.btn-outline:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.add-set {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
}

.remove-set {
    width: 2rem;
    height: 2rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .workout-actions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
        margin-left: 0;
        margin-top: auto;
        align-self: flex-end;
    }
}

/* Profile Styling */
.profile-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(248, 250, 252, 0.8);
    border-radius: var(--border-radius);
}

.profile-field label {
    font-weight: 600;
    color: var(--text-secondary);
}

.profile-field span {
    color: var(--text-primary);
    font-weight: 500;
}

.view-profile {
    padding: 0.75rem 1.5rem;
    background: var(--secondary-color) !important;
    color: white !important;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(100, 116, 139, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.view-profile:hover {
    background: #475569 !important;
    box-shadow: 0 8px 25px rgba(100, 116, 139, 0.4);
    transform: translateY(-2px);
}

/* Calendar Styling */
.calendar-container {
    padding: 1rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.calendar-day-header {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.calendar-day {
    background: white;
    min-height: 60px;
    padding: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.calendar-day:hover {
    background: rgba(99, 102, 241, 0.1);
}

.calendar-day.other-month {
    background: rgba(248, 250, 252, 0.5);
    color: var(--text-light);
}

.calendar-day.today {
    background: rgba(99, 102, 241, 0.2);
    font-weight: 700;
}

.calendar-day.has-workout {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success-color);
}

.day-number {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.workout-indicator {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    margin-top: auto;
}

@media (max-width: 768px) {
    .calendar-day {
        min-height: 50px;
        padding: 0.25rem;
    }
    
    .calendar-day-header {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
}

.unit-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* Mobile Leaderboard */
@media (max-width: 768px) {
    .leaderboard-filters {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        flex: 1;
        min-width: 80px;
    }

    .leaderboard-item {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .rank-badge {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 1.2rem;
    }

    .user-name {
        font-size: 1.2rem;
        justify-content: center;
    }

    .user-stats {
        justify-content: center;
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    .view-workouts {
        width: 100%;
        padding: 1rem;
    }
}

/* Workout Details Styling */
.workout-details-header {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.workout-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.workout-exercises-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.exercise-detail {
    background: rgba(248, 250, 252, 0.8);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.exercise-points {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 20px;
}

.exercise-points.compound-bonus {
    color: var(--success-color);
    background: rgba(34, 197, 94, 0.1);
}

.exercise-detail h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.sets-detail {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.set-detail {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.set-points {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.875rem;
}

.set-points.reduced-points {
    color: var(--warning-color);
}

.set-points.compound-bonus {
    color: var(--success-color);
}

.set-number {
    font-weight: 600;
    color: var(--text-secondary);
}

.set-info {
    color: var(--text-primary);
}

.set-volume {
    font-weight: 600;
    color: var(--primary-color);
}

.workout-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.view-workouts {
    opacity: 0.7;
    transition: var(--transition);
    color: var(--primary-color);
    background: transparent;
    border: 1px solid var(--primary-color);
}

.view-workouts:hover {
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4) !important;
    transform: translateY(-2px);
    background: var(--primary-hover) !important;
    color: white !important;
}

.workout-exercise-selector {
    position: relative;
}

.workout-exercise-selector .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

#addExerciseSearch {
    padding-left: 2.5rem !important;
    scroll-margin-top: 0;
    scroll-behavior: auto;
}

/* Prevent scroll jump on mobile when focusing search */
@media (max-width: 768px) {
    #addExerciseSearch {
        scroll-margin: 0;
        scroll-padding: 0;
    }
    
    .workout-exercise-selector {
        scroll-behavior: auto;
    }
    
    .workout-exercise-selector.expanded {
        scroll-behavior: auto;
    }
    
    /* Prevent unwanted scrolling when container expands */
    .workout-exercise-selector.collapsed {
        will-change: max-height;
    }
    
    .workout-exercise-selector.expanded {
        will-change: auto;
    }
}

/* Removed duplicate .search-dropdown rule */

/* Responsive workout page styles */
.workout-start-options {
    margin-bottom: 2rem;
}

#custom-tab.tab-content {
    padding: 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.workout-exercise-selector {
    position: relative;
    margin-bottom: 1rem;
}

.workout-exercise-selector #addExerciseSearch {
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.workout-exercise-selector #addExerciseSearch:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Removed duplicate .search-dropdown rule */

.search-dropdown.show {
    display: block;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    /* Prevent horizontal scrolling */
    * {
        overflow-x: hidden;
    }
    
    body, html {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .workout-exercise-selector {
        margin-bottom: 2rem;
        padding: 0;
        min-height: 60vh;
        height: auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        position: relative;
        width: 100%;
        max-width: 100%;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .workout-exercise-selector #addExerciseSearch {
        min-height: 48px;
        font-size: 16px; /* Prevent iOS zoom */
        padding: 1rem 1rem 1rem 3rem;
        margin-bottom: 1rem;
        flex-shrink: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .workout-exercise-selector .search-icon {
        position: absolute;
        left: 1.5rem;
        top: 1.5rem;
        transform: translateY(50%);
        z-index: 10;
        color: var(--text-secondary);
        font-size: 1.2rem;
        pointer-events: none;
    }
    
    /* Make containers much larger to show search bar + dropdown */
    .start-options-content {
        overflow-x: hidden;
        overflow-y: visible;
        height: auto;
        max-height: none;
        min-height: 80vh;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    /* Mobile workout templates behavior */
    .workout-templates-section.hide-on-mobile-with-exercises {
        display: none;
    }
    
    .workout-templates-section.collapsed-on-mobile {
        margin-bottom: 1rem;
    }
    
    .workout-templates-section.collapsed-on-mobile .template-selector,
    .workout-templates-section.collapsed-on-mobile .templates-header p {
        display: none;
    }
    
    .workout-templates-section.collapsed-on-mobile.expanded .template-selector,
    .workout-templates-section.collapsed-on-mobile.expanded .templates-header p {
        display: block;
    }
    
    .template-toggle-btn {
        margin-top: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
        width: 100%;
        background: var(--secondary-color);
        border: 2px solid var(--border-color);
        border-radius: var(--border-radius);
        color: var(--text-primary);
        cursor: pointer;
        transition: var(--transition);
    }
    
    .template-toggle-btn:hover {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    .workout-templates-section {
        margin-bottom: 1rem;
    }
    
    .workout-exercise-selector {
        margin-bottom: 1rem;
    }
    
    /* Exercise selector mobile responsive behavior */
    .workout-exercise-selector {
        transition: all 0.3s ease;
    }
    
    .workout-exercise-selector.collapsed {
        max-height: 70px !important;
        min-height: auto !important;
        height: auto !important;
        overflow: hidden;
        padding: 0.25rem;
    }
    
    .workout-exercise-selector.collapsed.empty {
        max-height: 58px !important;
        min-height: auto !important;
        height: auto !important;
        padding: 0.25rem;
        margin-bottom: 0.5rem;
    }
    
    .workout-exercise-selector.collapsed.empty #addExerciseSearch {
        min-height: 44px;
        padding: 0.75rem;
        font-size: 16px;
        margin-bottom: 0;
    }
    
    .workout-exercise-selector.collapsed.empty .search-icon {
        display: none;
    }
    
    .workout-exercise-selector.collapsed .exercise-selector-header {
        display: none;
    }
    
    .workout-exercise-selector.expanded {
        max-height: none;
        overflow: visible;
    }
    
    .workout-exercise-selector.expanded .exercise-selector-header {
        display: block;
        animation: fadeInDown 0.3s ease;
    }
    
    /* Ensure search container remains visible when collapsed */
    .workout-exercise-selector.collapsed .workout-exercise-selector {
        display: block;
        margin-bottom: 0;
    }
    
    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Mobile dropdown scroll behavior for keyboard hiding */
    /* Removed duplicate .search-dropdown rule */
    
    /* Visual feedback when scrolling to hide keyboard */
    .search-dropdown.scrolling {
        background: var(--card-background);
    }
    
    /* Prevent text selection during scroll */
    .search-dropdown.scrolling * {
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }
    
    /* Removed duplicate .search-dropdown rule */
    
    /* Prevent dropdown from disappearing during interaction */
    .search-dropdown:hover,
    .search-dropdown:focus-within,
    .search-dropdown.scrolling {
        display: block !important;
        visibility: visible !important;
    }
    
    /* Removed duplicate .search-dropdown rule */
    
    /* Prevent body scroll when dropdown is active */
    body.dropdown-active {
        position: fixed;
        width: 100%;
    }
}

/* Ensure desktop behavior is unaffected */
@media (min-width: 769px) {
    .workout-exercise-selector.collapsed,
    .workout-exercise-selector.expanded {
        max-height: none;
        overflow: visible;
    }
    
    .workout-exercise-selector.collapsed .exercise-selector-header {
        display: block;
    }
    
    .templates-header h3,
    .exercise-selector-header h3 {
        font-size: 1.2rem;
    }
    
    .templates-header p,
    .exercise-selector-header p {
        font-size: 0.8rem;
    }
    
    /* Wider workout container on mobile */
    .workout-start-options {
        margin: 0;
        padding: 0;
        width: 100%;
        max-width: 100%;
    }
    
    #custom-tab.tab-content {
        overflow-y: visible;
        height: auto;
        max-height: none;
        min-height: 80vh;
        padding: 0.25rem;
        width: 100%;
        max-width: 100%;
        margin: 0;
        box-sizing: border-box;
    }
    
    .workout-exercise-selector {
        overflow-y: visible;
        height: auto;
        min-height: 70vh;
        width: 100%;
    }
    
    /* Fix cut-off units in workout exercises */
    .sets-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.75rem;
        width: 100%;
        overflow-x: auto;
    }
    
    .set-item {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        min-width: 110px;
        text-align: center;
        white-space: nowrap;
        overflow: visible;
    }
    
    .set-input {
        width: 100%;
        min-width: 0;
        max-width: none;
        padding: 0.75rem 0.5rem;
        font-size: 16px;
        text-align: center;
        box-sizing: border-box;
        min-height: 44px;
    }
}

/* Floating Scroll Navigation */
.scroll-navigation {
    position: fixed;
    right: 1rem;
    bottom: 5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
}

.scroll-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    color: #4f46e5;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-btn:hover {
    background: rgba(79, 70, 229, 0.1);
    color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.scroll-btn:active {
    transform: translateY(0);
}

.scroll-top {
    margin-bottom: 0.25rem;
}

.scroll-bottom {
    margin-top: 0.25rem;
}

/* Mobile adjustments for scroll navigation */
@media (max-width: 768px) {
    .scroll-navigation {
        left: 1rem;
        right: auto;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
    }
    
    .scroll-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
}

/* Removed conflicting dropdown positioning rule */
    
    .dropdown-item {
        padding: 1.25rem 1rem !important;
        min-height: 70px !important;
        display: flex !important;
        align-items: center !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    
    /* Fix tab buttons being cut off on mobile */
    .start-options-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .start-option-tabs {
        width: 100%;
        justify-content: center;
        padding: 6px;
        gap: 8px;
    }
    
    .start-option-tabs .tab-btn {
        padding: 12px 20px;
        font-size: 14px;
        font-weight: 600;
        min-width: 120px;
        justify-content: center;
        white-space: nowrap;
        flex: 1;
        max-width: 150px;
    }
    
    .start-option-tabs .tab-btn i {
        font-size: 16px;
    }
    
    /* Workout page responsive fixes */
    .workout-header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .workout-date-container,
    /* Timer container styles removed */ .removed-timer-container {
        width: 100%;
        text-align: center;
    }
    
    .workout-builder {
        padding: 1rem;
    }
    
    .workout-controls {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1rem;
    }
    
    .workout-action-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .workout-controls .btn {
        width: 100%;
        padding: 1rem;
        font-size: 16px;
        min-height: 48px;
    }
}

/* Desktop styles */
@media (min-width: 769px) {
    .workout-exercise-selector {
        max-width: 600px;
    }
    
    /* Consolidated search dropdown rule */
    .search-dropdown {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-background);
        border: 1px solid var(--border-color);
        border-radius: 0 0 var(--border-radius) var(--border-radius);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        max-height: 60vh;
        overflow-y: auto;
        z-index: 9999;
        margin-top: 2px;
        /* Optimal mobile touch scrolling */
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        overscroll-behavior: contain;
        touch-action: manipulation;
    }
}

.dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dropdown-item:last-child {
    border-bottom: none;
}
/* Only enable hover effects on devices that can actually hover (desktop) */
@media (hover: hover) and (pointer: fine) {
    .dropdown-item:hover {
        background: rgba(99, 102, 241, 0.1);
    }
}

/* Disable hover effects on touch devices to enable proper scrolling */
@media (hover: none) and (pointer: coarse) {
    .dropdown-item:hover {
        background: transparent;
    }
    
    /* Optimize dropdown items for touch scrolling */
    .dropdown-item {
        /* Prevent text selection during scrolling */
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        /* Optimize touch target size */
        min-height: 48px;
        /* Enable fast taps while allowing scrolling */
        touch-action: manipulation;
        /* Disable touch callout on iOS */
        -webkit-touch-callout: none;
    }
    
    /* Removed duplicate - mobile scrolling already defined in main .search-dropdown rule */
}

.dropdown-item .item-type {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: #e2e8f0;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
}

.dropdown-header {
    padding: 0.75rem 1rem;
    font-weight: 700;
    color: var(--text-primary);
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
}

@media (max-width: 768px) {
    .workout-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .set-detail {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Detailed Workout Summary Styling */
.workout-summary.detailed {
    background: rgba(248, 250, 252, 0.8);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.workout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.workout-duration {
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 600;
}

.workout-exercises-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.exercise-detail h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exercise-detail h5::before {
    content: '💪';
    font-size: 1rem;
}

.workout-totals {
    text-align: center;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--border-radius);
    font-weight: 600;
    color: var(--primary-color);
}

/* Workout Summary Styling */
.workout-summary {
    background: rgba(248, 250, 252, 0.8);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.workout-summary h4 {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.workout-summary p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.exercise-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.exercise-tag {
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Mobile Recent Workouts */
@media (max-width: 768px) {
    .recent-workouts-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .workout-item {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        padding: 1.25rem;
    }

    .workout-details {
        width: 100%;
    }

    .workout-status {
        align-self: flex-end;
    }
}
/* Friends Section Styles */
.friends-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover:not(.active) {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-color: rgba(99, 102, 241, 0.3);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.friend-item, .user-result, .conversation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.friend-item:hover, .user-result:hover, .conversation-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.friend-info h4, .user-info h4, .conversation-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.friend-info span, .user-info span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status.pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.status.accepted {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success-color);
}

.search-section {
    max-width: 600px;
}

.search-results {
    margin-top: 1rem;
}

/* Chat Styles */
.messages-section {
    display: flex;
    height: 500px;
}

.conversations-list {
    flex: 1;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: visible;
    background: #f8fafc;
    height: auto;
    min-height: 200px;
}


.message.received .message-content {
    background: white;
    border: 1px solid var(--border-color);
}

.message-content {
    display: inline-block;
    max-width: 70%;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    word-wrap: break-word;
}

.message-content p {
    margin: 0 0 0.25rem 0;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
}

.chat-input {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.chat-input input {
    flex: 1;
    margin-right: 0.5rem;
}

.conversation-item {
    cursor: pointer;
}

.unread-badge {
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.last-message {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Quick Save Modal Styles */
.quick-save-form {
    text-align: center;
}

.quick-save-form h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.quick-save-form p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.workout-summary {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--card-background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.workout-summary h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.exercise-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.exercise-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.exercise-list li:last-child {
    border-bottom: none;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Workout Exercise Styling */
.add-set-btn {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px dashed var(--primary-color);
    border-radius: 6px;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

.add-set-btn:hover {
    background: rgba(99, 102, 241, 0.2);
}

/* Unread count badges */
.unread-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}


.tab-btn {
    position: relative;
}

/* Tagline styling */
.tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
    opacity: 0.9;
}

.login-header .tagline {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.section-header .tagline {
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Profile modal styling */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.profile-info h3 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.profile-info .username {
    margin: 0 0 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-info .fitness-goal {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

.profile-actions {
    margin-bottom: 1.5rem;
    text-align: center;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Workout edit controls styling */
.workout-edit-controls {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.edit-controls-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group .form-input {
    width: 100%;
    max-width: 300px;
}

#saveWorkoutDetailsBtn {
    background: var(--success-color);
    color: white;
}

#saveWorkoutDetailsBtn:hover {
    background: #28a745;
}

/* Ensure workout detail modal title buttons are visible */
#workoutDetailsTitle {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.workout-details-actions .edit-workout-btn,
.workout-details-actions .edit-details-btn {
    font-size: 0.9rem;
    padding: 0.75rem 1.2rem;
    white-space: nowrap;
    min-height: 48px;
    touch-action: manipulation;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .workout-details-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .workout-details-actions .edit-workout-btn,
    .workout-details-actions .edit-details-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
        font-size: 0.85rem;
        padding: 1rem;
        min-height: 52px;
    }
}

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
}

/* Inline workout edit controls */
.workout-edit-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.workout-edit-controls .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.workout-edit-controls label {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.workout-edit-controls .form-input {
    max-width: 200px;
}

/* Mobile-specific navbar improvements */
@media (max-width: 768px) {
    .nav-bar {
        padding: 0.75rem 1rem;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    }
    
    .nav-left .logo {
        font-size: 1.25rem;
    }
    
    .nav-center {
        gap: 0.5rem;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav-center::-webkit-scrollbar {
        display: none;
    }
    
    
    .nav-right .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        border-radius: 10px;
    }
}

/* Enhanced mobile section styling */
/* Duplicate mobile rule removed - consolidated above */
    
    .section-header {
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .section-header h1 {
        font-size: 1.75rem;
        font-weight: 700;
        background: linear-gradient(135deg, var(--text-primary), var(--primary-color));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        margin-bottom: 0.25rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .stat-card {
        padding: 1.25rem;
        border-radius: 16px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }
    
    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    }
    
    .stat-number {
        font-size: 1.5rem;
        font-weight: 700;
    }
    
    .stat-label {
        font-size: 0.8rem;
        opacity: 0.8;
    }
}

/* Modern button styling for mobile */
@media (max-width: 768px) {
    .btn {
        border-radius: 12px;
        font-weight: 600;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        transition: all 0.3s ease;
        border: none;
        position: relative;
        overflow: hidden;
    }
    
    .btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }
    
    .btn:hover::before {
        left: 100%;
    }
    
    .btn-primary {
        background: linear-gradient(135deg, var(--primary-color), #667eea);
        color: white;
        box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.3);
    }
    
    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(var(--primary-color-rgb), 0.4);
    }
    
    .btn-secondary {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
        color: var(--text-primary);
        border: 1px solid rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
    
    .btn-success {
        background: linear-gradient(135deg, var(--success-color), #48bb78);
        color: white;
    }
    
    .btn-danger {
        background: linear-gradient(135deg, var(--danger-color), #f56565);
        color: white;
    }
}

/* Enhanced card styling */
@media (max-width: 768px) {
    .workout-item, .card-bubble {
        border-radius: 16px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
        backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
        padding: 1.25rem;
    }
    
    .workout-item:hover, .card-bubble:hover {
        transform: translateY(-4px);
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
        border-color: rgba(var(--primary-color-rgb), 0.3);
    }
    
    .workouts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Modal improvements for mobile */
@media (max-width: 768px) {
    .modal {
        align-items: flex-start;
        padding-top: 1rem;
    }
    
    .modal-content {
        margin: 1rem;
        border-radius: 20px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-header {
        padding: 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 20px 20px 0 0;
        flex-shrink: 0;
    }
    
    .modal-body {
        padding: 1.5rem;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
    
    .modal-footer {
        padding: 1rem 1.5rem 1.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        gap: 0.75rem;
        flex-shrink: 0;
    }
}

/* Form styling improvements */
@media (max-width: 768px) {
    .form-input, .form-select {
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        padding: 1rem;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px;
        transition: all 0.3s ease;
    }
    
    .form-input:focus, .form-select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
        background: rgba(255, 255, 255, 0.15);
    }
}

/* Shimmer Animation for Progress Bars */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Smooth slide-in animation for mobile goals */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced spacing and typography */
@media (max-width: 768px) {
    .section {
        padding: 0;
    }
    
    h2, h3, h4 {
        font-weight: 600;
        line-height: 1.3;
    }
    
    .workout-date {
        font-weight: 600;
        color: var(--primary-color);
        font-size: 0.9rem;
    }
    
    .workout-details h4 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }
    
    /* Animate goals preview on load */
    .goals-preview {
        animation: slideInUp 0.6s ease-out;
    }
    
    .primary-goal-preview {
        animation: slideInUp 0.8s ease-out 0.2s both;
    }
    
    /* View All Goals Button in Dashboard */
    .goals-preview .btn {
        width: 100%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        padding: 1rem 1.5rem;
        border-radius: 12px;
        font-weight: 600;
        font-size: 0.9rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        margin-top: 1rem;
        box-sizing: border-box;
        max-width: 100%;
        min-height: 44px;
    }
    
    .goals-preview .btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }
    
    .goals-preview .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35);
    }
    
    .goals-preview .btn:hover::before {
        left: 100%;
    }
    
    .goals-preview .btn:active {
        transform: translateY(0);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    
    .workout-details p {
        font-size: 0.85rem;
        opacity: 0.8;
        line-height: 1.4;
    }
}

/* Enhanced profile modal styling */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.profile-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.username {
    color: var(--text-secondary);
    margin: 0 0 0.25rem 0;
    font-weight: 500;
}

.fitness-goal {
    color: var(--primary-color);
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    text-transform: capitalize;
}

.join-date {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.9rem;
    margin: 0;
}

.profile-edit-section {
    margin-top: 1rem;
}

.profile-edit-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.profile-stats {
    margin-top: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7) !important;
}

.stat-value {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95) !important;
}

.profile-bio {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.profile-bio h5 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-weight: 600;
}

.profile-bio p {
    margin: 0;
    line-height: 1.5;
    color: var(--text-secondary);
}

.profile-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Enhanced Profile Modal Styling */
.profile-modal-enhanced {
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.profile-modal-content {
    padding: 2rem;
    color: white;
}

/* Enhanced stat items within profile modal */
.profile-modal-enhanced .enhanced-stat-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.profile-modal-enhanced .enhanced-stat-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.profile-modal-enhanced .enhanced-stat-label {
    color: rgba(255, 255, 255, 0.8) !important;
}

.profile-modal-enhanced .enhanced-stat-value {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Ensure all profile modal text has proper contrast */
.profile-modal-enhanced .username {
    color: rgba(255, 255, 255, 0.8) !important;
}

.profile-modal-enhanced .join-date {
    color: rgba(255, 255, 255, 0.7) !important;
}

.profile-overview-section {
    margin-bottom: 2rem;
}

.profile-overview-section h4 {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-overview-section h4 i {
    color: rgba(255, 255, 255, 0.7) !important;
}

.profile-achievements-section {
    margin-top: 2rem;
}

.profile-achievements-section h4 {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-achievements-section h4 i {
    color: rgba(255, 255, 255, 0.7) !important;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.achievement-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    text-align: center;
}

.achievement-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.achievement-item.unlocked {
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.4);
}

.achievement-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.achievement-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 0.25rem;
}

.achievement-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7) !important;
    line-height: 1.4;
}

.achievement-progress {
    margin-top: 0.5rem;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    transition: width 0.3s ease;
}

.achievement-progress-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7) !important;
    margin-top: 0.25rem;
}

.enhanced-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.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: 700;
    color: rgba(255, 255, 255, 0.95) !important;
    margin-bottom: 0.25rem;
}

.enhanced-stat-label {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.7) !important;
    font-weight: 500;
}

.profile-bio-enhanced {
    margin-top: 1.5rem;
    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);
}

.profile-bio-enhanced h5 {
    margin: 0 0 0.5rem 0;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-bio-enhanced h5 i {
    color: rgba(255, 255, 255, 0.7) !important;
}

.profile-bio-enhanced p {
    margin: 0;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Mobile profile styling */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .profile-modal-content {
        padding: 1.5rem;
    }
    
    .enhanced-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Friendship status button styling */
.friendship-status {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.friendship-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.friendship-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.friendship-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.friendship-btn.pending {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.4);
    color: rgba(255, 255, 255, 0.95) !important;
}

.friendship-btn.accepted {
    background: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.4);
    color: rgba(255, 255, 255, 0.95) !important;
}
    
    .stat-item {
        padding: 0.5rem 0.75rem;
    }
    
    .profile-actions {
        flex-direction: column;
    }
    
    .profile-actions .btn {
        width: 100%;
    }
}


/* Progress Modal Styles */
.progress-summary {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--border-radius);
    text-align: center;
}

.exercise-progress-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exercise-progress-item {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.exercise-progress-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.exercise-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.exercise-progress-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 600;
}

.progress-change {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.progress-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.progress-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.rm-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.rm-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rm-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.rm-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.rm-source {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.rm-formula {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.rm-formula small {
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .rm-comparison {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .exercise-progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .progress-change {
        align-self: flex-end;
    }
}


/* Enhanced Profile Modal Styling */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.profile-header .profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.profile-header .profile-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-header .username {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.profile-header .join-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.enhanced-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.enhanced-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem;
    background: var(--card-background);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-align: center;
}

.enhanced-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.enhanced-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.enhanced-stat-label {
    color: rgba(0, 0, 0, 0.7) !important;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-bio-enhanced {
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-top: 1rem;
}

.profile-bio-enhanced h5 {
    margin: 0 0 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-bio-enhanced h5 i {
    color: var(--primary-color);
}

.profile-bio-enhanced p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-style: italic;
}

.profile-actions-enhanced {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.profile-actions-enhanced .btn {
    min-width: 120px;
}

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.5rem 0 1rem;
    }
    
    .enhanced-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .enhanced-stat-item {
        padding: 1rem;
    }
    
    .enhanced-stat-value {
        font-size: 1.5rem;
    }
    
    .enhanced-stat-label {
        font-size: 0.8rem;
    }
    
    .profile-actions-enhanced {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .profile-actions-enhanced .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .enhanced-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-header .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .profile-header .profile-info h3 {
        font-size: 1.25rem;
    }
}

/* Enhanced Profile Form Styles */
.profile-edit-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.profile-edit-section h4 i {
    color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group .form-input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group .form-input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.char-count {
    display: block;
    text-align: right;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}


/* Enhanced User Actions for Leaderboard */
.user-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.view-workouts, .view-profile {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.view-workouts::before, .view-profile::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.view-workouts:hover::before, .view-profile:hover::before {
    left: 100%;
}

.view-workouts:hover, .view-profile:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.view-workouts i, .view-profile i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.view-workouts:hover i, .view-profile:hover i {
    transform: scale(1.1);
}

/* User Profile Modal Enhancements */
.profile-header {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    margin: -1.5rem -1.5rem 2rem -1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.profile-avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.profile-info h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.username {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.join-date {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin: 0;
}

/* Enhanced Stats Grid */
.enhanced-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.enhanced-stat-item {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 1.5rem 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.enhanced-stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.enhanced-stat-item:hover::before {
    transform: scaleX(1);
}

.enhanced-stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.enhanced-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.enhanced-stat-label {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.7) !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bio Section Enhancement */
.profile-bio-enhanced {
    background: rgba(249, 250, 251, 0.8);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    margin: 2rem 0;
}

.profile-bio-enhanced h5 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-bio-enhanced p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-primary);
    font-style: italic;
}

/* Friendship Status Enhancement */
.friendship-status {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.friendship-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.friendship-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.friendship-btn.pending {
    background: var(--gradient-warning);
}

.friendship-btn.accepted {
    background: var(--gradient-success);
}

/* User Workouts Display Enhancement */
.user-workout-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.user-workout-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.user-workout-item:hover::before {
    transform: scaleX(1);
}

.user-workout-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.workout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(99, 102, 241, 0.1);
}

.workout-date {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.workout-duration {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.workout-exercises-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.exercise-chip {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Mobile responsiveness for user views */
@media (max-width: 768px) {
    .user-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .view-workouts, .view-profile {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .enhanced-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    
    .enhanced-stat-value {
        font-size: 1.5rem;
    }
    
    .profile-header {
        padding: 1.5rem;
    }
    
    .profile-avatar {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 1.3rem;
    }
}

/* Fix username display in header */
.user-profile .username,
.mobile-user-profile .username {
    color: var(--text-primary) !important;
    background: transparent !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

/* Ensure profile header username styling only applies to profile modals */
.profile-header .username {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}
/* Enhanced User Workout Details */
.user-workout-detailed {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.user-workout-detailed:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.workout-info-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(99, 102, 241, 0.1);
}

.workout-date-time {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.workout-date {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workout-duration {
    font-size: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workout-total-volume {
    text-align: right;
    background: rgba(99, 102, 241, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.volume-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.volume-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.workout-exercises-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.exercise-section {
    background: rgba(249, 250, 251, 0.8);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.exercise-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.exercise-title i {
    color: var(--primary-color);
}

.user-workout-detailed .sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.set-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.set-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.set-item.weight {
    border-left: 4px solid var(--primary-color);
}

.set-item.cardio {
    border-left: 4px solid var(--success-color);
}

.set-number {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.set-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.set-details span {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.set-volume {
    font-size: 0.8rem !important;
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* Mobile responsiveness for workout details */
@media (max-width: 768px) {
    .user-workout-detailed {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .workout-info-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .workout-total-volume {
        text-align: center;
    }
    
    .user-workout-detailed .sets-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .effort-rating-container {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.4rem;
    }

    .effort-rating-label {
        min-width: auto;
        font-size: 0.75rem;
    }
    
    .volume-value {
        font-size: 1.3rem;
    }
    
    .workout-date {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .exercise-section {
        padding: 1rem;
    }
    
    .workout-info-header {
        margin-bottom: 1.5rem;
    }
}

/* Friends List Action Buttons */
.friend-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.friend-actions .view-workouts, 
.friend-actions .view-profile {
    flex: 1;
    min-width: 100px;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 0.85rem;
}

.friend-actions .view-workouts:hover, 
.friend-actions .view-profile:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

@media (max-width: 768px) {
    .friend-actions {
        flex-direction: row;
        gap: 0.4rem;
        justify-content: center;
    }
    
    .friend-actions .view-workouts, 
    .friend-actions .view-profile {
        flex: 1;
        min-width: 80px;
        font-size: 0.8rem;
        padding: 0.6rem 0.5rem;
    }
}

/* Make user profile modal wider */
#userProfileModal .modal-content {
    max-width: 800px;
    width: 90%;
}

@media (min-width: 1024px) {
    #userProfileModal .modal-content {
        width: 70%;
        max-width: 900px;
    }
}

/* Exercise Points Styling in User Workouts */
.exercise-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.exercise-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.exercise-name i {
    color: var(--primary-color);
}

.exercise-points {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.exercise-points.compound-bonus {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(99, 102, 241, 0.1));
    color: var(--success-color);
    border-color: rgba(16, 185, 129, 0.3);
}

@media (max-width: 768px) {
    .exercise-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .exercise-points {
        align-self: flex-end;
    }
}


/* Instructions Card */
.instructions-card {
    background: var(--card-background);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    overflow: hidden;
}

.instructions-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.instructions-header:hover {
    background: linear-gradient(135deg, #5145e5 0%, #7c3aed 100%);
}

.instructions-toggle {
    color: white;
    font-size: 1.2rem;
    transition: var(--transition);
}

.instructions-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.instructions-header i {
    margin-right: 0.5rem;
}

.instructions-content {
    padding: 1.5rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.instruction-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.instruction-step:last-child {
    margin-bottom: 0;
}

.step-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.step-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
}

.step-content p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.9rem;
}

.step-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

.instructions-footer {
    padding: 1.5rem;
    text-align: center;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
}

.instructions-footer .btn {
    font-size: 1rem;
    padding: 0.75rem 2rem;
}

@media (max-width: 768px) {
    .instruction-step {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .instructions-content {
        padding: 1rem;
    }
    
    .instructions-footer {
        padding: 1rem;
    }
}

/* Trend Analysis Styles */
.trend-btn {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.2);
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}

.trend-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.trend-btn-small {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.2);
    padding: 0.25rem;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    margin-left: auto;
}

.trend-btn-small:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.trend-summary {
    background: rgba(52, 152, 219, 0.05);
    border: 1px solid rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.trend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.trend-header h3 {
    margin: 0;
    color: #2c3e50;
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.trend-improving {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.trend-declining {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.trend-stable {
    background: rgba(149, 165, 166, 0.1);
    color: #95a5a6;
    border: 1px solid rgba(149, 165, 166, 0.2);
}

.trend-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.trend-stat {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.trend-stat label {
    display: block;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trend-stat value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.trend-history {
    margin-top: 2rem;
}

.trend-history h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* Exercise trend charts now use the same canvas-based styling as weight trends */

.trend-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.trend-table th {
    background: #f8f9fa;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #dee2e6;
}

.trend-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f1f3f4;
}

.trend-table tr:hover {
    background: rgba(52, 152, 219, 0.05);
}

.performance-badge {
    background: linear-gradient(45deg, #3498db, #9b59b6);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.text-success {
    color: #27ae60 !important;
}

.text-danger {
    color: #e74c3c !important;
}

.text-muted {
    color: #95a5a6 !important;
}

/* Exercise header adjustments for trend buttons */
.exercise-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.exercise-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .trend-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-bars {
        min-width: 300px;
        height: 80px;
    }
    
    .trend-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .trend-indicator {
        align-self: center;
    }
}

/* Groups Styles - Modern Professional Design */
.groups-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--background);
    padding: 0.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.groups-tabs .tab-btn {
    padding: 0.875rem 2rem;
    background: transparent;
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.groups-tabs .tab-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.groups-tabs .tab-btn:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.groups-tabs .tab-btn.active {
    background: var(--card-background);
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.groups-tabs .tab-btn.active:before {
    opacity: 0.1;
}

.groups-content {
    position: relative;
}

.groups-content .tab-content {
    display: none;
}

.groups-content .tab-content.active {
    display: block;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.group-card {
    background: var(--card-background);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.group-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.group-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

.group-card:hover:before {
    transform: scaleX(1);
}

.group-header {
    margin-bottom: 1rem;
}

.group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.group-title h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.group-title i {
    color: var(--text-secondary);
    font-size: 1.125rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.group-card:hover .group-title i {
    color: var(--primary-color);
    opacity: 1;
}

.group-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.group-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.group-meta span:before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
}

.group-meta span:first-child:before {
    display: none;
}

.group-description {
    margin: 1.25rem 0 1.75rem 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.group-actions {
    display: flex;
    gap: 0.875rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.group-actions .btn {
    flex: 1;
    min-width: 130px;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem 1.25rem;
}

/* Group Details Modal - Modern Professional */
.group-details {
    max-width: 100%;
    background: var(--card-background);
}

.group-info {
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--background) 0%, rgba(99, 102, 241, 0.03) 100%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    position: relative;
}

.group-info:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.group-header-detail {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.group-header-detail h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.group-badges {
    display: flex;
    gap: 0.5rem;
}

.badge {
    padding: 0.375rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.badge-success {
    background: var(--gradient-success);
    color: white;
}

.badge-warning {
    background: var(--gradient-warning);
    color: white;
}

.badge-primary {
    background: var(--gradient-primary);
    color: white;
}

.badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.group-description {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.group-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

/* Fix group modal stat text visibility - Maximum specificity */
body #groupDetailsModal .group-stats .stat-item span.stat-label,
html body #groupDetailsModal .group-stats .stat-item .stat-label {
    color: #ffffff !important;
    font-weight: 600;
}

body #groupDetailsModal .group-stats .stat-item span.stat-value,
html body #groupDetailsModal .group-stats .stat-item .stat-value {
    color: #ffffff !important;
    font-weight: 700;
}

/* Individual user stats in group modal */
#groupDetailsModal .member-card .stat-label {
    color: var(--primary-color) !important;
    font-weight: 600;
}

#groupDetailsModal .member-card .stat-value {
    color: #ffffff !important;
    font-weight: 700;
}

.stat-item {
    text-align: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--background) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.1);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Group Members - Enhanced Design */
.group-members-section {
    margin-top: 2.5rem;
}

.group-members-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--background) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.group-members-section h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.375rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.group-members-section h4:before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.members-group {
    margin-bottom: 2.5rem;
}

.members-group h5 {
    margin: 0 0 1.5rem 0;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--background) 0%, rgba(99, 102, 241, 0.08) 100%);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.member-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.member-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.member-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.member-card:hover:before {
    transform: scaleX(1);
}

.member-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.member-info h4 {
    margin: 0 0 0.375rem 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.username {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.role-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
}

.role-badge.admin {
    background: var(--gradient-primary);
    color: white;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 10px rgba(99, 102, 241, 0.3);
    }
    to {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 20px rgba(99, 102, 241, 0.5);
    }
}

.member-stats {
    margin-bottom: 1rem;
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-row .stat-item {
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--background) 0%, rgba(99, 102, 241, 0.03) 100%);
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-row .stat-item:hover {
    transform: scale(1.02);
    background: linear-gradient(135deg, var(--background) 0%, rgba(99, 102, 241, 0.08) 100%);
}

.stat-row .stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-row .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.stat-row .stat-label {
    font-size: 0.75rem;
}

.last-workout {
    padding: 0.5rem;
    background: var(--background);
    border-radius: var(--border-radius);
    text-align: center;
}

.last-workout {
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--background) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

.last-workout-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.last-workout-date {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--success-color);
}

.recent-workouts {
    margin-bottom: 1rem;
}

.recent-workouts h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.mini-workouts {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mini-workout {
    padding: 0.5rem;
    background: var(--background);
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.workout-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.workout-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.member-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.member-actions .btn {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.625rem 0.875rem;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.25rem 0.5rem;
}

.member-actions .btn-success:disabled,
.member-actions .btn-warning:disabled {
    opacity: 0.7;
    cursor: default;
}

.member-actions .btn-success:disabled {
    background: var(--success-color) !important;
    color: white !important;
}

.member-actions .btn-warning:disabled {
    background: var(--warning-color) !important;
    color: white !important;
}

/* Group Invitations - Modern Design */
.group-invitation-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.group-invitation-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-warning);
}

.group-invitation-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: var(--warning-color);
}

.invitation-header {
    margin-bottom: 1rem;
}

.invitation-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.inviter {
    font-weight: 600;
    color: var(--primary-color);
}

.invitation-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.invitation-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* Invite to Group Modal - Enhanced */
.search-section {
    margin-bottom: 2rem;
}

.search-help {
    margin-top: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--background) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 1.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    background: var(--card-background);
}

.invite-friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.invite-friend-item:last-child {
    border-bottom: none;
}

.invite-friend-item:hover {
    background: linear-gradient(135deg, var(--background) 0%, rgba(99, 102, 241, 0.05) 100%);
    padding-left: 1.5rem;
}

.invite-friend-item:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.invite-friend-item:hover:before {
    transform: scaleY(1);
}

.friend-info {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.friend-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.friend-username {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.friend-badge {
    display: inline-flex;
    align-items: center;
    background: var(--gradient-success);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.friend-badge:before {
    content: '👥';
    margin-right: 0.375rem;
}

.member-badge {
    display: inline-flex;
    align-items: center;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.member-badge:before {
    content: '⭐';
    margin-right: 0.375rem;
}

.search-separator {
    text-align: center;
    padding: 1rem 0;
    margin: 1rem 0;
    border-top: 1px solid var(--border-color);
}

.search-help {
    margin-bottom: 1rem;
}

.loading-text {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Invited button specific styles */
.btn-secondary:disabled,
.btn-secondary[disabled] {
    background: var(--gradient-success) !important;
    color: white !important;
    border-color: var(--success-color) !important;
    opacity: 0.8;
    cursor: not-allowed;
}

.btn-secondary:disabled:hover,
.btn-secondary[disabled]:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.empty-state p {
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Modal Enhancements */
.modal-content.large {
    max-width: 900px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .groups-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .group-actions {
        flex-direction: column;
    }
    
    .group-actions .btn {
        min-width: auto;
    }
    
    .members-grid {
        grid-template-columns: 1fr;
    }
    
    .groups-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .group-header-detail {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .group-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .modal-content.large {
        width: 95vw;
        max-height: 90vh;
    }
    
    /* Groups Responsive Design */
    .groups-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .group-card {
        padding: 1.5rem;
    }
    
    .group-actions {
        flex-direction: column;
    }
    
    .group-actions .btn {
        min-width: auto;
    }
    
    .members-grid {
        grid-template-columns: 1fr;
    }
    
    .member-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .group-header-detail {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .group-badges {
        margin-top: 1rem;
    }
    
    .groups-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .groups-tabs .tab-btn {
        text-align: center;
    }
    
    .group-members-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .invite-friend-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .friend-info {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .group-card {
        padding: 1.25rem;
    }
    
    .member-card {
        padding: 1.25rem;
    }
    
    .member-actions {
        grid-template-columns: 1fr;
    }
    
    .group-stats {
        grid-template-columns: 1fr;
    }
    
    .groups-tabs .tab-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Enhanced Social Features Styling */
.section-header h1 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.friends-tabs .tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.friend-count {
    background: var(--gradient-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    min-width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Online Status Summary */
.friends-overview {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--background) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.online-status-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.status-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.status-item .status-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: relative;
}

.status-indicator.online {
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
    animation: pulse 2s infinite;
}

.status-indicator.away {
    background: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.status-indicator.offline {
    background: #6b7280;
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
}

.status-indicator.recently_active, .status-indicator.today {
    background: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.status-indicator.yesterday {
    background: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.3);
}

/* Base status indicator styles */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Friend Selection Modal */
.friend-selection-search {
    margin-bottom: 1.5rem;
}

.friend-selection-search .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.friend-selection-search .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.friend-selection-list {
    max-height: 400px;
    overflow-y: auto;
}

.friend-selection-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.friend-selection-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.friend-selection-item:hover .friend-name,
.friend-selection-item:hover .friend-username,
.friend-selection-item:hover .avatar-initials {
    color: white;
}

.friend-selection-item .friend-avatar {
    flex-shrink: 0;
}

.friend-selection-item .friend-info {
    flex: 1;
    min-width: 0;
}

.friend-selection-item .friend-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.friend-selection-item .friend-username {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.friend-selection-action {
    flex-shrink: 0;
    font-size: 1.25rem;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.friend-selection-item:hover .friend-selection-action {
    color: white;
}

.new-conversation-badge {
    display: inline-block;
    background: var(--gradient-success);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Friend Selection Modal Responsive */
@media (max-width: 768px) {
    .friend-selection-item {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .friend-selection-list {
        max-height: 300px;
    }
    
    .friend-selection-item .friend-avatar .avatar-circle {
        width: 45px;
        height: 45px;
    }
}

.status-count {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.status-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Section Headers */
.section-header-small {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header-small h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
}

.requests-count {
    background: var(--gradient-warning);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    margin-left: 0.5rem;
}

.friends-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.form-select-sm {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-background);
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 140px;
}

/* Friend Cards */
.friend-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.friend-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.friend-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.friend-card:hover:before {
    transform: scaleY(1);
}


.avatar-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    position: relative;
    overflow: hidden;
}

.avatar-initials {
    z-index: 1;
    color: white !important;
}

.friend-workout-item .avatar-initials,
.friend-avatar .avatar-initials,
.avatar-circle .avatar-initials {
    color: white !important;
}

.friend-avatar .status-indicator {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border: 3px solid var(--card-background);
    border-radius: 50%;
    z-index: 2;
}

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.friend-username {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.friend-status {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
}

.friend-status.online {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.friend-status.recently_active, .friend-status.today {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.friend-status.yesterday {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.friend-status.offline {
    color: #6b7280;
    background: rgba(107, 114, 128, 0.1);
}

.friend-last-seen {
    font-size: 0.75rem;
    color: var(--text-light);
}

.friend-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Search Section Enhancements */
.search-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--background) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.search-subtitle {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-size: 1rem;
}

.search-input-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-input {
    padding-right: 3rem;
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
}

.search-suggestions {
    margin-bottom: 2rem;
}

.search-suggestions h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 700;
}

/* Messages Panel */
/* ====== MESSAGES INTERFACE ====== */
.messages-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    height: 650px;
    gap: 0;
    background: var(--background);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    position: relative;
}

/* Mobile messaging optimizations */
@media (max-width: 768px) {
    .messages-container {
        grid-template-columns: 1fr;
        height: calc(100vh - 120px);
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    
    .conversations-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 10;
        transform: translateX(0);
        transition: transform 0.3s ease;
    }
    
    .conversations-sidebar.hidden {
        transform: translateX(-100%);
    }
    
    .chat-area {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 5;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    
    .chat-area.active {
        transform: translateX(0);
    }
}

/* ====== CONVERSATIONS SIDEBAR ====== */
.conversations-sidebar {
    background: var(--card-background);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
}

.conversations-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--card-background) 0%, rgba(99, 102, 241, 0.03) 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.conversations-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.conversations-title h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.conversations-title i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.conversations-count {
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.btn-new-chat {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.btn-new-chat:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-new-chat i {
    font-size: 1rem;
}

.conversations-search {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-background);
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-container i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    z-index: 2;
}

.search-input-container input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9rem;
    background: rgba(248, 250, 252, 0.6);
    transition: all 0.3s ease;
    outline: none;
}

.search-input-container input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    min-height: 72px; /* Touch target */
}

.conversation-item:hover {
    background: rgba(99, 102, 241, 0.05);
}

.conversation-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--primary-color);
}

.conversation-avatar {
    position: relative;
    margin-right: 1rem;
    flex-shrink: 0;
}

.conversation-avatar i {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border: 2px solid white;
    border-radius: 50%;
    background: #94a3b8;
}

.status-indicator.online {
    background: #22c55e;
}

.status-indicator.offline {
    background: #94a3b8;
}

.conversation-info {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.conversation-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.conversation-name span:first-child {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.conversation-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.message-preview {
    color: var(--text-secondary);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.conversation-unread {
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* Mobile conversation optimizations */
@media (max-width: 768px) {
    .conversation-item {
        padding: 1rem;
        min-height: 68px;
    }
    
    .conversation-avatar {
        margin-right: 0.75rem;
    }
    
    .conversation-avatar i {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .status-indicator {
        width: 10px;
        height: 10px;
        bottom: 1px;
        right: 1px;
    }
    
    .conversation-name span:first-child {
        font-size: 0.9rem;
    }
    
    .message-preview {
        font-size: 0.8rem;
    }
    
    .conversation-time {
        font-size: 0.7rem;
    }
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.conversation-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.conversation-unread {
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    margin-left: 0.5rem;
}

/* ====== CHAT MAIN AREA ====== */
.chat-main {
    display: flex;
    flex-direction: column;
    background: var(--background);
    position: relative;
}

.chat-welcome {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--background) 0%, rgba(99, 102, 241, 0.02) 100%);
}

.welcome-content {
    text-align: center;
    max-width: 400px;
}

.welcome-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.welcome-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.welcome-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.welcome-content .btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
}

.welcome-content .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 1.5rem;
    background: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-btn {
    background: var(--text-secondary);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.back-btn:hover {
    background: var(--text-primary);
    transform: translateY(-1px);
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.chat-user-details h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-status {
    font-size: 0.85rem;
    color: var(--success-color);
    font-weight: 500;
}

.chat-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-chat-action {
    background: var(--text-secondary);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.btn-chat-action:hover {
    background: var(--text-primary);
    transform: translateY(-1px);
}

.chat-messages {
    flex: 1;
    overflow-y: visible;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--background) 0%, rgba(248, 250, 252, 0.3) 100%);
    height: auto;
    max-height: none;
    min-height: 200px;
}

.message {
    display: flex;
    margin-bottom: 1.5rem;
    animation: messageSlideIn 0.3s ease;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.5rem;
    text-align: right;
}

.message.received .message-time {
    text-align: left;
}

.chat-input-container {
    padding: 1.5rem;
    background: var(--card-background);
    border-top: 1px solid var(--border-color);
}

.chat-input {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.chat-input input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    font-size: 1rem;
    background: rgba(248, 250, 252, 0.6);
    transition: all 0.3s ease;
    outline: none;
    min-height: 20px;
}

.chat-input input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-send {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
}

.btn-send:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-send:active {
    transform: translateY(0);
}

/* ====== ANIMATIONS ====== */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====== SCROLLBAR STYLES ====== */
.conversations-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.conversations-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.conversations-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ====== EMPTY STATES ====== */
.empty-conversations {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.empty-conversations i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-conversations h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-conversations p {
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 250px;
}

/* Activity Feed */
.activity-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--background) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.activity-subtitle {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-size: 1rem;
}

.activity-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0.5rem;
    background: var(--background);
    border-radius: var(--border-radius-lg);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--card-background);
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Empty conversation and error states */
.empty-conversation, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    height: 100%;
    min-height: 300px;
}

.empty-conversation .empty-icon, .error-state .error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-conversation .empty-icon {
    color: var(--primary-color);
}

.error-state .error-icon {
    color: #dc3545;
}

.empty-conversation h4, .error-state h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.empty-conversation p, .error-state p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* ====== MOBILE MESSAGES STYLES ====== */
    .messages-container {
        grid-template-columns: 1fr;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        box-shadow: none;
        border: none;
    }
    
    .conversations-sidebar {
        display: block;
        height: 100%;
    }
    
    .conversations-sidebar.hidden {
        display: none;
    }
    
    .chat-main {
        display: none;
        height: 100%;
    }
    
    .chat-main.active {
        display: flex;
    }
    
    .conversations-header {
        padding: 1rem;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .conversations-title h3 {
        font-size: 1.1rem;
    }
    
    .conversations-search {
        padding: 0.75rem 1rem;
    }
    
    .search-input-container input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.75rem 1rem 0.75rem 2.5rem;
    }
    
    .conversation-item {
        padding: 1rem;
        min-height: 72px;
    }
    
    .conversation-avatar {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    
    .conversation-name {
        font-size: 0.95rem;
    }
    
    .conversation-preview {
        font-size: 0.85rem;
    }
    
    .conversation-time {
        font-size: 0.7rem;
    }
    
    .chat-header {
        padding: 1rem;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .chat-user-info {
        gap: 0.75rem;
    }
    
    .back-btn {
        padding: 0.75rem;
        min-width: 44px;
        min-height: 44px;
    }
    
    .chat-avatar {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    
    .chat-user-details h4 {
        font-size: 1rem;
    }
    
    .chat-status {
        font-size: 0.8rem;
    }
    
    .chat-actions {
        gap: 0.5rem;
    }
    
    .btn-chat-action {
        padding: 0.75rem;
        min-width: 44px;
        min-height: 44px;
    }
    
    .chat-messages {
        padding: 1rem;
        flex: 1;
        overflow-y: visible;
        height: auto;
        min-height: 200px;
    }
    
    .message {
        margin-bottom: 1rem;
    }
    
    .message-bubble {
        max-width: 85%;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        border-radius: 16px;
    }
    
    .message.sent .message-bubble {
        border-bottom-right-radius: 4px;
    }
    
    .message.received .message-bubble {
        border-bottom-left-radius: 4px;
    }
    
    .chat-input-container {
        padding: 1rem;
        background: var(--card-background);
        border-top: 1px solid var(--border-color);
    }
    
    .chat-input {
        gap: 0.75rem;
    }
    
    .chat-input input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.75rem 1rem;
        border-radius: 20px;
        min-height: 24px;
    }
    
    .btn-send {
        padding: 0.75rem;
        min-width: 44px;
        min-height: 44px;
    }
    
    .chat-welcome {
        padding: 2rem 1rem;
        text-align: center;
    }
    
    .welcome-content h3 {
        font-size: 1.25rem;
    }
    
    .welcome-content p {
        font-size: 0.9rem;
    }
    
    .welcome-content .btn-primary {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    /* Mobile conversation search focus fix */
    .conversations-search input:focus {
        transform: none;
        zoom: 1;
    }
    
    /* Mobile message input focus fix */
    .chat-input input:focus {
        transform: none;
        zoom: 1;
    }
    
    .friends-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .online-status-summary {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .friend-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .friend-actions {
        justify-content: center;
    }
    
    .friends-tabs {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 0 0.5rem;
    }
    
    .friends-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .friends-tabs .tab-btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
        flex: 1;
        min-width: 120px;
        white-space: nowrap;
    }
    
    .section-header-small {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .activity-filters {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .friends-tabs .tab-btn {
        padding: 0.6rem 0.7rem;
        font-size: 0.8rem;
    }
    
    .friend-actions .view-workouts, 
    .friend-actions .view-profile {
        font-size: 0.75rem;
        padding: 0.5rem 0.4rem;
        min-width: 70px;
    }
    
    .close-btn {
        top: 1rem;
        right: 1rem;
        width: 2.75rem;
        height: 2.75rem;
    }
}

/* ============== PROFILE PAGE STYLES ============== */

.profile-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.profile-header-card {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    flex-shrink: 0;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.profile-info-main {
    flex: 1;
}

.profile-info-main h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.profile-info-main p {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.profile-stats-quick {
    display: flex;
    gap: 2rem;
}

.quick-stat {
    text-align: center;
}

.quick-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.quick-stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-tabs {
    display: flex;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.profile-tab-btn {
    flex: 1;
    padding: 1.5rem 1rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.profile-tab-btn:hover {
    background: rgba(99, 102, 241, 0.05);
    color: #6366f1;
}

.profile-tab-btn.active {
    background: #6366f1;
    color: white;
}

.profile-tab-content {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.profile-tab-pane {
    display: none;
}

.profile-tab-pane.active {
    display: block;
}

.profile-overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.profile-card {
    background: #f8fafc;
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.profile-card h3 {
    margin: 0 0 1rem 0;
    color: #374151;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.achievements-content {
    padding: 0;
}

.achievements-summary {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border-radius: var(--border-radius);
}

.achievements-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.achievement-stat {
    text-align: center;
}

.achievement-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.achievement-stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.achievement-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card.unlocked {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0.05) 100%);
}

.achievement-card.unlocked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.achievement-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    background: #f3f4f6;
    color: #6b7280;
}

.achievement-card.unlocked .achievement-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.achievement-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #374151;
}

.achievement-description {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.achievement-progress {
    background: #f3f4f6;
    border-radius: 100px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 100px;
    transition: width 0.3s ease;
}

.achievement-progress-text {
    font-size: 0.8rem;
    color: #6b7280;
}

.achievement-card.unlocked .achievement-progress-fill {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.achievement-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #b8651c 100%);
    color: white;
}

.badge-silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    color: white;
}

.badge-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: #333;
}

.badge-platinum {
    background: linear-gradient(135deg, #e5e4e2 0%, #d1d0ce 100%);
    color: #333;
}

@media (max-width: 768px) {
    .profile-header-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1rem;
    }
    
    .profile-avatar-large {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
    
    .profile-info-main h2 {
        font-size: 2rem;
    }
    
    .profile-stats-quick {
        justify-content: center;
        gap: 1.5rem;
    }
    
    .profile-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .profile-tab-btn {
        white-space: nowrap;
        min-width: 120px;
    }
    
    .profile-overview-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .achievements-stats {
        gap: 1rem;
    }
}

/* Additional Profile Page Styles */
.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-weight: 600;
    color: #374151;
}

.info-item span {
    color: #6b7280;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.activity-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

.goals-stats-profile {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.goal-stat-item {
    text-align: center;
}

.goal-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 0.25rem;
}

.goal-stat-label {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-goal-card {
    background: #f8fafc;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
}

.goal-info h4 {
    margin: 0 0 0.5rem 0;
    color: #374151;
    font-size: 1.1rem;
}

.goal-info p {
    margin: 0 0 1rem 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.goal-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 100px;
    transition: width 0.3s ease;
}

.progress-text {
    font-weight: 600;
    color: #6366f1;
    min-width: 3rem;
    text-align: right;
}

.goal-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-completed {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.status-paused {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stats-grid-profile {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-item-profile {
    background: #f8fafc;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.stat-item-profile i {
    font-size: 2rem;
    color: #6366f1;
}

.stat-info {
    text-align: center;
}

.stat-item-profile .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.25rem;
}

.stat-item-profile .stat-label {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievement-unlocked-date {
    font-size: 0.875rem;
    color: #10b981;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .goals-stats-profile {
        gap: 1rem;
    }
    
    .goal-stat-value {
        font-size: 1.5rem;
    }
    
    .stats-grid-profile {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-item-profile {
        padding: 1rem;
    }
    
    .stat-item-profile i {
        font-size: 1.5rem;
    }
    
    .stat-item-profile .stat-value {
        font-size: 1.2rem;
    }
}

/* ============== WEIGHT TRACKING STYLES ============== */

.weight-tracking-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.weight-tracking-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.weight-tracking-card .card-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weight-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.current-weight {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.weight-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.weight-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.weight-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.weight-change.increase {
    color: #dc3545;
}

.weight-change.decrease {
    color: #28a745;
}

.weight-change.neutral {
    color: var(--text-secondary);
}

.total-change {
    margin-bottom: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.total-change small {
    color: var(--text-secondary);
}

.goal-progress {
    margin-bottom: 1rem;
}

.goal-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.goal-info small {
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

/* Weight Entry Modal */
.weight-input-container {
    display: flex;
    gap: 0.5rem;
}

.weight-input-container input {
    flex: 1;
}

.weight-input-container select {
    min-width: 80px;
}

#weightNotes {
    min-height: 80px;
    resize: vertical;
}

/* Weight Trends Page */
.weight-trends-container {
    padding: 1.5rem;
}

.weight-trends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.weight-chart-container {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.weight-chart {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
}

.weight-entries-list {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.weight-entry-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.weight-entry-item:last-child {
    border-bottom: none;
}

.weight-entry-item:hover {
    background: rgba(99, 102, 241, 0.05);
}

.weight-entry-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.weight-entry-value {
    font-weight: 600;
    color: var(--text-primary);
}

.weight-entry-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.weight-entry-notes {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.25rem;
}

.weight-entry-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-icon.btn-danger:hover {
    background: #dc3545;
    color: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .weight-tracking-card {
        padding: 1rem;
    }
    
    .weight-tracking-card .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .weight-stats {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .weight-trends-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .weight-entry-item {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }
    
    .weight-entry-actions {
        justify-content: center;
    }
    
    .card-actions {
        justify-content: center;
    }
}

/* ============== EXERCISE IMAGES AND INSTRUCTIONS ============== */

/* Exercise card images */
.exercise-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.exercise-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.exercise-image img:hover {
    transform: scale(1.05);
}

/* Exercise instructions modal */
.exercise-instructions {
    max-height: 70vh;
    overflow-y: auto;
}

.instructions-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

.instructions-images img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.instructions-images img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.instructions-steps {
    margin-bottom: 1.5rem;
}

.instructions-steps h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.instructions-steps ol {
    padding-left: 1.25rem;
    line-height: 1.6;
}

.instructions-steps li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.instructions-muscles,
.instructions-equipment {
    padding: 1rem;
    background: rgba(var(--primary-color-rgb), 0.05);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.instructions-muscles h3,
.instructions-equipment h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.instructions-muscles p,
.instructions-equipment p {
    margin: 0.25rem 0;
    color: var(--text-primary);
}

/* Large modal for instructions */
#exerciseInstructionsModal .modal-content {
    max-width: 700px;
    width: 90vw;
}

@media (max-width: 768px) {
    .exercise-image {
        height: 100px;
    }
    
    .instructions-images {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .instructions-images img {
        height: 100px;
    }
    
    #exerciseInstructionsModal .modal-content {
        width: 95vw;
        margin: 1rem;
    }
    
    .exercise-instructions {
        max-height: 60vh;
    }
}

/* Collapsible Weight Tracking Styles */
.collapsible-card {
    margin-bottom: 2rem;
}

.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background-color 0.2s;
}

.collapsible-header:hover {
    background-color: #f8f9fa;
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.weight-summary {
    font-size: 0.9rem;
    color: #666;
    font-weight: normal;
}

.collapse-icon {
    font-size: 1.2rem;
    color: #667eea;
    transition: transform 0.2s;
}

.collapsible-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Weight Trends Modal Styles */
.weight-trends-modal .modal-content {
    max-width: 900px;
    width: 90vw;
    max-height: 90vh;
}

.trends-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.trends-tabs .tab-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.trends-tabs .tab-btn.active {
    background: #667eea;
    color: white;
}

.trends-tabs .tab-btn:hover:not(.active) {
    background: #f0f0f0;
}

.trends-content {
    position: relative;
}

.trends-content .tab-content {
    display: none;
}

.trends-content .tab-content.active {
    display: block;
}

.chart-container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.chart-container canvas {
    max-width: 100%;
    height: auto;
}

.trend-stats {
    margin-top: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.stat-value.increase {
    color: #dc3545;
}

.stat-value.decrease {
    color: #28a745;
}

.weight-history {
    max-height: 400px;
    overflow-y: auto;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.entry-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.entry-weight {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

.entry-date {
    font-size: 0.9rem;
    color: #666;
}

.entry-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.entry-notes {
    color: #667eea;
    font-size: 1.1rem;
    cursor: help;
}

.dashboard-weight-section {
    margin-top: 2rem;
}

/* Mobile responsiveness for weight tracking */
@media (max-width: 768px) {
    .header-right {
        gap: 0.5rem;
    }
    
    .weight-summary {
        font-size: 0.8rem;
    }
    
    .weight-trends-modal .modal-content {
        width: 95vw;
        margin: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.5rem;
    }
    
    .stat-item {
        padding: 0.75rem;
    }
    
    .history-entry {
        padding: 0.75rem;
    }
    
    .entry-actions {
        gap: 0.25rem;
    }
    
    .chart-container {
        padding: 0.75rem;
    }
}

/* Comprehensive Goals System Styles */
.goals-tracking-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.goals-tracking-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.goals-tracking-card .card-header h4 {
    margin: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-goal {
    margin-bottom: 1.5rem;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.goal-info h5 {
    margin: 0 0 0.25rem 0;
    color: #333;
    font-size: 1.1rem;
}

.goal-category {
    font-size: 0.9rem;
    color: #666;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.goal-priority {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.priority-high {
    background: #fee;
    color: #c53030;
}

.priority-medium {
    background: #fef5e7;
    color: #d69e2e;
}

.priority-low {
    background: #f0fff4;
    color: #38a169;
}

.goal-progress {
    margin-bottom: 1rem;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.low {
    background: linear-gradient(90deg, #f56565, #fc8181);
}

.progress-fill.medium {
    background: linear-gradient(90deg, #ed8936, #f6ad55);
}

.progress-fill.high {
    background: linear-gradient(90deg, #48bb78, #68d391);
}

.progress-fill.completed {
    background: linear-gradient(90deg, #38b2ac, #4fd1c7);
}

.progress-text {
    font-weight: bold;
    color: #333;
    min-width: 40px;
}

.goal-details {
    font-size: 0.9rem;
    color: #666;
}

.goal-timeline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* Dashboard Goals Section - Modern Design */
.dashboard-goals-section {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.dashboard-goals-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
}

.goals-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
}

.goals-title {
    flex: 1;
}

.goals-title h2 {
    margin: 0 0 0.5rem 0;
    color: #1a202c;
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.goals-title h2 i {
    color: #667eea;
    font-size: 1.5rem;
}

.goals-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 1rem;
    line-height: 1.5;
}

.goals-add-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.goals-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.goals-add-btn i {
    font-size: 0.9rem;
}

/* Goals Stats Cards */
.goals-summary {
    margin-bottom: 2rem;
}

.goals-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    transition: all 0.3s ease;
}

.stat-card.active-goals::before {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.stat-card.completed-goals::before {
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
}

.stat-card.progress-stat::before {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.active-goals .stat-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.completed-goals .stat-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.progress-stat .stat-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-content {
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Goals List */
.goals-list {
    margin-top: 1.5rem;
}

.goal-summary-item {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.goal-summary-item:hover {
    background: #f1f5f9;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.goal-info h5 {
    margin: 0 0 0.25rem 0;
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
}

.goal-category {
    font-size: 0.875rem;
    color: #667eea;
    background: #e6f3ff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: capitalize;
}

.goal-progress-mini {
    text-align: right;
    min-width: 80px;
}

.goal-progress-mini span {
    font-weight: 600;
    color: #667eea;
    font-size: 1rem;
}

/* Modern Goals Empty State */
.goals-empty {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.goals-empty:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f1f5f9 0%, #ffffff 100%);
}

.empty-icon {
    margin-bottom: 1.5rem;
}

.empty-icon i {
    font-size: 3rem;
    color: #94a3b8;
    opacity: 0.7;
}

.empty-content h4 {
    margin: 0 0 1rem 0;
    color: #334155;
    font-size: 1.25rem;
    font-weight: 600;
}

.empty-content p {
    margin: 0 0 2rem 0;
    color: #64748b;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-content .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.empty-content .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* Individual Goal Cards */
.goal-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.goal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
}

.goal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.goal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.goal-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.goal-card-category {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goal-card-progress {
    margin-bottom: 1rem;
}

.goal-progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.goal-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #64748b;
}

.goal-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.goal-card-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Exercise Picker Modal Styles */
.exercise-picker-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10002 !important;
    background: rgba(0, 0, 0, 0.8) !important;
}

.exercise-picker-modal .modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    margin: auto;
    position: relative;
    z-index: 10003;
}

.exercise-picker-modal .modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
}

.exercise-picker-modal .modal-header h3 {
    margin: 0;
    color: #1a202c;
    font-size: 1.25rem;
    font-weight: 600;
}

.exercise-picker-modal .close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: bold;
    color: #ffffff !important;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.75rem;
    border-radius: 50%;
    transition: all 0.2s;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exercise-picker-modal .close:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    transform: translateY(-50%) scale(1.1);
}

.exercise-picker-modal #exerciseSearch {
    width: 100% !important;
    padding: 0.75rem !important;
    font-size: 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    margin-bottom: 1rem !important;
}

.exercise-picker-modal #exerciseSearch:focus {
    outline: none !important;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

.exercise-picker-modal .exercise-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.exercise-picker-modal .exercise-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s;
}

.exercise-picker-modal .exercise-item:last-child {
    border-bottom: none;
}

.exercise-picker-modal .exercise-item:hover {
    background: #f8fafc;
}

.exercise-picker-modal .exercise-name {
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.exercise-picker-modal .exercise-meta {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 4px;
}

/* Exercise picker form styles */
.exercise-picker {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.exercise-picker input[readonly] {
    flex: 1;
    min-width: 200px;
    cursor: pointer;
}

.exercise-picker.exercise-selected input[readonly] {
    background: #f0fdf4;
    border-color: #16a34a;
}

.exercise-picker button {
    white-space: nowrap;
    min-width: 150px;
}

@media (max-width: 768px) {
    .exercise-picker {
        flex-direction: column;
        align-items: stretch;
    }
    
    .exercise-picker input[readonly] {
        min-width: unset;
        width: 100%;
    }
    
    .exercise-picker button {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Required field indicator */
.required {
    color: #dc2626;
    font-weight: 600;
}

/* Radio Group Styling */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
}

.radio-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.radio-option input[type="radio"] {
    margin: 0;
    accent-color: #667eea;
}

.radio-option input[type="radio"]:checked + .radio-label {
    font-weight: 600;
    color: #667eea;
}

.radio-label {
    font-size: 0.95rem;
    color: #495057;
    cursor: pointer;
}

/* Checkbox Option Styling */
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
}

.checkbox-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.checkbox-option input[type="checkbox"] {
    margin: 0;
    accent-color: #667eea;
    transform: scale(1.2);
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-label {
    font-weight: 600;
    color: #667eea;
}

.checkbox-label {
    font-size: 0.95rem;
    color: #495057;
    cursor: pointer;
}

/* Login form checkbox styles removed - automatic persistence enabled */

/* Volume Calculator Styling */
.volume-calculator {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
}

.calculated-volume {
    text-align: center;
    font-size: 1.1rem;
    color: #667eea;
}

.calculated-volume strong {
    display: block;
    font-weight: 700;
}

/* Form Help Text */
.form-help {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Expandable Goal Rows Styling */
.goal-row {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
}

.goal-row:hover {
    border-color: rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1);
}

.goal-row.expanded {
    border-color: #667eea;
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.15);
}

.goal-row.primary-goal {
    border-left: 4px solid #667eea;
}

.goal-row-header {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.goal-row-header:hover {
    background: rgba(102, 126, 234, 0.02);
}

.goal-row-main {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 1rem;
}

.goal-row-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.goal-row-info {
    flex: 1;
    min-width: 0;
}

.goal-row-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.goal-row-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.goal-row-meta .goal-category {
    font-size: 0.75rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goal-row-meta .goal-priority {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goal-row-meta .goal-priority.priority-high {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.goal-row-meta .goal-priority.priority-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.goal-row-meta .goal-priority.priority-low {
    background: rgba(34, 197, 94, 0.1);
    color: #059669;
}

.goal-row-meta .goal-deadline {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.goal-row-progress {
    flex-shrink: 0;
}

.progress-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: conic-gradient(#667eea 0deg, #667eea var(--progress, 0deg), #e5e7eb var(--progress, 0deg), #e5e7eb 360deg);
}

.progress-circle::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
}

.progress-circle .progress-percentage {
    position: relative;
    z-index: 1;
    font-size: 0.8rem;
    font-weight: 700;
    color: #667eea;
}

.progress-circle.completed {
    background: conic-gradient(#10b981 0deg, #10b981 360deg);
}

.progress-circle.completed .progress-percentage {
    color: #10b981;
}

.goal-row-expand {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transition: all 0.3s ease;
}

.expand-icon {
    transition: transform 0.3s ease;
}

.goal-row-details {
    border-top: 1px solid rgba(102, 126, 234, 0.08);
    background: rgba(248, 250, 252, 0.5);
}

.goal-details-content {
    padding: 2rem;
    background: rgba(248, 250, 252, 0.3);
    border-radius: 0 0 12px 12px;
}

.goal-details-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.goal-description p {
    color: #64748b;
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

.goal-progress-detailed {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.goal-progress-detailed .progress-info {
    margin-bottom: 0.75rem;
}

.goal-progress-detailed .progress-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.goal-progress-detailed .progress-bar {
    height: 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.goal-progress-detailed .progress-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.4s ease;
}

.goal-progress-detailed .progress-fill.low {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.goal-progress-detailed .progress-fill.medium {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.goal-progress-detailed .progress-fill.high {
    background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%);
}

.goal-progress-detailed .progress-fill.completed {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.goal-metadata {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.metadata-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.05);
}

.metadata-row:last-child {
    border-bottom: none;
}

.metadata-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
}

.metadata-value {
    font-size: 0.9rem;
    color: #1a202c;
    font-weight: 500;
}

.metadata-value.priority-high {
    color: #dc2626;
}

.metadata-value.priority-medium {
    color: #d97706;
}

.metadata-value.priority-low {
    color: #059669;
}

.goal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(102, 126, 234, 0.08);
}

.goal-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.goal-actions .btn-danger {
    border-color: #ef4444;
    color: #ef4444;
}

.goal-actions .btn-danger:hover {
    background: #ef4444;
    color: white;
}

/* Goals Rows Container */
.goals-rows-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

/* Primary Badge Styling */
.primary-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 0.5rem;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

@media (max-width: 768px) {
    .radio-group {
        gap: 0.5rem;
        margin: 0.5rem 0;
    }
    
    .radio-option, .checkbox-option {
        padding: 0.75rem;
        border-radius: 8px;
        margin-bottom: 0.5rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .radio-label, .checkbox-label {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .volume-calculator {
        padding: 0.75rem;
        margin-top: 0.75rem;
        border-radius: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .calculated-volume {
        font-size: 0.9rem;
    }
    
    .calculated-volume strong {
        font-size: 1rem;
    }
    
    /* Exercise picker mobile styling */
    .exercise-picker {
        width: 100%;
        box-sizing: border-box;
    }
    
    .exercise-picker .form-input {
        margin-bottom: 0.5rem;
    }
    
    .exercise-picker .btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    /* Form help text mobile */
    .form-help {
        font-size: 0.8rem;
        margin-top: 0.5rem;
        line-height: 1.4;
    }
    
    /* Goal creation form mobile adjustments */
    .goal-creation-form {
        padding: 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .form-actions {
        margin-top: 1.5rem;
        gap: 0.75rem;
    }
    
    .form-actions .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
}

.form-help {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Mobile Responsive Goals Styles */
/* Dashboard Goal Creation Form */
.goal-creation-form {
    margin-top: 2rem;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.goals-toggle-btn.active {
    background: #dc2626;
    color: white;
}

.goals-toggle-btn.active:hover {
    background: #b91c1c;
}

.dashboard-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 8px;
    border: 1px solid;
    font-weight: 500;
}

.dashboard-message.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.dashboard-message.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.dashboard-message.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Dashboard Goal Summary Items */
.goal-summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.goal-summary-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.goal-info {
    flex: 1;
}

.goal-info h5 {
    margin: 0 0 0.25rem 0;
    color: #1a202c;
    font-size: 1rem;
    font-weight: 600;
}

.goal-category {
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: capitalize;
}

.goal-progress-mini {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
}

.goal-progress-mini span {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.mini-progress-bar {
    width: 40px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.3s ease;
}

.goal-actions {
    display: flex;
    gap: 0.5rem;
}

.goal-actions .btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.goal-actions .btn-icon:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.goal-actions .btn-icon i {
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .dashboard-goals-section {
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Dashboard Goals Stats - Stack Vertically on Mobile */
    .goals-stats {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .goals-stats .stat-card {
        width: 100% !important;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(102, 126, 234, 0.1);
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
    }
    
    .goals-stats .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1);
    }
    
    .goals-stats .stat-card .stat-icon {
        margin-right: 1rem;
        flex-shrink: 0;
    }
    
    .goals-stats .stat-card .stat-icon i {
        font-size: 1.5rem;
        color: #667eea;
    }
    
    .goals-stats .stat-card .stat-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .goals-stats .stat-card .stat-number {
        font-size: 1.5rem;
        font-weight: 700;
        color: #1a202c;
        margin-bottom: 0.25rem;
    }
    
    .goals-stats .stat-card .stat-label {
        font-size: 0.85rem;
        color: #64748b;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .goal-creation-form {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .goal-creation-form .form-group {
        margin-bottom: 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .goal-creation-form .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .goal-creation-form .form-input,
    .goal-creation-form .form-select {
        width: 100%;
        box-sizing: border-box;
        font-size: 16px;
        padding: 0.75rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .form-actions button {
        width: 100%;
        box-sizing: border-box;
        min-height: 44px;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
    
    .goal-summary-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .goal-info {
        text-align: center;
    }
    
    .goal-progress-mini {
        justify-content: center;
        min-width: unset;
    }
    
    .mini-progress-bar {
        width: 60px;
    }
    
    .goal-actions {
        justify-content: center;
    }
    
    .goals-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .goals-title h2 {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .goals-title h2 i {
        font-size: 1.25rem;
    }
    
    .goals-subtitle {
        font-size: 0.9rem;
    }
    
    .goals-add-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        font-size: 1rem;
    }
    
    .goals-add-btn .btn-text {
        display: inline;
    }
    
    .goals-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .goals-empty {
        padding: 2rem 1rem;
    }
    
    .empty-icon i {
        font-size: 2.5rem;
    }
    
    .empty-content h4 {
        font-size: 1.1rem;
    }
    
    .empty-content p {
        font-size: 0.9rem;
    }
    
    .empty-content .btn {
        width: 100%;
        padding: 1rem;
        justify-content: center;
        font-size: 1rem;
    }
    
    .goal-card {
        padding: 1.25rem;
    }
    
    .goal-card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .goal-card-title {
        font-size: 1rem;
    }
    
    .goal-card-category {
        align-self: flex-start;
    }
    
    .goal-card-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .goal-card-actions .btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .dashboard-goals-section {
        padding: 1rem;
    }
    
    .goals-title h2 {
        font-size: 1.25rem;
    }
    
    .goals-subtitle {
        font-size: 0.85rem;
    }
    
    .goals-stats {
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .empty-content h4 {
        font-size: 1rem;
    }
    
    .empty-content p {
        font-size: 0.85rem;
    }
    
    .goal-card {
        padding: 1rem;
    }
}

.view-all-goals {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.goals-summary {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.goals-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.goal-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-width: 120px;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

.secondary-goals h5 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1rem;
}

.mini-goal-card {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mini-goal-card:hover {
    background: #f1f5f9;
    border-color: #667eea;
}

.mini-goal-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.mini-goal-title {
    font-weight: 500;
    color: #333;
}

.mini-goal-progress {
    font-size: 0.9rem;
    color: #667eea;
    font-weight: bold;
}

.mini-progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: #667eea;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.goals-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
    margin-top: 1rem;
}

.goals-empty i {
    font-size: 4rem;
    color: #cbd5e0;
    margin-bottom: 1.5rem;
    display: block;
}

.goals-empty h4 {
    margin: 0 0 1rem 0;
    color: #4a5568;
    font-size: 1.5rem;
    font-weight: 600;
}

.goals-empty p {
    margin: 0;
    color: #718096;
    font-size: 1rem;
    line-height: 1.5;
}

.no-goals {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.no-goals i {
    font-size: 3rem;
    color: #cbd5e0;
    margin-bottom: 1rem;
}

.no-goals h5 {
    margin: 0 0 0.5rem 0;
    color: #333;
}



.goals-content .tab-content {
    display: none;
}

.goals-content .tab-content.active {
    display: block;
}

.goals-overview {
    max-height: 60vh;
    overflow-y: auto;
}

.goals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.goals-header h4 {
    margin: 0;
    color: #333;
}

.goal-category-section {
    margin-bottom: 2rem;
}

.goal-category-section h5 {
    margin: 0 0 1rem 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.goal-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.goal-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.1);
}

.goal-card.primary-goal-card {
    border-color: #667eea;
    background: #f8f9ff;
}

.goal-card.achieved {
    border-color: #38b2ac;
    background: #f0fdfa;
}

.goal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.goal-title {
    flex: 1;
}

.goal-title h6 {
    margin: 0 0 0.25rem 0;
    color: #333;
    font-size: 1rem;
}

.primary-badge {
    background: #667eea;
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-weight: bold;
    text-transform: uppercase;
}

.goal-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: #666;
    padding: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: #f1f5f9;
    color: #333;
}

.goal-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.goal-progress-section {
    margin-bottom: 1rem;
}

.progress-display {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.progress-percentage {
    font-weight: bold;
    color: #667eea;
    min-width: 45px;
}

.goal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #666;
}

.goal-type {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

.goal-deadline {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Goal Creation Form */
.goal-creation-form {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.form-header {
    margin-bottom: 1.5rem;
}

.form-header h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.form-header p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d2d6dc;
    border-radius: 4px;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

/* Templates View */
.templates-view {
    max-height: 60vh;
    overflow-y: auto;
}

.templates-header {
    margin-bottom: 1.5rem;
}

.templates-header h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.templates-header p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.template-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.template-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.template-icon {
    background: #667eea;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.template-info h5 {
    margin: 0 0 0.25rem 0;
    color: #333;
    font-size: 1rem;
}

.template-category {
    font-size: 0.8rem;
    color: #666;
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

.template-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.template-details {
    font-size: 0.8rem;
    color: #333;
    margin-bottom: 1rem;
}

.template-details span {
    display: block;
    margin-bottom: 0.25rem;
}

.template-actions {
    text-align: center;
}

.no-goals-overview {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.no-goals-overview i {
    font-size: 4rem;
    color: #cbd5e0;
    margin-bottom: 1.5rem;
}

.no-goals-overview h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

    
    
    /* Enhanced tab content */
    .tab-content {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 0;
        box-sizing: border-box;
        width: 100%;
        min-height: calc(100vh - 200px);
        overflow-x: hidden;
    }
    
    /* Enhanced Goals Overview Tab */
    .goals-summary {
        padding: 1.5rem;
        background: white;
        margin: 0 0 1.5rem 0;
        border-radius: 16px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }
    
    .goal-stats {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 0;
    }
    
    .stat-item {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 1.5rem 1rem;
        border-radius: 16px;
        text-align: center;
        border: none;
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25);
        transition: all 0.3s ease;
    }
    
    .stat-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
    }
    
    .stat-number {
        display: block;
        font-size: 2rem;
        font-weight: 800;
        color: white;
        margin-bottom: 0.5rem;
        text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .stat-label {
        font-size: 0.85rem;
        color: rgba(255,255,255,0.9);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        line-height: 1.2;
    }
    
    /* Enhanced Goals Grid and List */
    .goals-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .goals-list {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 0;
    }
    
    /* Enhanced Goal Cards */
    .goal-card {
        background: white !important;
        border: none !important;
        border-radius: 16px !important;
        overflow: visible !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
        transition: all 0.3s ease;
        margin-bottom: 1rem !important;
    }
    
    .goal-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
    }
    
    .goal-card-header {
        padding: 1.5rem 1.5rem 1rem !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white;
        position: relative;
    }
    
    .goal-card-header h4 {
        color: white !important;
        font-size: 1.2rem !important;
        font-weight: 700 !important;
        margin: 0 0 0.75rem 0 !important;
        text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .goal-card-header .goal-type {
        background: rgba(255,255,255,0.2) !important;
        color: white !important;
        padding: 0.5rem 1rem !important;
        border-radius: 20px !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        display: inline-block;
        backdrop-filter: blur(10px);
    }
    
    .goal-card-body {
        padding: 1.5rem !important;
        overflow: visible !important;
    }
    
    /* Fix goal descriptions being cut off */
    .goal-description,
    .goal-card .goal-description,
    .goal-card-body .goal-description {
        overflow: visible !important;
        text-overflow: initial !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        line-height: 1.5 !important;
        margin-bottom: 1rem !important;
        max-height: none !important;
        height: auto !important;
        color: #64748b !important;
        font-size: 0.95rem !important;
    }
    
    .goal-description p {
        margin: 0 0 0.75rem 0 !important;
        overflow: visible !important;
        text-overflow: initial !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        line-height: 1.5 !important;
        color: #64748b !important;
    }
    
    .goal-description p:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Ensure goal content areas don't have overflow hidden */
    .goal-content,
    .goal-details,
    .goal-info {
        overflow: visible !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    .progress-info {
        margin-bottom: 1.5rem !important;
        overflow: visible !important;
    }
    
    .progress-bar {
        height: 8px !important;
        border-radius: 4px !important;
        margin-top: 0.75rem !important;
        background: #f1f5f9 !important;
        overflow: hidden;
    }
    
    .progress-bar-fill {
        height: 100%;
        background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
        border-radius: 4px;
        transition: width 0.3s ease;
    }
    
    .goal-actions {
        gap: 0.75rem !important;
        flex-wrap: wrap;
        margin-top: 1rem;
    }
    
    .goal-actions .btn {
        min-height: 44px !important;
        padding: 0.75rem 1rem !important;
        flex: 1;
        font-size: 0.9rem !important;
        border-radius: 10px !important;
        font-weight: 600 !important;
        border: none !important;
        transition: all 0.3s ease;
    }
    
    .goal-actions .btn-primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
    }
    
    .goal-actions .btn-secondary {
        background: #6c757d !important;
        color: white !important;
    }
    
    .goal-actions .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    
    /* Enhanced Goal Creation Forms */
    .goal-types-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        padding: 0 !important;
        margin-bottom: 2rem;
    }
    
    .goal-type-card {
        padding: 2rem 1.5rem !important;
        border-radius: 16px !important;
        border: 2px solid #e9ecef !important;
        background: white !important;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        min-height: 140px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        position: relative;
        overflow: hidden;
    }
    
    .goal-type-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 1;
    }
    
    .goal-type-card > * {
        position: relative;
        z-index: 2;
    }
    
    .goal-type-card:hover::before,
    .goal-type-card.selected::before {
        opacity: 1;
    }
    
    .goal-type-card:hover,
    .goal-type-card.selected {
        border-color: #667eea !important;
        color: white !important;
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    }
    
    .goal-type-card i {
        font-size: 2.5rem !important;
        margin-bottom: 1rem !important;
        transition: all 0.3s ease;
    }
    
    .goal-type-card h4 {
        font-size: 1.2rem !important;
        margin: 0 0 0.75rem 0 !important;
        font-weight: 700 !important;
        transition: all 0.3s ease;
    }
    
    .goal-type-card p {
        font-size: 0.9rem !important;
        margin: 0 !important;
        opacity: 0.8;
        line-height: 1.4;
        transition: all 0.3s ease;
    }
    
    /* Enhanced Form Elements */
    .form-group {
        margin-bottom: 2rem !important;
    }
    
    .form-group label {
        font-size: 1rem !important;
        font-weight: 600 !important;
        margin-bottom: 0.75rem !important;
        display: block;
        color: #1a202c;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100% !important;
        padding: 1rem 1.25rem !important;
        font-size: 1rem !important;
        border: 2px solid #e9ecef !important;
        border-radius: 12px !important;
        min-height: 50px;
        box-sizing: border-box;
        background: white;
        transition: all 0.3s ease;
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: #667eea !important;
        outline: none !important;
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1) !important;
        background: #f8f9ff;
    }
    
    
    
    
    /* Form Steps */
    .form-step {
        margin-bottom: 2rem;
    }
    
    .form-step h3 {
        font-size: 1.3rem;
        font-weight: 700;
        margin-bottom: 1.5rem;
        color: #1a202c;
        text-align: center;
    }
    
    /* Step navigation */
    .step-navigation {
        display: flex;
        gap: 1rem;
        justify-content: space-between;
        margin-top: 2rem;
        padding-top: 2rem;
        border-top: 1px solid #e9ecef;
    }
    
    .step-navigation .btn {
        flex: 1;
        max-width: 200px;
    }
    


    .goals-section-header {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #f0f0f0;
    }

    .goals-section-header h3 {
        margin: 0;
        font-size: 1.25rem;
        color: #333;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .goals-section-header .section-count {
        background: #e9ecef;
        color: #495057;
        padding: 0.25rem 0.5rem;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 600;
        margin-left: auto;
    }

    .goals-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
    }

    /* Goal Modal Card Styles */
    .goal-modal-card {
        background: white;
        border: 1px solid #e9ecef;
        border-radius: 12px;
        padding: 1rem;
        transition: all 0.2s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .goal-modal-card:hover {
        border-color: #667eea;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
        transform: translateY(-1px);
    }

    .goal-modal-card.completed {
        background: #f8f9fa;
        border-color: #28a745;
    }

    .goal-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 0.75rem;
    }

    .goal-card-icon {
        width: 40px;
        height: 40px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.1rem;
    }

    .goal-card-badges {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-end;
    }

    .badge {
        padding: 0.25rem 0.5rem;
        border-radius: 6px;
        font-size: 0.65rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .badge-primary {
        background: #ffd700;
        color: #8B4513;
    }

    .badge-category {
        background: #e9ecef;
        color: #495057;
    }

    .badge-priority.priority-high {
        background: #ff6b6b;
        color: white;
    }

    .badge-priority.priority-medium {
        background: #feca57;
        color: #2c2c2c;
    }

    .badge-priority.priority-low {
        background: #48dbfb;
        color: white;
    }

    .goal-card-content {
        margin-bottom: 0.75rem;
    }

    .goal-card-title {
        margin: 0 0 0.5rem 0;
        font-size: 1rem;
        font-weight: 600;
        color: #2c3e50;
        line-height: 1.3;
    }

    .goal-card-description {
        margin: 0 0 0.75rem 0;
        font-size: 0.875rem;
        color: #6c757d;
        line-height: 1.4;
    }

    .goal-card-progress {
        margin-bottom: 0.75rem;
    }

    .progress-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.5rem;
    }

    .progress-label {
        font-size: 0.8rem;
        color: #495057;
        font-weight: 500;
    }

    .progress-percentage {
        font-size: 0.8rem;
        font-weight: 600;
        color: #667eea;
    }

    .goal-card-meta {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .meta-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.8rem;
        color: #6c757d;
    }

    .meta-item i {
        width: 12px;
        color: #adb5bd;
    }

    .meta-item.overdue {
        color: #dc3545;
    }

    .meta-item.overdue i {
        color: #dc3545;
    }

    .goal-card-actions {
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
        padding-top: 0.75rem;
        border-top: 1px solid #f8f9fa;
    }

    .goal-card-actions .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    /* Mobile responsive styles for goals modal */
    @media (max-width: 768px) {
        .goals-grid {
            grid-template-columns: 1fr;
            gap: 0.75rem;
        }

        .goal-modal-card {
            padding: 0.875rem;
        }

        .goal-card-header {
            margin-bottom: 0.5rem;
        }

        .goal-card-icon {
            width: 35px;
            height: 35px;
            font-size: 1rem;
        }

        .badge {
            font-size: 0.6rem;
            padding: 0.2rem 0.4rem;
        }

        .goal-card-title {
            font-size: 0.95rem;
        }

        .goal-card-description {
            font-size: 0.8rem;
        }

        .progress-label,
        .progress-percentage {
            font-size: 0.75rem;
        }

        .meta-item {
            font-size: 0.75rem;
        }

        .goal-card-actions .btn {
            font-size: 0.7rem;
            padding: 0.3rem 0.6rem;
        }

        .goals-section-header h3 {
            font-size: 1.1rem;
        }

        .goals-section-header .section-count {
            font-size: 0.7rem;
            padding: 0.2rem 0.4rem;
        }
    }
    
    /* Mobile Goal Rows */
    .goal-row {
        margin-bottom: 0.75rem;
        border-radius: 8px;
    }
    
    .goal-row-main {
        padding: 0.875rem 1rem;
        gap: 0.75rem;
    }
    
    .goal-row-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    .goal-row-title {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .goal-row-meta {
        gap: 0.5rem;
        margin-top: 0.25rem;
    }
    
    .goal-row-meta .goal-category {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .goal-row-meta .goal-priority {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .goal-row-meta .goal-deadline {
        font-size: 0.7rem;
    }
    
    .progress-circle {
        width: 45px;
        height: 45px;
    }
    
    .progress-circle .progress-percentage {
        font-size: 0.75rem;
    }
    
    .goal-row-expand {
        width: 28px;
        height: 28px;
    }
    
    .goal-details-content {
        padding: 1rem;
    }
    
    .goal-details-content h4 {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    .goal-description p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .goal-progress-detailed {
        margin: 1rem 0;
    }
    
    .goal-metadata {
        margin: 1rem 0;
    }
    
    .metadata-row {
        padding: 0.4rem 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .metadata-label {
        font-size: 0.8rem;
        font-weight: 600;
        color: #667eea;
    }
    
    .metadata-value {
        font-size: 0.85rem;
    }
    
    .goal-actions {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 0.75rem;
    }
    
    .goal-actions .btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
        justify-content: center;
    }
    
    /* Individual Goal Cards in Modal */
    .goals-list .goal-card {
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid rgba(102, 126, 234, 0.1);
        border-radius: 12px;
        padding: 1.25rem;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        width: 100%;
        box-sizing: border-box;
    }
    
    .goals-list .goal-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    }
    
    .goals-list .goal-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    }
    
    .goal-header {
        margin-bottom: 1rem;
    }
    
    .goal-title {
        font-size: 1.1rem;
        font-weight: 700;
        color: #1a202c;
        margin-bottom: 0.5rem;
        line-height: 1.3;
        word-wrap: break-word;
    }
    
    .goal-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .goal-category-badge {
        background: rgba(102, 126, 234, 0.1);
        color: #667eea;
        padding: 0.3rem 0.75rem;
        border-radius: 15px;
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .goal-priority {
        padding: 0.3rem 0.6rem;
        border-radius: 12px;
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .goal-priority.high {
        background: rgba(239, 68, 68, 0.1);
        color: #dc2626;
    }
    
    .goal-priority.medium {
        background: rgba(245, 158, 11, 0.1);
        color: #d97706;
    }
    
    .goal-priority.low {
        background: rgba(34, 197, 94, 0.1);
        color: #059669;
    }
    
    .goal-progress {
        margin: 1rem 0;
    }
    
    .progress-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
    }
    
    .progress-label {
        font-size: 0.8rem;
        color: #64748b;
        font-weight: 500;
    }
    
    .progress-percentage {
        font-size: 1rem;
        font-weight: 700;
        color: #667eea;
    }
    
    .progress-bar {
        height: 8px;
        background: rgba(102, 126, 234, 0.1);
        border-radius: 8px;
        overflow: hidden;
        position: relative;
    }
    
    .progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
        border-radius: 8px;
        transition: width 0.4s ease;
    }
    
    /* Templates Grid */
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Form Enhancements */
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .form-input, .form-select {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        border: 1px solid rgba(102, 126, 234, 0.2);
        background: rgba(255, 255, 255, 0.9);
        font-size: 16px;
        transition: all 0.3s ease;
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }
    
    .form-input:focus, .form-select:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
        background: rgba(255, 255, 255, 1);
        outline: none;
    }
    
    /* Empty State */
    .empty-state {
        text-align: center;
        padding: 2rem 1rem;
        color: #64748b;
    }
    
    .empty-state i {
        color: rgba(102, 126, 234, 0.3);
        margin-bottom: 1rem;
    }
    
    .empty-state h3 {
        font-size: 1.3rem;
        font-weight: 700;
        color: #1a202c;
        margin-bottom: 0.75rem;
    }
    
    .empty-state p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }
    
    .empty-state .btn {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        padding: 0.75rem 1.5rem;
        border-radius: 12px;
        font-weight: 600;
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25);
        transition: all 0.3s ease;
        font-size: 0.9rem;
    }
    
    .empty-state .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
    }
}
    
    .goal-card-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .goal-actions {
        align-self: flex-end;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .goals-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* ===== FRIENDS TAB ENHANCEMENTS ===== */

/* Enhanced friend action buttons for mobile */
.friend-actions .btn .btn-text {
    margin-left: 0.5rem;
    font-weight: 500;
}

/* Mobile-specific friend button styling */
@media (max-width: 768px) {
    .friend-actions {
        gap: 0.25rem;
        justify-content: space-between;
        margin-top: 1rem;
    }
    
    .friend-actions .btn {
        flex: 1;
        padding: 0.75rem 0.5rem !important;
        font-size: 0.75rem !important;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
    }
    
    .friend-actions .btn i {
        margin-right: 0.25rem;
        font-size: 0.9rem;
    }
    
    .friend-actions .btn .btn-text {
        margin-left: 0.25rem;
        font-weight: 600;
    }
    
    /* Enhanced activity indicator for mobile */
    .friend-avatar .status-indicator {
        width: 20px !important;
        height: 20px !important;
        border: 3px solid white !important;
        box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
    }
    
    .status-indicator.online {
        animation: pulse 2s infinite;
    }
    
    /* Make friend status more prominent */
    .friend-status {
        font-weight: 600 !important;
        font-size: 0.85rem !important;
        margin-top: 0.25rem;
    }
    
    .friend-status.online {
        color: #10b981 !important;
    }
    
    .friend-status.away,
    .friend-status.recently_active,
    .friend-status.today {
        color: #f59e0b !important;
    }
    
    .friend-status.offline,
    .friend-status.yesterday {
        color: #6b7280 !important;
    }
}

/* ===== DASHBOARD STATS FIX ===== */

/* Ensure dashboard stats have proper contrast */
.stat-item .stat-value,
.stat-value {
    color: #1a202c !important;
    font-weight: 700;
}

.stat-item .stat-label,
.stat-label {
    color: #64748b !important;
    font-weight: 500;
}

/* Mobile dashboard stats */
@media (max-width: 768px) {
    .stat-item .stat-value,
    .stat-value {
        color: #1a202c !important;
        font-weight: 700;
    }
    
    .stat-item .stat-label,
    .stat-label {
        color: #64748b !important;
        font-weight: 500;
    }
}

/* ===== NEW GOALS MODAL STYLES ===== */

/* Goals Modal Base Styles */
.goals-modal .modal-content {
    max-width: 900px;
    width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.goals-modal .modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.goals-modal .modal-header h2 {
    margin: 0;
    color: #1a202c;
    font-size: 1.5rem;
}

.goals-modal .close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    background: none;
    border: none;
    padding: 0.75rem;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.goals-modal .close:hover {
    background: rgba(108, 117, 125, 0.1);
    color: #495057;
}

.goals-modal .close:active {
    background: rgba(108, 117, 125, 0.2);
    transform: scale(0.95);
}

/* Goals Tabs */
.goals-modal .goals-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    padding: 0 1.5rem;
}

.goals-modal .goals-tabs .tab-btn {
    padding: 1rem 1.5rem !important;
    border: none !important;
    background: transparent !important;
    color: #6c757d !important;
    cursor: pointer;
    border-bottom: 3px solid transparent !important;
    transition: all 0.3s ease;
    font-weight: 500 !important;
    border-radius: 0 !important;
}

.goals-modal .goals-tabs .tab-btn:hover {
    color: #667eea !important;
    background: rgba(102, 126, 234, 0.05) !important;
    border-bottom-color: transparent !important;
}

.goals-modal .goals-tabs .tab-btn.active {
    color: #667eea !important;
    background: rgba(102, 126, 234, 0.1) !important;
    border-bottom-color: #667eea !important;
    font-weight: 600 !important;
}

/* Modal Body */
.goals-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #f8f9fa;
}

/* Tab Content */
.goals-modal .tab-content {
    display: none;
    padding: 1.5rem;
}

.goals-modal .tab-content.active {
    display: block;
}

/* Goals Summary */
.goals-modal .goals-summary {
    background: white !important;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.goals-modal .goal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.goals-modal .stat-item {
    text-align: center;
    background: transparent !important;
    padding: 0.5rem !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.goals-modal .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #4338ca !important; /* Darker blue for better contrast */
    margin-bottom: 0.25rem;
}

.goals-modal .stat-label {
    color: #6c757d !important;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Goals Content */
.goals-content {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .goals-modal .modal-content {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .goals-modal .modal-header {
        padding: 1rem;
        flex-shrink: 0;
    }
    
    .goals-modal .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .goals-modal .close {
        min-width: 48px !important;
        min-height: 48px !important;
        padding: 1rem !important;
        display: flex !important;
        font-size: 1.75rem;
    }
    
    .goals-modal .goals-tabs {
        padding: 0 1rem;
    }
    
    .goals-modal .goals-tabs .tab-btn {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    .goals-modal .tab-content {
        padding: 1rem;
    }
    
    .goals-modal .goals-summary {
        padding: 1rem;
        margin-bottom: 1rem;
        background: white !important;
    }
    
    .goals-modal .goal-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .goals-modal .stat-item {
        background: transparent !important;
        padding: 0.5rem !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    
    .goals-modal .stat-number {
        font-size: 1.5rem;
        color: #4338ca !important; /* Darker blue for better contrast */
    }
    
    .goals-modal .stat-label {
        color: #6c757d !important;
    }
    
    .goals-content {
        padding: 1rem;
    }
}

/* CRITICAL LEADERBOARD TEXT FIX - Must be at end of file for highest priority */
/* Fix purple/gray text on purple background in leaderboard */
.leaderboard-item .user-info .user-stats .stat-item .stat-value,
.leaderboard-item .user-stats .stat-item .stat-value,
.leaderboard-item .stat-item .stat-value,
div.leaderboard-item div.user-info div.user-stats div.stat-item div.stat-value,
body .leaderboard-item .user-info .user-stats .stat-item .stat-value,
html .leaderboard-item .user-info .user-stats .stat-item .stat-value {
    color: #ffffff !important; /* Force white text for contrast against purple */
    font-weight: 700 !important;
    text-shadow: none !important;
    background: transparent !important;
    -webkit-text-fill-color: #ffffff !important;
}

.leaderboard-item .user-info .user-stats .stat-item .stat-label,
.leaderboard-item .user-stats .stat-item .stat-label,
.leaderboard-item .stat-item .stat-label,
div.leaderboard-item div.user-info div.user-stats div.stat-item div.stat-label,
body .leaderboard-item .user-info .user-stats .stat-item .stat-label,
html .leaderboard-item .user-info .user-stats .stat-item .stat-label {
    color: #e2e8f0 !important; /* Force light gray text for labels */
    font-weight: 500 !important;
    text-shadow: none !important;
    background: transparent !important;
    -webkit-text-fill-color: #e2e8f0 !important;
}

/* Dark mode specific overrides */
@media (prefers-color-scheme: dark) {
    .leaderboard-item .user-info .user-stats .stat-item .stat-value,
    .leaderboard-item .user-stats .stat-item .stat-value,
    .leaderboard-item .stat-item .stat-value,
    div.leaderboard-item div.user-info div.user-stats div.stat-item div.stat-value,
    body .leaderboard-item .user-info .user-stats .stat-item .stat-value,
    html .leaderboard-item .user-info .user-stats .stat-item .stat-value {
        color: #ffffff !important; /* Keep white text in dark mode */
        font-weight: 700 !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    .leaderboard-item .user-info .user-stats .stat-item .stat-label,
    .leaderboard-item .user-stats .stat-item .stat-label,
    .leaderboard-item .stat-item .stat-label,
    div.leaderboard-item div.user-info div.user-stats div.stat-item div.stat-label,
    body .leaderboard-item .user-info .user-stats .stat-item .stat-label,
    html .leaderboard-item .user-info .user-stats .stat-item .stat-label {
        color: #e2e8f0 !important; /* Keep light gray text in dark mode */
        font-weight: 500 !important;
        -webkit-text-fill-color: #e2e8f0 !important;
    }
}

/* Enhanced Cardio Input Styling */
.set-input.cardio-duration,
.set-input.cardio-distance {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(16, 185, 129, 0.05));
    border: 1.5px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.set-input.cardio-duration:focus,
.set-input.cardio-distance:focus {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
}

.unit-label.cardio-units {
    background: linear-gradient(135deg, #3b82f6, #10b981);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

.conversion-helper {
    display: block;
    margin-top: 4px;
    color: #10b981;
    font-size: 0.7rem;
    font-weight: 500;
    font-style: italic;
}

/* Cardio Set Row Enhancements */
.set-row:has(.cardio-duration, .cardio-distance) {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.02), rgba(16, 185, 129, 0.02));
    border-left: 3px solid #10b981;
}

/* Mobile Cardio Optimizations */
@media (max-width: 768px) {
    .set-input.cardio-duration,
    .set-input.cardio-distance {
        min-width: 0;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    .unit-label.cardio-units {
        padding: 2px 4px;
        font-size: 0.7rem;
    }
    
    .conversion-helper {
        font-size: 0.65rem;
        margin-top: 2px;
    }
    
    /* Hide unit labels outside input boxes on mobile workout page */
    #workout .unit-label,
    #workout .unit-label.cardio-units,
    .workout-container .unit-label,
    .workout-container .unit-label.cardio-units,
    .sets-container .unit-label,
    .sets-container .unit-label.cardio-units,
    .set-row .unit-label,
    .set-row .unit-label.cardio-units {
        display: none !important;
    }
    
    /* Keep conversion helper visible as it provides useful pace info */
    .conversion-helper {
        display: block !important;
    }
}

/* Auto-save notification styles */
.auto-save-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10000;
    font-size: 14px;
    opacity: 0;
    animation: slideInOut 2s ease-in-out;
}

.auto-save-notification.recovery {
    background: #FF9800;
    animation: none;
    opacity: 1;
}

.auto-save-notification.error {
    background: #f44336;
    animation: none;
    opacity: 1;
    border-left: 4px solid #d32f2f;
}

@keyframes slideInOut {
    0% { opacity: 0; transform: translateX(100%); }
    15% { opacity: 1; transform: translateX(0); }
    85% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(100%); }
}

/* Mobile responsiveness for notifications */
@media (max-width: 768px) {
    .auto-save-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
}

/* Session recovery modal */
.session-recovery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.session-recovery-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.session-recovery-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.session-recovery-buttons .btn {
    flex: 1;
    max-width: 150px;
}

/* Personal Best Consistency Score styling */
.stat-item.consistency-bonus {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    border-radius: 8px;
    animation: pulse-green 2s infinite;
}

.stat-item.pr-bonus {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
    border-radius: 8px;
    animation: pulse-gold 2s infinite;
}

.stat-item.consistency-bonus .stat-value,
.stat-item.pr-bonus .stat-value {
    color: white !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.stat-item.consistency-bonus .stat-label,
.stat-item.pr-bonus .stat-label {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

/* Score breakdown info styling */
.score-breakdown {
    display: grid;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.score-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.score-item strong {
    color: #60a5fa;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.score-item ul {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
    list-style-type: disc;
}

.score-item li {
    margin: 0.25rem 0;
    color: var(--text-primary) !important;
}

/* Mobile responsiveness for new scoring elements */
@media (max-width: 768px) {
    .user-stats {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-item {
        min-width: 80px;
    }
    
    .stat-item.consistency-bonus,
    .stat-item.pr-bonus {
        min-width: 100px;
    }
    
    .score-breakdown {
        gap: 1rem;
    }
    
    .score-item {
        padding: 1rem;
    }
}

/* Muscle Progress System */
.progress-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.progress-tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}

.progress-tab-btn:hover {
    color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.progress-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.progress-tab-content {
    display: none;
}

.progress-tab-content.active {
    display: block;
}

.muscle-view-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.muscle-view-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    border-radius: 20px;
    transition: all 0.3s ease;
    min-height: 44px;
    min-width: 60px;
}

.muscle-view-btn:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-color-light);
}

.muscle-view-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.legend-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.legend-toggle-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    transition: all 0.3s ease;
    margin-bottom: 5px;
    min-height: 44px;
    min-width: 44px;
}

.legend-toggle-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--primary-color-light);
}

.legend-toggle-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.muscle-progress-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 15px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.2);
}

/* Legend Color Classes */
.legend-color.muscle-improvement-excellent {
    background-color: #00b300;
}

.legend-color.muscle-improvement-good {
    background-color: #66cc00;
}

.legend-color.muscle-improvement-average {
    background-color: #ffcc00;
}

.legend-color.muscle-improvement-declining {
    background-color: #ff6600;
}

.legend-color.muscle-improvement-poor {
    background-color: #cc0000;
}

.legend-color.muscle-no-data {
    background-color: #cccccc;
}

.muscle-diagram-container {
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow: visible;
}

#muscleDiagramWrapper {
    max-width: 100%;
    padding: 0;
    margin: 0;
}

#muscleDiagramWrapper svg {
    width: 100%;
    max-width: 1600px;
    height: auto;
    min-height: 1000px;
}

.muscle-details-panel {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin: 0;
}

.muscle-details-panel h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.muscle-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.muscle-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
}

.muscle-exercises h5 {
    margin: 15px 0 10px 0;
    color: var(--text-primary);
    font-size: 14px;
}

.muscle-exercises ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.muscle-exercises li {
    padding: 8px 12px;
    margin-bottom: 5px;
    background-color: var(--bg-primary);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exercise-progress {
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
}

.exercise-progress.positive {
    background-color: var(--success-color);
    color: white;
}

.exercise-progress.negative {
    background-color: var(--error-color);
    color: white;
}

/* Full-Width Progress Section */
.progress-section-full {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    color: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.progress-section-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.progress-section-full::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.progress-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-title i {
    font-size: 24px;
    opacity: 0.9;
}

.progress-title h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.progress-main-stat {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.progress-main-stat .progress-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.progress-subtitle {
    font-size: 14px;
    opacity: 0.8;
    font-weight: 500;
}

.progress-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr) 2fr;
    gap: 20px;
    align-items: center;
}

.progress-stat {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-stat .stat-number {
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
}

.progress-stat .stat-label {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 500;
}

.progress-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.progress-cta i:first-child {
    font-size: 16px;
}

.progress-cta i:last-child {
    font-size: 12px;
    opacity: 0.7;
}

/* Mobile Responsive */
@media (max-width: 768px) {  
    .progress-section-full {
        background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
        color: white !important;
        padding: 20px !important;
        margin-bottom: 20px !important;
        border-radius: 16px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    .progress-section-full * {
        color: white !important;
    }
    
    .progress-section-full::before {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        width: 80px !important;
        height: 80px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 50% !important;
        transform: translate(20px, -20px) !important;
    }
    
    .progress-header {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 16px;
    }
    
    .progress-title h2 {
        font-size: 20px;
        color: white !important;
    }
    
    .progress-main-stat {
        align-items: flex-start;
        text-align: left;
    }
    
    .progress-main-stat .progress-value {
        font-size: 28px;
        color: white !important;
    }
    
    .progress-subtitle {
        color: rgba(255, 255, 255, 0.8) !important;
    }
    
    .progress-details {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .progress-cta {
        grid-column: 1 / -1;
        margin-top: 8px;
        padding: 14px 16px;
        font-size: 13px;
    }
    
    .progress-stat .stat-number {
        font-size: 18px;
        color: white !important;
    }
    
    .progress-stat .stat-label {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.8) !important;
    }
    
    .progress-cta {
        background: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        backdrop-filter: blur(10px) !important;
        border-radius: 10px !important;
    }
    
    .progress-cta i {
        color: white !important;
    }
}

/* Mobile Optimization for Muscle Diagrams */
@media (max-width: 768px) {
    .progress-tabs {
        margin-bottom: 15px;
    }
    
    .progress-tab-btn {
        padding: 10px 15px;
        font-size: 13px;
        min-height: 44px;
    }
    
    .muscle-view-selector {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .muscle-view-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 44px;
        min-width: 55px;
    }
    
    .legend-toggle-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .muscle-progress-legend {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }
    
    .legend-item {
        font-size: 11px;
        justify-content: center;
    }
    
    .legend-container {
        margin-bottom: 5px;
    }
    
    .muscle-diagram-container {
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        overflow: hidden;
        max-height: 80vh;
    }
    
    #muscleDiagramWrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        padding: 0;
        margin: 0;
        overflow: hidden;
        max-height: 80vh;
    }
    
    #muscleDiagramWrapper svg {
        width: 100vw;
        max-width: none;
        height: 80vh;
        max-height: 80vh;
        padding: 0;
        margin: 0;
        display: block;
        transform: scale(1.1);
        transform-origin: center;
        touch-action: pan-y;
    }
    
    /* Ensure muscle click targets are large enough for mobile */
    #muscleDiagramWrapper svg .muscle-group {
        min-width: 44px;
        min-height: 44px;
    }
    
    .muscle-details-panel {
        padding: 15px;
        margin: 0;
    }
    
    .muscle-stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .muscle-stat {
        align-items: center;
        text-align: center;
    }
    
    .muscle-exercises li {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .exercise-progress {
        align-self: flex-end;
    }
}

/* ===============================================
   MESSAGING SYSTEM STYLES
   =============================================== */

.messages-container {
    display: flex;
    height: 600px;
    background: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.conversations-sidebar {
    width: 300px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--background);
}

.conversations-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-background);
}

.conversations-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.conversations-title h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.conversations-count {
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 1.5rem;
    text-align: center;
}

.btn-new-chat {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-new-chat:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.conversations-search {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.search-input-container {
    position: relative;
}

.search-input-container i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-input-container input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.conversation-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.conversation-item:hover {
    background: rgba(79, 70, 229, 0.05);
}

.conversation-item.active {
    background: rgba(79, 70, 229, 0.1);
    border-left: 3px solid var(--primary-color);
}

.conversation-avatar {
    position: relative;
    width: 3rem;
    height: 3rem;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    border: 2px solid var(--background);
}

.status-indicator.online {
    background: #10b981;
}

.status-indicator.offline {
    background: #6b7280;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.conversation-name span:first-child {
    font-weight: 600;
    color: var(--text-primary);
    truncate;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.conversation-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-preview {
    color: var(--text-secondary);
    font-size: 0.85rem;
    truncate;
    flex: 1;
}

.conversation-unread {
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 1rem;
    text-align: center;
}

.empty-conversations {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    height: 100%;
}

.empty-conversations i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--background);
}

.chat-welcome {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-secondary);
}

.welcome-content {
    padding: 2rem;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.welcome-content h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.chat-area {
    display: none;
    flex-direction: column;
    height: 100%;
}

.chat-area.active {
    display: flex;
}

.chat-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-background);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}

.chat-avatar {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.chat-user-details h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.chat-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.chat-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-chat-action {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.btn-chat-action:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chat-messages {
    flex: 1;
    overflow-y: visible;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--background) 0%, rgba(248, 250, 252, 0.3) 100%);
    height: auto;
    max-height: none;
    min-height: 200px;
}

.message {
    display: flex;
    margin-bottom: 1.5rem;
    animation: messageSlideIn 0.3s ease;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.message.sent .message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-content {
    background: white;
    border: 1px solid var(--border-color);
    color: #333333;
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
}

.message.received .message-content p {
    color: #333333;
}

.message.sent .message-content p {
    color: white;
}

.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    opacity: 0.8;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
}

.message-status {
    margin-left: 0.5rem;
}

.message-status.read {
    color: #10b981;
}

.message-status.sent {
    color: var(--text-secondary);
}

.chat-input-container {
    padding: 1rem;
    background: var(--card-background);
    border-top: 1px solid var(--border-color);
}

.chat-input {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: none;
    outline: none;
}

.chat-input input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.btn-send {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.btn-send:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.btn-send:active {
    transform: scale(0.95);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive messaging */
@media (max-width: 768px) {
    .messages-container {
        height: calc(100vh - 200px);
    }
    
    .conversations-sidebar {
        width: 100%;
    }
    
    .conversations-sidebar.hidden {
        display: none;
    }
    
    .chat-area {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--background);
        z-index: 1000;
    }
    
    .chat-messages {
        padding: 1rem;
        overflow-y: visible;
        height: auto;
        min-height: 200px;
    }
    
    .message-content {
        max-width: 85%;
        font-size: 0.9rem;
    }
    
    .back-btn {
        display: flex;
    }
    
    .chat-input input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.8rem 1rem;
    }
    
    .btn-send {
        min-width: 44px;
        min-height: 44px;
    }
}