/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Form section */
.form-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.form-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

#sessionForm {
    display: grid;
    gap: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
button {
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    margin-top: 1rem;
}

/* Loading section */
.loading-section {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error section */
.error-section {
    background: #fff5f5;
    border: 2px solid #fed7d7;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    color: #c53030;
}

.error-section button {
    background: #c53030;
    margin-top: 1rem;
}

/* Results section */
.results-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.results-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

/* Session overview */
.session-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
}

.overview-item {
    text-align: center;
    padding: 1rem;
}

.overview-item strong {
    display: block;
    color: #667eea;
    margin-bottom: 0.5rem;
}

/* Intensity allocation */
.intensity-allocation {
    margin-bottom: 2rem;
}

.intensity-allocation h3 {
    margin-bottom: 1rem;
    color: #333;
}

#intensityChart {
    display: grid;
    gap: 0.5rem;
}

.intensity-bar {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.intensity-bar-label {
    min-width: 100px;
    font-weight: 600;
}

.intensity-bar-fill {
    flex: 1;
    height: 20px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    margin: 0 1rem;
    position: relative;
}

.intensity-bar-value {
    font-weight: 600;
    color: #667eea;
}

/* Training blocks */
.training-blocks h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

#blocksContainer {
    display: grid;
    gap: 1.5rem;
}

.training-block {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.training-block:hover {
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
}

.block-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.block-name {
    font-size: 1.2rem;
    font-weight: 600;
}

.block-duration {
    font-size: 0.9rem;
    opacity: 0.9;
}

.block-exercises {
    padding: 1.5rem;
}

.exercise {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #667eea;
}

.exercise:last-child {
    margin-bottom: 0;
}

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

.exercise-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.exercise-skill {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.exercise-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.exercise-detail {
    text-align: center;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
}

.exercise-detail-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.exercise-detail-value {
    font-weight: 600;
    color: #333;
}

.exercise-videos {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.video-link {
    flex: 1;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    transition: background 0.3s ease;
}

.video-link:hover {
    background: #5a67d8;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    color: white;
    opacity: 0.8;
}

/* API Documentation Styles */
.api-docs-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.api-docs-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 1.5rem 2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.api-docs-header:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
}

.api-docs-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.api-docs-content {
    padding: 2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.api-docs-content.expanded {
    max-height: none;
    overflow: visible;
}

.api-overview {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #4f46e5;
}

.base-url {
    margin-top: 1rem;
    font-family: 'Courier New', monospace;
}

.base-url code {
    background: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* API Endpoints */
.api-endpoints {
    margin-bottom: 2rem;
}

.endpoint {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.endpoint-header {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.method {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.method.get {
    background: #10b981;
    color: white;
}

.method.post {
    background: #3b82f6;
    color: white;
}

.path {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #374151;
}

.endpoint-description {
    padding: 1.5rem;
}

/* Parameters Table */
.parameters {
    margin: 1.5rem 0;
}

.params-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.params-table th,
.params-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.params-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.params-table code {
    background: #e2e8f0;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* Code Examples */
.code-example {
    margin: 1.5rem 0;
}

.code-example h4 {
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 1rem;
}

.code-example pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.code-example code {
    background: none;
    color: inherit;
    padding: 0;
}

/* Integration Examples */
.integration-examples {
    margin-bottom: 2rem;
}

.integration-examples h3 {
    margin-bottom: 1.5rem;
    color: #374151;
}

.example-section {
    margin-bottom: 2rem;
}

.example-section h4 {
    margin-bottom: 0.75rem;
    color: #4f46e5;
    font-size: 1.1rem;
}

/* Error Responses */
.error-responses {
    margin-bottom: 2rem;
}

.error-responses h3 {
    margin-bottom: 1.5rem;
    color: #374151;
}

.error-example {
    margin-bottom: 1.5rem;
}

.error-example h4 {
    margin-bottom: 0.5rem;
    color: #dc2626;
    font-size: 1rem;
}

/* API Notes */
.api-notes {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fef3c7;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
}

.api-notes h3 {
    margin-bottom: 1rem;
    color: #92400e;
}

.api-notes ul {
    margin-left: 1.5rem;
}

.api-notes li {
    margin-bottom: 0.5rem;
    color: #92400e;
}

.api-notes strong {
    color: #78350f;
}

/* API Footer */
.api-footer {
    text-align: center;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border-top: 1px solid #e2e8f0;
}

.api-footer a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
}

.api-footer a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-section,
    .results-section {
        padding: 1.5rem;
    }
    
    .session-overview {
        grid-template-columns: 1fr;
    }
    
    .exercise-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .exercise-videos {
        flex-direction: column;
    }

    /* API Documentation Mobile Styles */
    .api-docs-header {
        padding: 1rem 1.5rem;
    }

    .api-docs-header h2 {
        font-size: 1.3rem;
    }

    .api-docs-content {
        padding: 1.5rem;
    }

    .api-overview {
        padding: 1rem;
    }

    .endpoint-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .endpoint-description {
        padding: 1rem;
    }

    .params-table {
        font-size: 0.8rem;
    }

    .params-table th,
    .params-table td {
        padding: 0.5rem;
    }

    .code-example pre {
        font-size: 0.75rem;
        padding: 0.75rem;
    }

    .api-notes {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .form-section,
    .results-section {
        padding: 1rem;
    }
    
    .exercise-details {
        grid-template-columns: 1fr;
    }

    /* API Documentation Small Mobile Styles */
    .api-docs-header {
        padding: 0.75rem 1rem;
    }

    .api-docs-header h2 {
        font-size: 1.1rem;
    }

    .api-docs-content {
        padding: 1rem;
    }

    .api-overview {
        padding: 0.75rem;
    }

    .endpoint-header {
        padding: 0.5rem 0.75rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .endpoint-description {
        padding: 0.75rem;
    }

    .params-table {
        font-size: 0.7rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .code-example pre {
        font-size: 0.7rem;
        padding: 0.5rem;
        overflow-x: auto;
    }

    .integration-examples h3,
    .error-responses h3,
    .api-notes h3 {
        font-size: 1.1rem;
    }

    .example-section h4 {
        font-size: 1rem;
    }

    .api-notes {
        padding: 0.75rem;
    }

    .api-footer {
        padding: 1rem;
        font-size: 0.9rem;
    }
} 