/* Template Selection Styles for Step 6 */

/* Step 6 Wrapper - Modern Layout */
.step-6-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Template Section */
.template-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-title {
    color: #1e293b;
    font-size: 1.5em;
    font-weight: 700;
    margin: 0 0 20px 0;
    text-align: center;
}

/* Templates Grid - 3 columns on desktop */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 0;
    direction: rtl;
}

.template-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    position: relative;
    overflow: visible;
}

.template-card:hover {
    border-color: #C06E4F;
    box-shadow: 0 10px 20px rgba(192, 110, 79, 0.12);
    transform: translateY(-5px);
}

.template-card.active,
.template-card.selected {
    border-color: #C06E4F;
    background-color: #FAF7F2;
    box-shadow: 0 10px 20px rgba(192, 110, 79, 0.14);
    transform: translateY(-3px);
}

/* Icon Wrapper - Professional Design */
.icon-wrapper {
    background: #FAF7F2;
    color: #C06E4F;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    transition: all 0.3s ease;
}

.template-card:hover .icon-wrapper {
    background: #ede9fe;
    transform: scale(1.05);
}

.template-card.active .icon-wrapper,
.template-card.selected .icon-wrapper {
    background: #ddd6fe;
    transform: scale(1.08);
}

.icon-wrapper i {
    width: 32px;
    height: 32px;
    stroke-width: 2;
}

.template-card span {
    color: #1e293b;
    font-size: 1em;
    font-weight: 600;
    line-height: 1.3;
}

/* NEW Badge - Modern Design */
.new-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #A85838 0%, #A85838 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    z-index: 10;
    animation: pulse-badge 2s ease-in-out infinite;
    letter-spacing: 0.5px;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
    }
}

.template-card:hover .new-badge {
    animation: none;
    transform: scale(1.08);
}

/* Editor Section */
.editor-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.editor-header {
    margin-bottom: 16px;
}

.editor-header h3 {
    color: #1e293b;
    font-size: 1.25em;
    font-weight: 700;
    margin: 0;
}

.editor-box {
    position: relative;
}

/* Skeleton Loader - Smooth Shimmer Animation */
.skeleton-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
}

/* Skeleton Wrapper - Modern Loading Animation */
.skeleton-wrapper {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-line {
    height: 18px;
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e8e8e8 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-line:nth-child(1) {
    width: 100%;
}

.skeleton-line:nth-child(2) {
    width: 90%;
}

.skeleton-line:nth-child(3) {
    width: 60%;
}

.skeleton-line:nth-child(4) {
    width: 100%;
}

.skeleton-line:nth-child(5) {
    width: 80%;
}

.skeleton-line.short {
    width: 60%;
}

.processing-text {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-top: 8px;
    font-weight: 500;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Modern Editor - Professional Document Style */
.modern-editor {
    width: 100%;
    min-height: 350px;
    padding: 25px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    font-size: 17px;
    line-height: 1.6;
    background: white;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    display: none;
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1e293b;
    resize: vertical;
    transition: all 0.3s ease;
}

.modern-editor:focus {
    outline: none;
    border-color: #C06E4F;
    box-shadow: 0 0 0 3px rgba(192, 110, 79, 0.12);
}

.modern-editor::placeholder {
    color: #94a3b8;
    font-style: italic;
}

/* Text Area Wrapper for positioning copy button */
.text-area-wrapper {
    position: relative;
}

/* Copy Button - Floating inside textarea */
.btn-copy-float {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #C06E4F;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(192, 110, 79, 0.28);
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-copy-float:hover {
    background: #A85838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(192, 110, 79, 0.38);
}

.btn-copy-float:active {
    transform: translateY(0);
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.btn-next,
.btn-back {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-next {
    background: #C06E4F;
    color: white;
}

.btn-next:hover {
    background: #A85838;
    transform: translateY(-1px);
}

.btn-back {
    background: #e5e7eb;
    color: #1e293b;
}

.btn-back:hover {
    background: #d1d5db;
}


/* Processing Status Styles - Removed old yellow box styling */
/* Now uses .skeleton-container class for modern shimmer effect */

/* Formatted Result Styles */
#formattedResult {
    margin-top: 30px;
    animation: slideUp 0.5s ease;
}

#formattedResult h4 {
    color: #1e293b;
    margin: 0 0 15px 0;
    font-size: 1.2em;
    font-weight: 600;
}

#formattedTranscriptionContent {
    background: #ffffff;
    border: 2px solid #dcdfe6;
    border-radius: 12px;
    padding: 20px;
    white-space: pre-wrap;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    direction: rtl;
    min-height: 300px;
    font-size: 17px;
    color: #1e293b;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .template-card {
        padding: 22px;
        min-height: 130px;
    }
}

@media (max-width: 768px) {
    .step-6-wrapper {
        gap: 20px;
    }
    
    .template-section,
    .editor-section {
        padding: 20px;
    }
    
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    
    .template-card {
        padding: 24px;
        min-height: 140px;
    }
    
    .icon-wrapper {
        width: 60px;
        height: 60px;
        border-radius: 14px;
        margin-bottom: 14px;
    }
    
    .icon-wrapper i {
        width: 30px;
        height: 30px;
    }
    
    .template-card span {
        font-size: 1em;
    }
    
    .modern-editor {
        min-height: 300px;
        padding: 20px;
        font-size: 16px;
    }
    
    .section-title {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .template-card {
        padding: 20px;
        min-height: 110px;
    }
    
    .icon-wrapper {
        width: 56px;
        height: 56px;
        border-radius: 12px;
        margin-bottom: 12px;
    }
    
    .icon-wrapper i {
        width: 28px;
        height: 28px;
    }
    
    .template-card span {
        font-size: 0.95em;
    }
    
    .modern-editor {
        min-height: 250px;
        padding: 16px;
        font-size: 15px;
    }
    
    .btn-copy-float {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ===== DARK MODE ===== */
[data-theme="dark"] .template-card { background: #1e293b !important; border-color: #3D2E24 !important; color: #f1f5f9 !important; }
[data-theme="dark"] .template-card:hover { background: #3D2E24 !important; border-color: #C06E4F !important; }
[data-theme="dark"] .template-card.selected { border-color: #C06E4F !important; background: rgba(192,110,79,0.14) !important; }
[data-theme="dark"] .template-card h3,
[data-theme="dark"] .template-card p,
[data-theme="dark"] .template-card small,
[data-theme="dark"] .template-card span { color: #f1f5f9 !important; }
[data-theme="dark"] .template-icon-wrapper { background: #0f172a !important; }
[data-theme="dark"] .editor-section { background: #1e293b !important; border-color: #3D2E24 !important; }
[data-theme="dark"] .formatted-transcription-editor,
[data-theme="dark"] .transcription-editor,
[data-theme="dark"] [class*="editor"] { background: #0f172a !important; color: #f1f5f9 !important; border-color: #475569 !important; }
[data-theme="dark"] .copy-btn,
[data-theme="dark"] .action-btn { background: #3D2E24 !important; color: #f1f5f9 !important; border-color: #475569 !important; }
[data-theme="dark"] .templates-grid { background: transparent !important; }
[data-theme="dark"] .section-title { color: #f1f5f9 !important; }

[data-theme="dark"] .template-section { background: #1e293b !important; border-color: #3D2E24 !important; box-shadow: none !important; }
[data-theme="dark"] .template-section .section-title { color: #f1f5f9 !important; }
