/**
 * Course Library Styles
 * Grid layout, course cards, search, and modals
 */

/* ============================================================================
   LIBRARY SEARCH & FILTERS
   ============================================================================ */

.library-search {
    margin-bottom: var(--spacing-xl);
}

.library-search__input {
    width: 100%;
    max-width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}

.library-search__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.library-filters-row {
    display: flex;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.library-filter--action {
    background: var(--color-primary);
    color: white;
    margin-left: auto;
}

.library-filter--action:hover {
    background: var(--color-primary-dark, #1e40af);
    border-color: var(--color-primary-dark, #1e40af);
    color: white;
}

.library-filters {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.library-filters__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-secondary, #64748b);
    margin-right: var(--spacing-xs);
}

.library-filter {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.library-filter:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-primary);
}

.library-filter.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ============================================================================
   COURSES GRID
   ============================================================================ */

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

/* ============================================================================
   COURSE CARD
   ============================================================================ */

.course-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--color-primary);
}

.course-card__header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.course-card__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.course-card__date {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.course-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.course-card__stat {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.course-card__badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.course-card__badge--scorm {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.course-card__actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: auto;
}

.course-card__button {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.course-card__button--primary {
    background: var(--color-primary);
    color: white;
}

.course-card__button--primary:hover {
    background: var(--color-primary-hover);
}

.course-card__button--secondary {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.course-card__button--secondary:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-primary);
}

.course-card__button--tertiary {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.course-card__button--tertiary:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.course-card__button--danger {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.course-card__button--danger:hover {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.5);
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.library-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.pagination-button {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-button:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* ============================================================================
   LOADING & EMPTY STATES
   ============================================================================ */

.library-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) * 2;
}

.library-loading__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--spacing-lg);
}

.library-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) * 2;
    text-align: center;
}

.library-empty__icon {
    font-size: 4rem;
    opacity: 0.5;
    margin-bottom: var(--spacing-lg);
}

.library-empty__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

.library-empty__message {
    font-size: 1rem;
    color: var(--color-text-secondary);
}

.library-error {
    text-align: center;
    padding: var(--spacing-xl) * 2;
}

.library-error__icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

/* ============================================================================
   DETAILS MODAL
   ============================================================================ */

.library-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.library-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.library-modal__content {
    position: relative;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
    animation: slideUp 0.3s ease;
    z-index: 1;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.library-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--color-border);
}

.library-modal__header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

.library-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.library-modal__close:hover {
    background: var(--color-danger);
    color: white;
}

.library-modal__body {
    padding: var(--spacing-xl);
}

.library-detail {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-border);
}

.library-detail:last-child {
    border-bottom: none;
}

.library-detail label {
    font-weight: 600;
    color: var(--color-text-secondary);
}

.library-detail span {
    color: var(--color-text);
}

.library-modal__actions {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

/* ============================================================================
   TRAINING CARDS
   ============================================================================ */

.training-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.training-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.training-card__header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.training-card__icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.training-card__info {
    flex: 1;
}

.training-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 var(--spacing-xs);
    color: white;
}

.training-card__meta {
    font-size: 0.75rem;
    opacity: 0.9;
}

.training-card__badge {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.training-card__badge--complete {
    background: rgba(34, 197, 94, 0.3);
}

.training-card__badge--generating {
    background: rgba(251, 191, 36, 0.3);
}

.training-card__badge--pending {
    background: rgba(59, 130, 246, 0.3);
}

.training-card__progress {
    margin-bottom: var(--spacing-md);
}

.training-card__progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--spacing-xs);
}

.training-card__progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    transition: width 0.3s;
}

.training-card__progress-text {
    font-size: 0.875rem;
    opacity: 0.9;
}

.training-card__actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.training-card .course-card__button {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    border: none;
}

.training-card .course-card__button:hover {
    background: white;
    transform: translateY(-1px);
}

.training-card .course-card__button--secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.training-card .course-card__button--secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

.training-card .course-card__button--danger {
    background: rgba(220, 38, 38, 0.2);
    color: white;
    border: 1px solid rgba(220, 38, 38, 0.4);
}

.training-card .course-card__button--danger:hover {
    background: rgba(220, 38, 38, 0.4);
    border-color: rgba(220, 38, 38, 0.6);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .courses-grid {
        grid-template-columns: 1fr;
    }

    .library-search__input {
        max-width: none;
    }

    .library-filters {
        flex-wrap: wrap;
    }

    .library-modal__content {
        width: 95%;
    }

    .library-modal__actions {
        flex-direction: column;
    }

    .library-modal__actions button {
        width: 100%;
    }
}

/* ============================================================================
   Markdown Editor Modal
   ============================================================================ */

.markdown-editor-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.markdown-editor-modal.active {
    display: block;
}

.markdown-editor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.markdown-editor-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    height: 90%;
    max-width: 1800px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.markdown-editor-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.markdown-editor-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.markdown-editor-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.markdown-editor-close:hover {
    background: #f0f0f0;
    color: #333;
}

.markdown-editor-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.markdown-editor-sidebar {
    width: 30%;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-header h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #333;
}

.sidebar-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
}

.sidebar-search:focus {
    outline: none;
    border-color: #4A90E2;
}

.sidebar-categories {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.guide-category {
    margin-bottom: 8px;
}

.guide-category-header {
    padding: 10px 12px;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.guide-category-header:hover {
    background: #e8e8e8;
}

.guide-toggle {
    font-size: 12px;
    transition: transform 0.2s;
}

.guide-category.collapsed .guide-toggle {
    transform: rotate(-90deg);
}

.guide-category.collapsed .guide-category-blocks {
    display: none;
}

.guide-category-blocks {
    padding: 4px 0;
}

/* Removed - duplicate definition, see line 863 for correct version */

.markdown-editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.monaco-container {
    flex: 1;
    overflow: hidden;
}

.editor-stats {
    padding: 8px 16px;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #666;
}

.editor-stats span {
    font-weight: 500;
}

.markdown-editor-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f9f9f9;
}

.markdown-editor-footer .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.markdown-editor-footer .btn-primary {
    background: #4A90E2;
    color: white;
}

.markdown-editor-footer .btn-primary:hover {
    background: #357ABD;
}

.markdown-editor-footer .btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.markdown-editor-footer .btn-secondary:hover {
    background: #d0d0d0;
}

.loading-message {
    padding: 10px 20px;
    background: #FFF3CD;
    color: #856404;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

/* Block item expanded structure */
.guide-block-item {
    padding: 8px 12px;
    margin: 2px 0;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.guide-block-item:hover {
    background: #f9f9f9;
}

.guide-block-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

.guide-block-info {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.guide-block-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.guide-block-info strong {
    display: block;
    font-size: 13px;
    color: #333;
    margin-bottom: 2px;
}

.guide-block-info p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.guide-block-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
}

.guide-block-expand {
    padding: 4px 8px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    height: 28px;
    min-width: 32px;
}

.guide-block-expand:hover {
    background: #e0e0e0;
}

.guide-block-add {
    padding: 4px 10px;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    height: 28px;
}

.guide-block-add:hover {
    background: #357ABD;
}

.expand-icon {
    display: inline-block;
    transition: transform 0.2s;
}

.guide-block-example {
    margin-top: 8px;
    padding: 8px;
    background: #f9f9f9;
    border-left: 3px solid #4A90E2;
    border-radius: 4px;
    font-size: 12px;
}

.guide-block-example pre {
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.4;
}

.guide-block-example code {
    color: #333;
}

/* Editor toolbar */
.editor-toolbar {
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    background: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-mode-toggle {
    display: flex;
    gap: 2px;
    background: #e0e0e0;
    border-radius: 4px;
    padding: 2px;
}

.mode-toggle-btn {
    padding: 6px 16px;
    background: transparent;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
}

.mode-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mode-toggle-btn.active {
    background: white;
    color: #333;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Preview container */
.preview-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: white;
    min-height: 400px;
}

.markdown-preview-content {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.markdown-preview-content h1 {
    font-size: 28px;
    margin: 24px 0 16px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
}

.markdown-preview-content h2 {
    font-size: 24px;
    margin: 20px 0 12px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 6px;
}

.markdown-preview-content h3 {
    font-size: 20px;
    margin: 16px 0 10px;
}

.markdown-preview-content h4 {
    font-size: 16px;
    margin: 14px 0 8px;
}

.markdown-preview-content p {
    margin: 12px 0;
}

.markdown-preview-content strong {
    font-weight: 600;
    color: #000;
}

.markdown-preview-content em {
    font-style: italic;
}

.markdown-preview-content blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 4px solid #4A90E2;
    background: #f5f5f5;
    color: #666;
}

.markdown-preview-content ul,
.markdown-preview-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.markdown-preview-content li {
    margin: 4px 0;
}

.markdown-preview-content a {
    color: #4A90E2;
    text-decoration: none;
}

.markdown-preview-content a:hover {
    text-decoration: underline;
}

.markdown-preview-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 90%;
}

.markdown-preview-content pre {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 12px 0;
}

.markdown-preview-content pre code {
    background: none;
    padding: 0;
}

.markdown-preview-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.markdown-preview-content th,
.markdown-preview-content td {
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    text-align: left;
}

.markdown-preview-content th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.markdown-preview-content tr:nth-child(even) {
    background: #fafafa;
}

.markdown-preview-content tr:hover {
    background: #f0f0f0;
}

/* Out of sync warning */
.course-card__badge--warning {
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFE69C;
}

.course-card__warning {
    margin: 8px 0;
    padding: 8px 12px;
    background: #FFF3CD;
    border-left: 3px solid #FFC107;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
}

/* Edit History Modal */
.modal-subtitle {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

.version-list {
    max-height: 500px;
    overflow-y: auto;
}

.version-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 3px solid #d0d0d0;
    background: #f9f9f9;
}

.version-item.version-edit-markdown {
    border-left-color: #4A90E2;
    background: #F0F7FF;
}

.version-item.version-edit-scorm {
    border-left-color: #F59E0B;
    background: #FFFBEB;
}

.version-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.version-info {
    flex: 1;
}

.version-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.version-header strong {
    font-size: 14px;
    color: #333;
}

.version-type {
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.version-date {
    font-size: 12px;
    color: #666;
    margin-left: auto;
}

.version-description {
    margin: 0;
    font-size: 13px;
    color: #555;
    font-style: italic;
}

.version-item.version-restore {
    border-left-color: #10B981;
    background: #ECFDF5;
}

.version-current {
    padding: 2px 8px;
    background: #10B981;
    color: white;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.version-restore-btn {
    padding: 6px 12px;
    background: #10B981;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
}

.version-restore-btn:hover {
    background: #059669;
}

/* ============================================================================
   TRAINING COURSES MODAL (Course Generation Status)
   ============================================================================ */

.modal--large .modal__content--large {
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    padding: 0;
}

.training-courses-modal__header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

.training-courses-modal__header h2 {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--color-text);
    font-size: 24px;
}

.training-courses-modal__subtitle {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.training-courses-modal__progress {
    color: var(--color-primary);
    font-weight: 600;
}

.training-courses-modal__list {
    padding: var(--spacing-lg);
    max-height: 60vh;
    overflow-y: auto;
    display: grid;
    gap: var(--spacing-md);
}

.training-course-item {
    padding: var(--spacing-md) var(--spacing-lg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    transition: all 0.2s ease;
}

.training-course-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.training-course-item--generated {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.3);
}

.training-course-item__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.training-course-item__number {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.course-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.course-status--generated {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.course-status--pending {
    background: rgba(251, 191, 36, 0.15);
    color: #d97706;
}

.training-course-item__title {
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}

.training-course-item__meta {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.training-courses-modal__footer {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    display: flex;
    justify-content: flex-end;
}

.training-courses-modal__close {
    padding: var(--spacing-sm) var(--spacing-xl);
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.training-courses-modal__close:hover {
    background: var(--color-primary-dark);
}

/* ============================================================================
   BULK ACTIONS TOOLBAR
   ============================================================================ */

.bulk-actions-toolbar {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.bulk-actions-toolbar__left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.bulk-actions-toolbar__right {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.bulk-actions-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}

.bulk-actions-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.bulk-actions-count {
    font-size: 0.875rem;
    color: var(--color-primary);
    font-weight: 600;
    padding: 4px 12px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 12px;
}

.bulk-action-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: white;
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bulk-action-btn:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.bulk-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bulk-action-btn--secondary {
    background: #f1f5f9;
    color: #64748b;
}

.bulk-action-btn--secondary:hover {
    background: #e2e8f0;
    color: #475569;
    border-color: #cbd5e1;
}

/* Course Card Checkbox */
.course-card__checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
    accent-color: var(--color-primary);
}

.course-card--selectable {
    position: relative;
    cursor: pointer;
}

/* Show checkbox on hover or when selected */
.course-card--selectable:hover .course-card__checkbox,
.course-card--selected .course-card__checkbox {
    opacity: 1;
}

.course-card--selected {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    background: rgba(37, 99, 235, 0.02);
}

/* ============================================================================
   Audio Modal Styles
   ============================================================================ */

.audio-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.audio-modal__content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1;
}

.audio-modal__header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
}

.audio-modal__header h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: #1a1a1a;
}

.audio-modal__course-title {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.audio-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.audio-modal__close:hover {
    background: #f3f4f6;
    color: #1a1a1a;
}

/* Statistics Bar */

.audio-modal__stats {
    display: flex;
    gap: 24px;
    padding: 20px 24px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.audio-stat {
    flex: 1;
    text-align: center;
}

.audio-stat__value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 4px;
}

.audio-stat__label {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Voice Statistics */

.audio-modal__voice-stats {
    padding: 20px 24px;
    background: #fefefe;
    border-bottom: 1px solid #e5e7eb;
}

.voice-stats-header {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.voice-stats-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.voice-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.voice-stat-label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
}

.voice-stat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.voice-stat-dot--cedar {
    background: #10b981;
}

.voice-stat-dot--marin {
    background: #3b82f6;
}

.voice-stat-dot--alloy {
    background: #8b5cf6;
}

.voice-stat-dot--echo {
    background: #f59e0b;
}

.voice-stat-name {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
}

.voice-stat-bar-wrapper {
    flex: 1;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.voice-stat-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.voice-stat-bar--cedar {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.voice-stat-bar--marin {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.voice-stat-bar--alloy {
    background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%);
}

.voice-stat-bar--echo {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.voice-stat-value {
    min-width: 80px;
    text-align: right;
    font-size: 13px;
    color: #666;
    font-variant-numeric: tabular-nums;
}

/* Lessons List */

.audio-modal__lessons {
    padding: 24px;
}

.audio-lesson {
    margin-bottom: 24px;
}

.audio-lesson:last-child {
    margin-bottom: 0;
}

.audio-lesson__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.audio-lesson__header h4 {
    margin: 0;
    font-size: 18px;
    color: #1a1a1a;
}

.audio-lesson__duration {
    font-size: 14px;
    color: #666;
    font-variant-numeric: tabular-nums;
}

.audio-lesson__files {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Audio File Items */

.audio-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 3px solid #e5e7eb;
    transition: all 0.2s;
}

.audio-file-item:hover {
    background: #f3f4f6;
}

.audio-file-item[data-voice="cedar"] {
    border-left-color: #10b981;
}

.audio-file-item[data-voice="marin"] {
    border-left-color: #3b82f6;
}

.audio-file-item__info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.audio-file-item__icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
}

.voice-icon-cedar {
    background: #ecfdf5;
}

.voice-icon-marin {
    background: #eff6ff;
}

.audio-file-item__details {
    flex: 1;
}

.audio-file-item__name {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.audio-file-item__meta {
    font-size: 12px;
    color: #666;
}

.audio-file-item__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audio-file-item__player {
    height: 32px;
    max-width: 300px;
}

.audio-file-item__download {
    background: #10b981;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.audio-file-item__download:hover {
    background: #059669;
}

/* Modal Actions */

.audio-modal__actions {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    background: white;
}

.audio-modal__btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 14px;
}

.audio-modal__btn--primary {
    background: #10b981;
    color: white;
}

.audio-modal__btn--primary:hover {
    background: #059669;
}

.audio-modal__btn--secondary {
    background: #e5e7eb;
    color: #1a1a1a;
}

.audio-modal__btn--secondary:hover {
    background: #d1d5db;
}

/* Audio Button on Course Card */

.course-card__button--audio {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.course-card__button--audio:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Responsive */

@media (max-width: 768px) {
    .audio-modal__content {
        width: 95%;
        max-height: 90vh;
    }

    .audio-file-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .audio-file-item__actions {
        width: 100%;
        justify-content: space-between;
    }

    .audio-file-item__player {
        max-width: none;
        width: calc(100% - 48px);
    }
}

/* ============================================================================
   Loading Modal (for ZIP Download)
   ============================================================================ */

.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;  /* Above audio modal */
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.loading-modal__content {
    position: relative;
    background: var(--color-bg);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 300px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px auto;
    position: relative;
}

.loading-spinner::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-sizing: border-box;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-modal__text {
    font-size: 1rem;
    color: var(--color-text);
    margin: 0 0 var(--spacing-md) 0;
    font-weight: 500;
}

.loading-modal__cancel {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--color-danger, #dc2626);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.loading-modal__cancel:hover {
    background: var(--color-danger-dark, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* ============================================================================
   Progress Modal (for SCORM/Audio Generation)
   ============================================================================ */

.progress-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;  /* Above audio modal */
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.progress-modal__content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    padding: 32px;
    width: 90%;
    max-width: 500px;
    z-index: 1;
}

.progress-modal__title {
    margin: 0 0 24px 0;
    font-size: 24px;
    color: #1a1a1a;
    text-align: center;
}

.progress-modal__steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    border-left: 4px solid #e5e7eb;
    transition: all 0.3s;
}

.progress-step--active {
    background: #ecfdf5;
    border-left-color: #10b981;
}

.progress-step--completed {
    background: #f0fdf4;
    border-left-color: #10b981;
    opacity: 0.7;
}

.progress-step__number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.progress-step--active .progress-step__number {
    background: #10b981;
    color: white;
    animation: pulse 2s infinite;
}

.progress-step--completed .progress-step__number {
    background: #10b981;
    color: white;
}

.progress-step__label {
    flex: 1;
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 500;
}

.progress-step__status {
    font-size: 20px;
    flex-shrink: 0;
}

.progress-step--active .progress-step__status {
    animation: spin 1s linear infinite;
}

.progress-step--completed .progress-step__status::before {
    content: '✅';
}

.progress-modal__message {
    text-align: center;
    font-size: 14px;
    color: #666;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

/* Animations */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Generate Audio Button Styling */

.course-card__button--generate-audio {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.course-card__button--generate-audio:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

/* ============================================================================
   Diagram Preview Styles (Mermaid & D2)
   ============================================================================ */

/* Mermaid diagram container */
.mermaid-container {
    margin: 24px 0;
    padding: 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    overflow-x: auto;
}

/* Mermaid diagram styling */
.mermaid {
    display: inline-block;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* D2 diagram note (not rendered client-side) */
.code-block-note {
    background: #fff3cd;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #856404;
    border-bottom: 2px solid #ffc107;
    border-radius: 4px 4px 0 0;
    margin-top: 24px;
    margin-bottom: 0;
}

/* Code block styling (for D2 and other code) */
.markdown-preview-content pre {
    margin: 0 0 24px 0;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 4px 4px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.markdown-preview-content pre code {
    background: none;
    padding: 0;
    border: none;
    color: #1a1a1a;
}

/* Code block with note styling */
.code-block-note + pre {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* ============================================================================
   Course Card Dropdown Component
   ============================================================================ */

.course-card__dropdown {
    position: relative;
    display: block;
}

.course-card__dropdown-btn {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-card__dropdown-btn:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-primary);
}

.course-card__dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.course-card__dropdown-menu.show {
    display: block;
}

.course-card__menu-item {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: white;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.15s ease;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.course-card__menu-item:last-child {
    border-bottom: none;
}

.course-card__menu-item:hover {
    background: var(--color-bg-secondary);
}

.course-card__menu-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.course-card__menu-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ============================================================================
   Diagram Progress Modal
   ============================================================================ */

.diagram-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.diagram-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    padding: 32px;
    width: 90%;
    max-width: 600px;
}

.diagram-modal__header h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: #1a1a1a;
}

.diagram-modal__course {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.diagram-modal__phases {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 32px 0 24px 0;
}

.phase-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.phase-indicator__circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #9ca3af;
    transition: all 0.3s;
}

.phase-indicator--active .phase-indicator__circle {
    background: #3b82f6;
    color: white;
    animation: pulse 2s infinite;
}

.phase-indicator--complete .phase-indicator__circle {
    background: #10b981;
    color: white;
}

.phase-indicator__label {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

.phase-indicator--active .phase-indicator__label {
    color: #1a1a1a;
    font-weight: 600;
}

.progress-bar-container {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    transition: width 0.5s ease-out;
    width: 0%;
}

.progress-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #6b7280;
}

.progress-percentage {
    font-weight: 600;
    color: #1a1a1a;
}

.progress-separator {
    color: #d1d5db;
}

.progress-elapsed {
    font-variant-numeric: tabular-nums;
}

.progress-message {
    text-align: center;
    font-size: 14px;
    color: #1a1a1a;
    min-height: 20px;
}

.diagram-modal__completion {
    text-align: center;
    padding: 20px 0;
}

.completion-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.completion-title {
    margin: 0 0 16px 0;
    font-size: 20px;
    color: #10b981;
}

.completion-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    text-align: left;
}

.stat-item {
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 14px;
}

.diagram-modal__error {
    text-align: center;
    padding: 20px 0;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.error-title {
    margin: 0 0 12px 0;
    font-size: 20px;
    color: #dc2626;
}

.error-message {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: #6b7280;
}

.diagram-modal__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-cancel,
.btn-close {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 14px;
}

.btn-cancel {
    background: #e5e7eb;
    color: #1a1a1a;
}

.btn-cancel:hover {
    background: #d1d5db;
}

.btn-close.btn-primary,
.btn-regenerate.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-close.btn-primary:hover,
.btn-regenerate.btn-primary:hover {
    background: #2563eb;
}

.btn-close.btn-secondary {
    background: #e5e7eb;
    color: #1a1a1a;
}

.btn-close.btn-secondary:hover {
    background: #d1d5db;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* ============================================================================
   Diagram Instructions Modal
   ============================================================================ */

.instructions-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
}

.instructions-modal {
    background: white;
    border-radius: 12px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
}

.instructions-modal__header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #1a1a1a;
}

.instructions-modal__subtitle {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: #666;
}

.instructions-modal__body {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
}

.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-help {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 8px 0 0 0;
    line-height: 1.5;
}

.form-help strong {
    color: #1a1a1a;
}

.instructions-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-regenerate {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 14px;
}


/* ============================================================================
   Image Gallery Modal Styles
   ============================================================================ */

/* Modal container */
.image-gallery-modal,
.image-edit-modal,
.variants-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-gallery-modal__overlay,
.image-edit-modal__overlay,
.variants-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.image-gallery-modal__content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.image-edit-modal__content,
.variants-modal__content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.image-gallery-modal__header,
.image-edit-modal__header,
.variants-modal__header {
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.image-gallery-modal__header h3,
.image-edit-modal__header h3,
.variants-modal__header h4 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.image-gallery-modal__close,
.image-edit-modal__close,
.variants-modal__close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: white;
}

.image-gallery-modal__close:hover,
.image-edit-modal__close:hover,
.variants-modal__close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Filters */
.image-gallery-filters {
    padding: 20px 32px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.image-gallery-filters__row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.image-gallery-filter {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.image-gallery-filter label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.filter-input,
.filter-select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    transition: all 0.2s;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Stats bar */
.image-gallery-stats {
    padding: 16px 32px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 32px;
    background: white;
}

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

.image-stat__value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.image-stat__label {
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Grid */
.image-gallery-grid {
    padding: 24px 32px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    overflow-y: auto;
    flex: 1;
}

.image-gallery-empty {
    padding: 80px 32px;
    text-align: center;
    color: #6b7280;
}

.image-gallery-empty p {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.image-gallery-empty__hint {
    font-size: 14px;
    color: #9ca3af;
}

/* Image card */
.image-gallery-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.image-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.image-gallery-item__thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
}

.image-gallery-item__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.image-gallery-item:hover .image-gallery-item__thumbnail img {
    transform: scale(1.05);
}

.image-gallery-item__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-gallery-item:hover .image-gallery-item__overlay {
    opacity: 1;
}

.image-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.image-badge--variant {
    background: rgba(118, 75, 162, 0.9);
}

.image-gallery-item__info {
    padding: 16px;
}

.image-gallery-item__meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.image-gallery-item__meta .image-badge {
    position: static;
    background: #f3f4f6;
    color: #374151;
    font-size: 11px;
}

.image-gallery-item__alt {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

.image-gallery-item__caption {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    font-style: italic;
}

.image-gallery-item__details {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #9ca3af;
}

.image-gallery-item__details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.image-gallery-item__actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.image-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #667eea;
}

.image-action-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
}

.image-action-btn--secondary {
    font-size: 18px;
    flex: 0 0 auto;
    padding: 8px;
    width: 38px;
}

/* Pagination */
.image-gallery-pagination {
    padding: 20px 32px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: white;
}

.pagination-btn {
    padding: 10px 20px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not([disabled]) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* ============================================================================
   Image Edit Modal Styles
   ============================================================================ */

.image-edit-preview {
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

.image-edit-preview__label {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 16px;
}

.image-edit-preview__img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-edit-preview__meta {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 12px;
    font-size: 13px;
    color: #9ca3af;
}

.image-edit-form {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #374151;
}

.form-hint {
    display: block;
    font-size: 13px;
    color: #9ca3af;
    margin-top: 4px;
    font-weight: normal;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* Progress section */
.image-edit-progress {
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
}

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

.progress-header h4 {
    margin: 0;
    font-size: 16px;
    color: #1f2937;
}

#progress-percentage {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.progress-message {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #6b7280;
}

.progress-details {
    font-size: 13px;
    color: #9ca3af;
}

/* Comparison section */
.image-edit-comparison {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
}

.image-edit-comparison h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #1f2937;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.comparison-item {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.comparison-label {
    background: #f9fafb;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

.comparison-img {
    width: 100%;
    height: auto;
    display: block;
}

.comparison-actions {
    display: flex;
    gap: 12px;
}

/* Variants modal */
.variants-modal__content {
    max-width: 800px;
}

.variants-list {
    padding: 24px 32px;
    overflow-y: auto;
    max-height: 60vh;
}

.variant-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.variant-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.variant-item--original {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-color: #667eea;
}

.variant-item img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.variant-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.variant-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #f3f4f6;
    color: #374151;
    width: fit-content;
}

.variant-info p {
    margin: 0;
    font-size: 14px;
    color: #1f2937;
}

.variant-info small {
    font-size: 12px;
    color: #9ca3af;
}

/* Responsive */
@media (max-width: 1200px) {
    .image-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .image-gallery-modal__content {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        max-height: 100vh;
    }

    .image-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        padding: 16px;
    }

    .image-gallery-filters__row {
        flex-direction: column;
    }

    .image-gallery-filter {
        width: 100%;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

/* Insert Image Button */
.editor-toolbar-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.editor-toolbar-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* ============================================================================
   Metadata Editor Modal Styles
   ============================================================================ */

.metadata-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metadata-editor-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.metadata-editor-modal__content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.metadata-editor-modal__header {
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.metadata-editor-modal__header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.metadata-editor-modal__close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: white;
}

.metadata-editor-modal__close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Preview section */
.metadata-editor-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.metadata-preview-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.metadata-preview__img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.metadata-preview-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.metadata-preview-info h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #1f2937;
}

.metadata-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

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

.metadata-info-label {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metadata-info-value {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

.metadata-badge-variant {
    color: #764ba2;
    font-weight: 600;
}

.metadata-prompt-section {
    margin-top: 8px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.metadata-prompt-section h5 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

.metadata-prompt-text {
    margin: 0;
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
    font-style: italic;
}

/* Form section */
.metadata-editor-form {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
}

.input-with-counter {
    position: relative;
}

.char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
}

.required {
    color: #ef4444;
    font-weight: 700;
}

.optional {
    color: #9ca3af;
    font-weight: 500;
    font-style: italic;
}

/* Actions */
.metadata-editor-actions {
    padding: 20px 32px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    background: white;
}

.metadata-editor-actions .btn-primary,
.metadata-editor-actions .btn-secondary {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .metadata-editor-preview {
        grid-template-columns: 1fr;
    }

    .metadata-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   Image Upload Modal Styles
   ============================================================================ */

.upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.upload-modal__content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.upload-modal__header {
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.upload-modal__header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.upload-modal__close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: white;
}

.upload-modal__close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* File selector */
.upload-file-selector {
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
}

.upload-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: #f9fafb;
}

.upload-dropzone.dragover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    transform: scale(1.02);
}

.upload-dropzone:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.02);
}

.upload-dropzone__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-icon {
    font-size: 48px;
}

.upload-hint {
    margin: 0;
    font-size: 14px;
    color: #9ca3af;
}

.upload-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.upload-preview img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.upload-file-info {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.btn-change-file {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-change-file:hover {
    background: #f3f4f6;
}

/* Upload form */
.upload-form {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
}

/* Upload actions */
.upload-modal__actions {
    padding: 20px 32px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    background: white;
}

.upload-modal__actions .btn-primary,
.upload-modal__actions .btn-secondary {
    flex: 1;
}

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}
