/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #e9ecef;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Dark mode styles */
body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .theme-toggle {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .welcome-screen {
    background: #1a1a1a;
}

body.dark-mode .welcome-header h1 {
    color: #e0e0e0;
}

body.dark-mode .welcome-header p {
    color: #b0b0b0;
}

body.dark-mode .option-card {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .option-card.secondary,
body.dark-mode .option-card.tertiary {
    background: #2d2d2d;
}

body.dark-mode .wizard-screen {
    background: #1a1a1a;
}

body.dark-mode .wizard-header {
    border-color: #444;
}

body.dark-mode .wizard-header h2 {
    color: #e0e0e0;
}

body.dark-mode .back-button {
    background: #555;
    color: #e0e0e0;
}

body.dark-mode .back-button:hover {
    background: #666;
}

body.dark-mode .wizard-actions {
    border-color: #444;
}

body.dark-mode .workout-item {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .workout-item h4 {
    color: #e0e0e0;
}

body.dark-mode .workout-item .workout-details {
    color: #b0b0b0;
}

body.dark-mode .workout-item:hover {
    border-color: #007bff;
    background: #1a2332;
}

body.dark-mode .workout-item.selected {
    background: #1a2332;
}

body.dark-mode .import-method {
    background: #2d2d2d;
    border-color: #444;
}

body.dark-mode .import-method h3 {
    color: #e0e0e0;
}

body.dark-mode .import-method p {
    color: #b0b0b0;
}

body.dark-mode .import-divider span {
    background: #1a1a1a;
    color: #b0b0b0;
}

body.dark-mode .import-divider::before {
    background: #444;
}

body.dark-mode #jsonPasteArea {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .workout-name-section {
    background: #2d2d2d;
    border-color: #444;
}

body.dark-mode .workout-name-input {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .segment-builder {
    background: #2d2d2d;
    border-color: #444;
}

body.dark-mode .segment-builder h3 {
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode .input-group label {
    color: #e0e0e0;
}

body.dark-mode .input-group input,
body.dark-mode .input-group select {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .mode-section {
    background: #333;
}

body.dark-mode .segments-container {
    background: #333;
}

body.dark-mode .segment-item {
    background: #2d2d2d;
    border-color: #444;
}

body.dark-mode .connection-info {
    background: #333;
}

body.dark-mode .connection-info h4 {
    color: #e0e0e0;
}

body.dark-mode .connection-info li {
    color: #b0b0b0;
}

body.dark-mode .connection-status-section h3 {
    color: #e0e0e0;
}

body.dark-mode .connection-status-section p {
    color: #b0b0b0;
}

/* Welcome Screen Styles */
.welcome-screen {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.welcome-header h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 10px;
}

.welcome-header p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 40px;
}

.welcome-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.option-card {
    background: white;
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.option-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.option-card.primary {
    border-color: #007bff;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.option-card.secondary {
    border-color: #28a745;
}

.option-card.tertiary {
    border-color: #6c757d;
}

.option-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.option-card h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: inherit;
}

.option-card p {
    color: inherit;
    opacity: 0.8;
    margin-bottom: 20px;
}

.option-button {
    background: transparent;
    border: 2px solid currentColor;
    color: inherit;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-button:hover {
    background: currentColor;
    color: white;
}

.option-card.primary .option-button:hover {
    background: white;
    color: #007bff;
}

/* Wizard Screen Styles */
.wizard-screen {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.wizard-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.back-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 20px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.back-button:hover {
    background: #5a6268;
}

.wizard-header h2 {
    margin: 0;
    color: #333;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.action-button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-button.primary {
    background: #007bff;
    color: white;
}

.action-button.primary:hover:not(:disabled) {
    background: #0056b3;
}

.action-button.secondary {
    background: #6c757d;
    color: white;
}

.action-button.secondary:hover:not(:disabled) {
    background: #5a6268;
}

.action-button.danger {
    background: #dc3545;
    color: white;
}

.action-button.danger:hover:not(:disabled) {
    background: #c82333;
}

/* Load Workout Screen */
.workout-list {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.workout-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.workout-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.workout-item.selected {
    border-color: #007bff;
    background: #f8f9ff;
}

.workout-item h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.workout-item .workout-details {
    color: #666;
    font-size: 0.9rem;
}

.no-workouts {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px;
}

/* Import Workout Screen */
.import-options {
    display: grid;
    gap: 30px;
}

.import-method {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 30px;
}

.import-method h3 {
    margin-top: 0;
    color: #333;
}

.import-method p {
    color: #666;
    margin-bottom: 20px;
}

.import-divider {
    text-align: center;
    position: relative;
    margin: 20px 0;
}

.import-divider span {
    background: #f8f9fa;
    padding: 0 20px;
    color: #666;
    font-weight: 600;
}

.import-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
    z-index: -1;
}

#jsonPasteArea {
    width: 100%;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 15px;
}

#jsonPasteArea:focus {
    outline: none;
    border-color: #007bff;
}

/* Workout Builder Screen */
.workout-builder-content {
    display: grid;
    gap: 30px;
}

.workout-name-section {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}

.workout-name-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
}

.workout-name-input:focus {
    outline: none;
    border-color: #007bff;
}

.segment-builder {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 30px;
}

.segment-builder h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 15px;
}

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

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #007bff;
}

.radio-group,
.checkbox-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.speed-limits-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
}

.speed-input {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.mode-section {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
    margin-top: 15px;
}

.segments-container {
    min-height: 100px;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
}

.no-segments {
    text-align: center;
    color: #666;
    font-style: italic;
}

.segment-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.segment-details {
    flex: 1;
}

.remove-segment {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.remove-segment:hover {
    background: #c82333;
}

/* Connection Screen */
.connection-content {
    text-align: center;
    padding: 40px 20px;
}

.connection-status-section {
    margin-bottom: 40px;
}

.connection-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.connection-status-section h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.connection-status-section p {
    color: #666;
    font-size: 1.1rem;
}

.connect-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.connect-button:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-2px);
}

.connect-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button-icon {
    font-size: 1.3rem;
}

.connection-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    text-align: left;
}

.connection-info h4 {
    margin-top: 0;
    color: #333;
}

.connection-info ul {
    margin: 0;
    padding-left: 20px;
}

.connection-info li {
    margin-bottom: 8px;
    color: #666;
}

/* Connected state */
.connected .connection-icon {
    color: #28a745;
}

.connected #connectionStatusText {
    color: #28a745;
}

.connected .connect-button {
    background: #28a745;
}

.connected .connect-button:hover {
    background: #1e7e34;
}

/* Responsive Design */
@media (max-width: 768px) {
    .welcome-options {
        grid-template-columns: 1fr;
    }
    
    .wizard-screen {
        padding: 15px;
    }
    
    .wizard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .wizard-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .action-button {
        width: 100%;
    }
    
    .radio-group,
    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .speed-limits-inputs {
        grid-template-columns: 1fr;
    }
    
    .speed-input {
        grid-template-columns: 1fr;
    }
}
