/* workflow-replay.css */

/* Dataset Sections */
.replay-dataset-section {
    margin-bottom: 20px;
}

.replay-dataset-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1E90FF;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.replay-dataset-header svg {
    stroke: #1E90FF;
}

/* Dataset Cards */
.replay-dataset-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    position: relative;
    padding-bottom: 40px; /* Make room for button at bottom */
}

.replay-dataset-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.replay-dataset-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.replay-dataset-info span {
    font-size: 11px;
    color: var(--text-secondary);
}

.replay-dataset-source {
    color: #1E90FF !important;
}

/* Upload Button */
.replay-dataset-upload {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-tertiary);
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.2s;
}

.replay-dataset-upload:not(:disabled) {
    cursor: pointer;
    opacity: 0.8;
}

.replay-dataset-upload:not(:disabled):hover {
    background: rgba(30, 144, 255, 0.1);
    border-color: #1E90FF;
    color: #1E90FF;
    opacity: 1;
    transform: scale(1.05);
}

/* Empty State */
.replay-dataset-empty {
    text-align: center;
    padding: 16px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-style: italic;
}

/* Execute Footer */
.replay-execute-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
}

.replay-execute-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 500;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    opacity: 0.5;
}

.replay-execute-btn:not(:disabled) {
    cursor: pointer;
    opacity: 1;
}

.replay-execute-btn:not(:disabled):hover {
    background: rgba(30, 144, 255, 0.1);
    border-color: #1E90FF;
    color: #1E90FF;
}

.replay-execute-btn svg {
    stroke: currentColor;
}

/* Light Theme */
body.light-theme .replay-dataset-header {
    color: #0064FF;
}

body.light-theme .replay-dataset-header svg {
    stroke: #0064FF;
}

body.light-theme .replay-dataset-source {
    color: #0064FF !important;
}

body.light-theme .replay-dataset-upload:not(:disabled):hover {
    background: rgba(0, 100, 255, 0.1);
    border-color: #0064FF;
    color: #0064FF;
}

body.light-theme .replay-execute-btn:not(:disabled):hover {
    background: rgba(0, 100, 255, 0.1);
    border-color: #0064FF;
    color: #0064FF;
}

/* Date picker container */
.replay-date-picker-container {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.replay-date-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.replay-date-row label {
    width: 40px;
    font-size: 12px;
    color: var(--text-secondary);
}

.replay-date-input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 12px;
}

.replay-date-input::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
    cursor: pointer;
}

.replay-upload-btn {
    width: 100%;
    padding: 6px 12px;
    margin-top: 8px;
    background: transparent;
    border: 1px solid #1E90FF;
    border-radius: 6px;
    color: #1E90FF;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.replay-upload-btn:hover:not(:disabled) {
    background: rgba(30, 144, 255, 0.1);
}

.replay-upload-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loaded state */
.replay-dataset-upload.loaded {
    background: rgba(30, 144, 255, 0.1);
    border-color: #1E90FF;
}

.dataset-loaded .replay-dataset-info {
    opacity: 0.8;
}

/* Loading spinner */
.replay-loading-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--text-tertiary);
    border-top-color: #1E90FF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Execute button ready state */
.replay-execute-btn.ready {
    background: rgba(30, 144, 255, 0.1);
    border-color: #1E90FF;
    color: #1E90FF;
    opacity: 1;
}

.replay-execute-btn.ready:hover {
    background: rgba(30, 144, 255, 0.2);
}

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

/* SweatStack notice */
.replay-dataset-notice {
    color: #ff8c00 !important;
    font-style: italic;
    font-size: 11px;
    display: block;
    margin-top: 4px;
}

/* Disabled SweatStack button */
.replay-dataset-card[data-source="SweatStack"] .replay-dataset-upload {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Message area */
.replay-message-area {
    display: none;
    padding: 8px 12px;
    margin: 0 0 12px 0;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    word-wrap: break-word;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.replay-message-area.info {
    border-color: #1E90FF;
    background: rgba(30, 144, 255, 0.1);
    color: #1E90FF;
}

.replay-message-area.success {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.replay-message-area.error {
    border-color: var(--error-color);
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
}

.replay-message-area.loading {
    border-color: #ff8c00;
    background: rgba(255, 140, 0, 0.1);
    color: #ff8c00;
}

/* Light theme adjustments */
body.light-theme .replay-message-area.info {
    border-color: #0064FF;
    background: rgba(0, 100, 255, 0.1);
    color: #0064FF;
}

body.light-theme .replay-message-area.success {
    color: #2E7D32;
    background: rgba(46, 125, 50, 0.1);
}

.replay-date-info {
    font-size: 11px;
    margin: 4px 0;
    text-align: center;
}

/* Button press feedback */
.replay-upload-btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.replay-execute-btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.replay-dataset-upload:active:not(:disabled) {
    transform: scale(0.95);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Add subtle transition for smooth feedback */
.replay-upload-btn,
.replay-execute-btn,
.replay-dataset-upload {
    transition: all 0.1s ease;
}

/* Optional: Add focus styles for keyboard navigation */
.replay-upload-btn:focus:not(:disabled),
.replay-execute-btn:focus:not(:disabled),
.replay-dataset-upload:focus:not(:disabled) {
    outline: 2px solid #1E90FF;
    outline-offset: 2px;
}

/* Light theme focus adjustments */
body.light-theme .replay-upload-btn:focus:not(:disabled),
body.light-theme .replay-execute-btn:focus:not(:disabled),
body.light-theme .replay-dataset-upload:focus:not(:disabled) {
    outline-color: #0064FF;
}

/* Loading state for active button */
.replay-dataset-upload.loading-active {
    background: rgba(30, 144, 255, 0.05);
    border-color: #1E90FF;
}

/* Replay Card Specific Styles */
.replay-card {
    border-color: rgba(30, 144, 255, 0.3);
}

.replay-card:hover {
    border-color: #1E90FF;
    box-shadow: 0 8px 24px rgba(30, 144, 255, 0.15);
}

.replay-card-header {
    justify-content: space-between;
    border-bottom-color: rgba(30, 144, 255, 0.2);
}

.replay-card-delete {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: all 0.2s;
}

.replay-card-delete:hover {
    color: var(--error-color);
    opacity: 1;
    transform: scale(1.1);
}

.replay-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.replay-card-info span {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.replay-card-thread,
.replay-card-chain {
    color: #1E90FF !important;
    font-weight: 500;
}

.replay-card-preview {
    height: 140px;
    background: var(--bg-primary);
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Light theme adjustments */
body.light-theme .replay-card {
    border-color: rgba(0, 100, 255, 0.3);
}

body.light-theme .replay-card:hover {
    border-color: #0064FF;
    box-shadow: 0 8px 24px rgba(0, 100, 255, 0.15);
}

body.light-theme .replay-card-header {
    border-bottom-color: rgba(0, 100, 255, 0.2);
}

body.light-theme .replay-card-thread,
body.light-theme .replay-card-chain {
    color: #0064FF !important;
}

/* Endura race picker styles for replay */
.replay-race-picker-container {
    padding: 10px;
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
}

.replay-race-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.replay-race-row label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.replay-race-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}

.replay-race-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.replay-race-info {
    font-size: 12px;
    margin-bottom: 10px;
    min-height: 16px;
}