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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    text-align: center;
    padding: 30px 20px;
}

.app-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.app-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Controls */
.controls {
    padding: 30px;
    background-color: #f8f9fa;
    text-align: center;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 1.1rem;
}

#muscle-group {
    width: 100%;
    max-width: 350px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#muscle-group:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

#generate-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

#generate-btn:active {
    transform: translateY(0);
}

/* Workout Container */
.workout-container {
    padding: 30px;
    max-height: 700px;
    overflow-y: auto;
}

.workout-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
}

.workout-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.workout-description {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.workout-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Exercise Cards */
.exercise {
    background-color: #fff;
    margin-bottom: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    overflow: hidden;
}

.exercise:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.exercise-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0 20px;
}

.exercise-order {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.exercise-info {
    flex-grow: 1;
    margin-left: 15px;
}

.exercise-name {
    color: #333;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.exercise-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.difficulty, .equipment {
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 15px;
    background-color: #f8f9fa;
    color: #666;
}

.difficulty-iniciante {
    background-color: #d4edda;
    color: #155724;
}

.difficulty-intermediário {
    background-color: #fff3cd;
    color: #856404;
}

.difficulty-avançado {
    background-color: #f8d7da;
    color: #721c24;
}

.info-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.info-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0, 123, 255, 0.3);
}

/* Exercise Visual */
.exercise-visual {
    padding: 20px;
    text-align: center;
}

.exercise-image {
    max-width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Exercise Details */
.exercise-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    padding: 20px;
    background-color: #f8f9fa;
}

.detail-item {
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.detail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.detail-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
    color: #4CAF50;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

#modal-body {
    padding: 30px;
}

.exercise-detail-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.exercise-detail-header h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 15px;
}

.exercise-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.equipment-badge {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* Exercise Media */
.exercise-media {
    text-align: center;
    margin-bottom: 25px;
}

.detail-image {
    max-width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.detail-video {
    max-width: 100%;
    height: 250px;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.video-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* Muscle Targets */
.muscle-targets {
    margin-bottom: 25px;
}

.muscle-targets h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
}

.muscle-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.muscle-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Instructions */
.exercise-instructions {
    margin-bottom: 25px;
}

.exercise-instructions h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
}

.exercise-instructions ol {
    padding-left: 20px;
}

.exercise-instructions li {
    margin-bottom: 8px;
    font-size: 1rem;
    line-height: 1.6;
}

/* Tips */
.exercise-tips {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.exercise-tips h3 {
    font-size: 1.3rem;
    color: #2d3436;
    margin-bottom: 10px;
}

.exercise-tips p {
    font-size: 1rem;
    color: #2d3436;
    line-height: 1.6;
}

/* Workout Summary */
.workout-summary {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-top: 30px;
}

.workout-summary h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.summary-item {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.summary-value {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
}

.equipment-list {
    margin-bottom: 25px;
}

.equipment-list h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.equipment-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.equipment-tag {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
}

.workout-tips {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
}

.workout-tips h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.workout-tips ul {
    padding-left: 20px;
}

.workout-tips li {
    margin-bottom: 5px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Footer */
.app-footer {
    background-color: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.app-footer p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.api-status {
    font-size: 0.85rem;
    opacity: 0.8;
}

#api-status-text {
    color: #4CAF50;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .app-header h1 {
        font-size: 2rem;
    }
    
    .controls {
        padding: 20px;
    }
    
    .workout-container {
        padding: 20px;
        max-height: 600px;
    }
    
    .exercise-details {
        grid-template-columns: 1fr;
    }
    
    .exercise-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .exercise-info {
        margin-left: 0;
    }
    
    .workout-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    #modal-body {
        padding: 20px;
    }
    
    .exercise-detail-header h2 {
        font-size: 1.5rem;
    }
    
    .detail-image, .detail-video {
        height: 200px;
    }
    
    .exercise-badges {
        justify-content: flex-start;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .exercise-image {
        height: 150px;
    }
    
    .detail-image, .detail-video {
        height: 150px;
    }
    
    .exercise-name {
        font-size: 1.2rem;
    }
    
    .exercise-meta {
        flex-direction: column;
        gap: 5px;
    }
}

/* Scrollbar Styling */
.workout-container::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.workout-container::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.workout-container::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 10px;
}

.workout-container::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
