/* ============================================= */
/* SafetyTraining - Training Component Styles   */
/* Content Slides, Training Editor, Quiz        */
/* ============================================= */

/* ==================== */
/* Content Slide Base   */
/* ==================== */
.content-slide {
    width: 100%;
    min-height: 300px;
    max-width: 1100px;
    margin: 0 auto;
}

.slide-title {
    font-size: 2rem;
    margin: 0 0 1rem;
    color: var(--text-primary);
}

.slide-subtitle {
    font-size: 1.5rem;
    margin: 0 0 1.5rem;
    color: var(--text-secondary);
}

.slide-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

.slide-bullets,
.slide-numbered {
    font-size: 1.1rem;
    line-height: 2;
    padding-left: 1.5rem;
}

.slide-image img {
    max-width: 100%;
    border-radius: var(--radius-lg);
}

.slide-video video {
    max-width: 100%;
    border-radius: var(--radius-lg);
}

/* ==================== */
/* Title Slide Template */
/* ==================== */
.template-title .title-slide-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.template-title .title-image {
    width: 100%;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
}

.template-title .title-image img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: var(--radius-lg);
}

.template-title .title-text {
    padding: 1rem;
}

.template-title .slide-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.template-title .slide-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--gray-500);
}

/* ==================== */
/* Two Column Templates */
/* ==================== */
.template-text-left-image-right .two-column-layout,
.template-image-left-text-right .two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.two-column-layout .column {
    min-height: 200px;
}

.two-column-layout .text-column {
    display: flex;
    align-items: center;
}

.two-column-layout .text-column .slide-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--gray-700);
}

.two-column-layout .image-column {
    display: flex;
    align-items: center;
    justify-content: center;
}

.two-column-layout .image-column img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ==================== */
/* Video Template       */
/* ==================== */
.template-video .video-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.template-video .video-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.template-video .video-container video {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.template-video .video-description {
    text-align: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    max-width: 800px;
    margin: 0 auto;
}

.template-video .video-description p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-600);
    margin: 0;
}

/* ==================== */
/* Bullet List Template */
/* ==================== */
.template-bullet-list .bullet-list-layout {
    padding: 1rem;
}

.template-bullet-list .bullet-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
}

.template-bullet-list .bullet-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.template-bullet-list .bullet-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--gray-700);
}

.template-bullet-list .bullet-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
}

/* ==================== */
/* Default Template     */
/* ==================== */
.template-default {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.template-default .slide-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--gray-700);
}

.template-default .slide-image img {
    max-width: 100%;
    border-radius: var(--radius-lg);
}

.template-default .slide-video video {
    max-width: 100%;
    border-radius: var(--radius-lg);
}

/* ==================== */
/* Training Editor      */
/* ==================== */
.training-editor {
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.training-title h1 {
    margin: 0;
    font-size: 1.5rem;
}

.version-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.editor-content {
    flex: 1;
    overflow: hidden;
}

/* ==================== */
/* Slides Sidebar       */
/* ==================== */
.slides-sidebar {
    width: 280px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.slides-sidebar .sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slides-sidebar .sidebar-header h3 {
    margin: 0;
    font-size: 1rem;
}

.slides-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.slide-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.slide-item:hover {
    background: var(--gray-200);
}

.slide-item.selected {
    background: #f0fdfa;
    border: 2px solid var(--primary-color);
}

.slide-number {
    width: 28px;
    height: 28px;
    background: var(--gray-500);
    color: var(--white);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
}

.slide-item.selected .slide-number {
    background: var(--primary-color);
}

.slide-info {
    flex: 1;
}

.slide-type {
    font-size: 0.85rem;
}

.quiz-badge {
    display: inline-block;
    background: var(--accent-color);
    color: var(--black);
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.5rem;
}

.slide-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.slide-item:hover .slide-actions {
    opacity: 1;
}

/* ==================== */
/* Add Slide Options    */
/* ==================== */
.add-slide-options {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.add-slide-options p {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.template-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.template-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition-normal);
}

.template-btn:hover {
    background: var(--gray-200);
    border-color: var(--gray-400);
}

.template-btn.quiz {
    background: #fffbeb;
    border-color: var(--accent-color);
}

/* ==================== */
/* Slide Editor Main    */
/* ==================== */
.slide-editor-main {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: var(--bg-secondary);
}

.slide-editor-panel {
    background: var(--bg-surface);
    border-radius: var(--radius-md);

    box-shadow: var(--shadow);
}

.slide-editor-panel h3 {
    margin: 0 0 1rem;
}

.slide-editor-panel h4 {
    margin: 1rem 0 0.5rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.slide-editor-panel hr {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* ==================== */
/* Content Editor       */
/* ==================== */
.content-editor {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.content-item {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.add-content {
    display: flex;
    gap: 0.5rem;
}

/* ==================== */
/* Quiz Editor          */
/* ==================== */
.quiz-editor {
    background: #fffbeb;
    border-radius: var(--radius);
    padding: 1rem;
}

.question-editor .form-group {
    margin-bottom: 1rem;
}

.answer-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.answer-item input[type='checkbox'] {
    width: 20px;
    height: 20px;
}

.answer-item .form-control {
    flex: 1;
}

/* ==================== */
/* No Slide Selected    */
/* ==================== */
.no-slide-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}

.no-slide-selected .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-slide-selected h3 {
    margin: 0 0 0.5rem;
}

/* ==================== */
/* Responsive           */
/* ==================== */
@media (max-width: 768px) {
    .template-text-left-image-right .two-column-layout,
    .template-image-left-text-right .two-column-layout {
        grid-template-columns: 1fr;
    }

    .template-title .slide-title {
        font-size: 1.5rem;
    }

    .template-title .slide-subtitle {
        font-size: 1rem;
    }

    .slides-sidebar {
        width: 200px;
    }

    .training-editor {
        height: calc(100vh - 80px);
    }
}
