/**
 * Training System Styles
 * Independent training system styling
 */

/* ========================================
   TRAINING CONTAINER
   ======================================== */
.training-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ========================================
   TRAINING PROGRESS BAR
   ======================================== */
.training-progress-bar {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-primary);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-bar-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-percentage {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
}

/* ========================================
   TRAINING COMPLETION
   ======================================== */
.training-complete-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.training-complete-message p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

#close-training-btn {
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#close-training-btn:hover {
    background: var(--primary-hover);
}

/* ========================================
   WARNING MESSAGE
   ======================================== */
.warning-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-icon {
    font-size: 16px;
}

.warning-text {
    color: #856404;
    font-weight: 500;
}

/* ========================================
   TRAINING IN HELP SECTION
   ======================================== */
.help-section .training-form {
    margin: 20px 0;
}

.help-section .training-history-controls {
    margin: 15px 0;
    text-align: right;
}

.help-section .training-history {
    margin-top: 15px;
}

/* Make training section more integrated within help */
#training-system.help-section {
    display: none;
}

#training-system.help-section.active {
    display: block;
}

/* VERY SPECIFIC OVERRIDE - This should definitely work */
div#training-system.help-section .help-section-content {
    background: #f9f9f9 !important;
    padding: 20px !important;
    margin: 0 !important;
}

/* Override any large header styling for training section */
#training-system .help-section-content h2 {
    font-size: 1.2em !important;
    margin-bottom: 15px !important;
    border-bottom: 1px solid var(--border-primary) !important;
    padding-bottom: 5px !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

/* More specific override for training section header */
.help-content #training-system .help-section-content h2 {
    font-size: 1.2em !important;
    margin-bottom: 15px !important;
    border-bottom: 1px solid var(--border-primary) !important;
    padding-bottom: 5px !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

#training-system .help-section-content {
    padding: 15px;
}

#training-system .help-subsection {
    margin-bottom: 25px;
}

/* Ensure training section follows help section styling */
#training-system {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#training-system .help-section-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
}

/* ========================================
   TRAINING FORM
   ======================================== */
.training-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.training-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.training-form label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.training-form .form-control {
    padding: 12px 16px;
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.training-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.duration-info {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.form-help {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ========================================
   PARTICIPANT SELECTION
   ======================================== */
.participant-selection-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 16px;
    background: var(--bg-secondary);
}

.participant-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    min-height: 24px;
}

.participant-option:hover {
    background: var(--bg-hover);
}

.participant-option input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    flex-shrink: 0;
    margin-top: auto;
    margin-bottom: auto;
}

.participant-info {
    cursor: pointer;
    flex: 1;
    display: flex;
    align-items: center;
    line-height: 1.2;
}

.participant-info strong {
    font-size: 14px;
    color: var(--text-primary);
}

/* Select All Option */
.select-all-option {
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: 8px;
    padding-bottom: 8px !important;
}

.select-all-option .participant-info strong {
    color: var(--text-primary);
    font-weight: normal;
}

.no-numbers {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
}

/* ========================================
   TRAINING PROGRESS
   ======================================== */
.training-progress {
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.1);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.progress-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 18px;
}

.progress-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.progress-bar-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-primary);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 6px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.training-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========================================
   TRAINING HISTORY
   ======================================== */
.training-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    transition: background-color 0.2s ease;
}

.history-item:hover {
    background: var(--bg-hover);
}

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

.history-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.history-details {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-stats {
    display: flex;
    gap: 16px;
    align-items: center;
}

.history-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.history-stat-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.history-stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.history-status.completed {
    background: var(--success-bg);
    color: var(--success-color);
}

.history-status.cancelled {
    background: var(--warning-bg);
    color: var(--warning-color);
}

.history-status.active {
    background: var(--primary-bg);
    color: var(--primary-color);
}

/* ========================================
   LOADING STATES
   ======================================== */
.loading-text {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .training-container {
        padding: 16px;
    }
    
    .progress-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .training-stats {
        grid-template-columns: 1fr;
    }
    
    .history-item {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .history-stats {
        justify-content: space-around;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
.training-progress {
    animation: slideIn 0.3s ease-out;
}

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

.participant-option {
    transition: all 0.2s ease;
}

.participant-option:active {
    transform: scale(0.98);
}
