Files
gravl/frontend/src/pages/WorkoutEditPage.css
T
clawd 83ccd6c601 feat(05-03): Exercise research frontend integration
- Add ExerciseResearchPanel component with Get Research button, loading state, summary display, and source links
- Add ExerciseEncyclopediaPage with exercise list and integrated research panel
- Wire encyclopedia view into App.jsx navigation
- Add encyclopedia nav button to Dashboard
- Add CSS for research panel and encyclopedia search

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 19:20:40 +01:00

653 lines
10 KiB
CSS

.edit-page {
display: flex;
flex-direction: column;
height: 100vh;
background: #f5f5f5;
}
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
background: white;
border-bottom: 1px solid #ddd;
gap: 1rem;
}
.page-header h1 {
flex: 1;
text-align: center;
font-size: 1.25rem;
margin: 0;
color: #333;
}
.back-btn,
.save-header-btn {
padding: 0.5rem 1rem;
border: none;
border-radius: 0.25rem;
cursor: pointer;
font-size: 0.9rem;
display: flex;
align-items: center;
gap: 0.5rem;
min-height: 44px;
min-width: 44px;
}
.back-btn {
background: #f0f0f0;
color: #333;
}
.back-btn:hover:not(:disabled) {
background: #e0e0e0;
}
.back-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.save-header-group {
display: flex;
align-items: center;
gap: 0.5rem;
}
.sync-status {
padding: 0.5rem 0.75rem;
border-radius: 0.25rem;
font-size: 0.85rem;
display: flex;
align-items: center;
gap: 0.4rem;
white-space: nowrap;
}
.sync-status.saved {
background: #d4edda;
color: #155724;
}
.sync-status.error {
background: #f8d7da;
color: #721c24;
}
.save-header-btn {
background: #007bff;
color: white;
padding: 0.5rem 1.25rem;
}
.save-header-btn:hover:not(:disabled) {
background: #0056b3;
}
.save-header-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Draft Recovery Prompt */
.draft-prompt-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.draft-prompt-modal {
background: white;
border-radius: 0.5rem;
padding: 2rem;
max-width: 400px;
width: 90%;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.draft-prompt-modal h2 {
margin-top: 0;
margin-bottom: 0.5rem;
color: #333;
font-size: 1.25rem;
}
.draft-prompt-modal p {
color: #666;
margin-bottom: 1.5rem;
line-height: 1.5;
}
.draft-prompt-actions {
display: flex;
gap: 1rem;
justify-content: flex-end;
}
.btn {
padding: 0.75rem 1.5rem;
border: none;
border-radius: 0.25rem;
cursor: pointer;
font-size: 0.95rem;
font-weight: 500;
min-height: 44px;
transition: all 0.2s;
}
.btn-primary {
background: #007bff;
color: white;
}
.btn-primary:hover {
background: #0056b3;
}
.btn-secondary {
background: #e9ecef;
color: #333;
}
.btn-secondary:hover {
background: #dee2e6;
}
/* Error Banner */
.error-banner {
background: #f8d7da;
border-bottom: 1px solid #f5c6cb;
padding: 1rem;
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
color: #721c24;
animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
from {
transform: translateY(-100%);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.error-message {
display: flex;
align-items: center;
gap: 0.75rem;
flex: 1;
}
.error-actions {
display: flex;
align-items: center;
gap: 0.5rem;
}
.btn-retry {
padding: 0.5rem 1rem;
background: #721c24;
color: white;
border: none;
border-radius: 0.25rem;
cursor: pointer;
font-size: 0.85rem;
min-height: 40px;
transition: background 0.2s;
}
.btn-retry:hover {
background: #5a1520;
}
.btn-close {
background: transparent;
border: none;
color: #721c24;
font-size: 1.5rem;
cursor: pointer;
padding: 0;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
}
.btn-close:hover {
opacity: 0.7;
}
/* Main Content */
.edit-main {
flex: 1;
overflow-y: auto;
padding: 1rem;
display: flex;
flex-direction: column;
gap: 1rem;
}
.workout-meta-card {
background: white;
padding: 1rem;
border-radius: 0.5rem;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.workout-meta-card h2 {
margin: 0 0 0.5rem 0;
font-size: 1.25rem;
color: #333;
}
.workout-meta-card p {
margin: 0;
color: #666;
font-size: 0.9rem;
}
.edit-exercises-list {
display: flex;
flex-direction: column;
gap: 1rem;
flex: 1;
}
.edit-exercise-card {
background: white;
border-radius: 0.5rem;
padding: 1rem;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.edit-card-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 1rem;
gap: 1rem;
}
.edit-card-info h3 {
margin: 0 0 0.5rem 0;
color: #333;
font-size: 1.05rem;
}
.muscle-group {
display: inline-block;
background: #f0f0f0;
padding: 0.25rem 0.5rem;
border-radius: 0.25rem;
font-size: 0.8rem;
color: #666;
}
.edit-card-actions {
display: flex;
gap: 0.5rem;
}
.icon-btn {
padding: 0.5rem;
border: none;
background: #f0f0f0;
color: #333;
cursor: pointer;
border-radius: 0.25rem;
display: flex;
align-items: center;
justify-content: center;
min-height: 40px;
min-width: 40px;
transition: all 0.2s;
}
.icon-btn:hover:not(:disabled) {
background: #e0e0e0;
}
.icon-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.icon-btn.delete {
color: #dc3545;
}
.icon-btn.delete:hover:not(:disabled) {
background: #ffe0e0;
}
.edit-card-settings {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
gap: 1rem;
}
.setting-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.setting-group label {
font-size: 0.85rem;
color: #666;
font-weight: 500;
}
.setting-group input {
padding: 0.5rem;
border: 1px solid #ddd;
border-radius: 0.25rem;
font-size: 1rem;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
min-height: 40px;
}
.setting-group input:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}
.setting-group input:disabled {
background: #f5f5f5;
color: #999;
cursor: not-allowed;
}
.add-exercise-btn {
padding: 1rem;
background: #28a745;
color: white;
border: none;
border-radius: 0.5rem;
cursor: pointer;
font-size: 1rem;
font-weight: 500;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
min-height: 50px;
transition: background 0.2s;
align-self: center;
max-width: 300px;
width: 100%;
}
.add-exercise-btn:hover:not(:disabled) {
background: #218838;
}
.add-exercise-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Mobile/Tablet Adjustments */
@media (max-width: 600px) {
.page-header {
padding: 0.75rem;
}
.page-header h1 {
font-size: 1rem;
}
.back-btn,
.save-header-btn {
padding: 0.5rem 0.75rem;
font-size: 0.85rem;
}
.edit-main {
padding: 0.75rem;
}
.edit-card-settings {
grid-template-columns: 1fr;
}
.draft-prompt-modal {
padding: 1.5rem;
max-width: 90%;
}
}
/* Spinner Animation for Save Loading */
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
/* Apply spinner animation to Icon component with spinner class */
.save-header-btn svg[class*="spinner"],
.save-header-btn .icon-spinner {
animation: spin 1s linear infinite;
}
/* Success Checkmark Animation */
@keyframes slideInCheckmark {
0% {
opacity: 0;
transform: scale(0.8);
}
100% {
opacity: 1;
transform: scale(1);
}
}
.sync-status.saved {
animation: slideInCheckmark 0.3s ease-out;
}
/* Ensure error actions align properly on mobile */
@media (max-width: 480px) {
.error-banner {
flex-direction: column;
align-items: flex-start;
}
.error-message {
width: 100%;
margin-bottom: 0.75rem;
}
.error-actions {
width: 100%;
justify-content: space-between;
}
}
/* Encyclopedia search input */
.encyclopedia-search {
width: 100%;
padding: 0.625rem 0.75rem;
border: 1px solid #ddd;
border-radius: 0.25rem;
font-size: 1rem;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
min-height: 44px;
box-sizing: border-box;
}
.encyclopedia-search:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}
/* Selected exercise highlight */
.edit-exercise-card.exercise-selected {
border: 2px solid #007bff;
}
/* Expanded exercise detail */
.exercise-detail-expanded {
border-top: 1px solid #eee;
padding-top: 1rem;
margin-top: 0.5rem;
display: flex;
flex-direction: column;
gap: 1rem;
}
.exercise-instructions h4 {
margin: 0 0 0.5rem;
font-size: 0.9rem;
color: #555;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.exercise-instructions p {
margin: 0;
font-size: 0.9rem;
color: #444;
line-height: 1.6;
}
/* Research panel */
.research-panel {
background: #f8f9fa;
border-radius: 0.375rem;
padding: 1rem;
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.research-panel-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.research-panel-title {
margin: 0;
font-size: 0.9rem;
color: #555;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.research-btn {
padding: 0.4rem 0.9rem;
font-size: 0.875rem;
min-height: 36px;
}
.research-loading {
display: flex;
align-items: center;
gap: 0.75rem;
color: #666;
font-size: 0.9rem;
padding: 0.5rem 0;
}
.research-spinner {
width: 18px;
height: 18px;
border: 2px solid #ddd;
border-top-color: #007bff;
border-radius: 50%;
animation: spin 0.8s linear infinite;
flex-shrink: 0;
}
.research-error {
display: flex;
align-items: center;
justify-content: space-between;
background: #f8d7da;
color: #721c24;
padding: 0.5rem 0.75rem;
border-radius: 0.25rem;
font-size: 0.875rem;
}
.research-results {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.research-summary h4,
.research-sources h4 {
margin: 0 0 0.5rem;
font-size: 0.85rem;
color: #555;
font-weight: 600;
}
.research-summary p {
margin: 0;
font-size: 0.9rem;
color: #333;
line-height: 1.6;
}
.research-sources-list {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 0.625rem;
}
.research-source-item {
background: white;
border: 1px solid #e0e0e0;
border-radius: 0.25rem;
padding: 0.625rem 0.75rem;
}
.research-source-link {
color: #007bff;
font-size: 0.9rem;
font-weight: 500;
text-decoration: none;
display: block;
margin-bottom: 0.25rem;
word-break: break-word;
}
.research-source-link:hover {
text-decoration: underline;
}
.research-source-snippet {
margin: 0;
font-size: 0.825rem;
color: #555;
line-height: 1.5;
}