body {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f5f5f5;
}

.container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #333;
    margin-bottom: 20px;
}

.upload-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 2px dashed #ddd;
}

input[type="file"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

#chartContainer {
    position: relative;
    height: 400px;
    margin-top: 20px;
}

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

.stat-box {
    padding: 15px;
    background: #f0f7ff;
    border-radius: 4px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #2196F3;
    margin-top: 5px;
}

.error {
    color: #d32f2f;
    padding: 10px;
    background: #ffebee;
    border-radius: 4px;
    margin-top: 10px;
}

/* Form styling */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-control {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 120px;
}

.form-control[type="file"] {
    width: auto;
    padding: 10px;
    background: white;
}

.unit-label {
    color: #666;
    font-size: 14px;
    margin-left: 8px;
}

/* TSS Configuration Panel */
.config-panel {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.config-panel h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.config-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin: 0 5px;
}

.config-btn:hover {
    background: #1976d2;
}

.config-btn.secondary {
    background: #666;
}

.config-btn.secondary:hover {
    background: #555;
}

.config-item {
    display: grid;
    grid-template-columns: 1fr 80px 150px 80px 60px;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    background: white;
}

.config-item label {
    font-weight: normal;
    margin: 0;
}

.config-item input {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.config-item input[type="color"] {
    width: 40px;
    height: 30px;
    padding: 0;
    border: none;
    cursor: pointer;
}

.config-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.remove-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.remove-btn:hover {
    background: #d32f2f;
}

/* Workout Editor Styles */
.workout-info {
    background: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.workout-info .form-group {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
}

.segment-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
}

.segment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.segment-type {
    font-weight: bold;
    color: #333;
    text-transform: capitalize;
}

.segment-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    align-items: end;
}

.segment-controls .form-group {
    margin: 0;
}

.segment-controls label {
    font-size: 12px;
    font-weight: normal;
    margin-bottom: 5px;
}

.segment-controls input {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
}

.interval-segment {
    border-left: 4px solid #ff9800;
}

.warmup-segment {
    border-left: 4px solid #4caf50;
}

.cooldown-segment {
    border-left: 4px solid #2196f3;
}

.rest-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
}

.rest-controls h5 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
}

/* Sub-segment styles */
.sub-segments-container {
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.sub-segments-container h5 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 14px;
    font-weight: bold;
}

.sub-segment-item {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    border-left: 3px solid #9c27b0;
}

.sub-segment-item:last-child {
    margin-bottom: 0;
}