/* Editor-specific styles for JSON editing and Monaco editor */

/* Monaco Editor Customization */
.monaco-editor {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.monaco-editor .monaco-editor-background {
    background-color: var(--bg-primary);
}

.monaco-editor .monaco-editor .margin {
    background-color: var(--bg-secondary);
}

/* JSON Editor Container */
.json-editor {
    position: relative;
    min-height: 400px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--bg-primary);
}

.json-editor.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.json-editor.loading::before {
    content: 'Loading editor...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.editor-toolbar .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
}

/* Tab System */
.editor-tabs,
.output-tabs {
    display: flex;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 1rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tab-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: var(--bg-primary);
}

.tab-content {
    padding: 1.5rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Resume Preview */
.resume-preview {
    min-height: 400px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    background-color: var(--bg-primary);
    font-family: 'Georgia', serif;
    line-height: 1.6;
    overflow-y: auto;
}

.resume-preview h1 {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.resume-preview h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 1.5rem 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resume-preview h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1rem 0 0.5rem 0;
}

.resume-preview p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.resume-preview ul {
    margin: 0.5rem 0 1rem 1.5rem;
}

.resume-preview li {
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

.resume-preview .contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.resume-preview .contact-info span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.resume-preview .experience-item,
.resume-preview .education-item,
.resume-preview .project-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.resume-preview .experience-item:last-child,
.resume-preview .education-item:last-child,
.resume-preview .project-item:last-child {
    border-bottom: none;
}

.resume-preview .job-header,
.resume-preview .education-header,
.resume-preview .project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.resume-preview .job-title,
.resume-preview .degree,
.resume-preview .project-name {
    font-weight: 600;
    color: var(--text-primary);
}

.resume-preview .company,
.resume-preview .institution {
    color: var(--primary-color);
    font-weight: 500;
}

.resume-preview .dates {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.resume-preview .skills-section {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.resume-preview .skill-tag {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
}

.resume-preview .achievements {
    margin-top: 0.5rem;
}

.resume-preview .achievement-item {
    margin-bottom: 0.25rem;
    padding-left: 1rem;
    position: relative;
}

.resume-preview .achievement-item::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* PDF Preview */
.pdf-preview {
    min-height: 500px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pdf-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--radius-md);
}

.pdf-preview.loading::after {
    content: 'Generating PDF...';
    position: absolute;
    color: var(--text-secondary);
    font-weight: 500;
}

.pdf-preview.error::after {
    content: 'Error generating PDF';
    position: absolute;
    color: var(--danger-color);
    font-weight: 500;
}

/* Template Selection */
.template-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.template-option {
    cursor: pointer;
}

.template-option input[type="radio"] {
    display: none;
}

.template-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    transition: var(--transition);
    background-color: var(--bg-secondary);
    cursor: pointer;
}

.template-option input[type="radio"]:checked + .template-card {
    border-color: var(--primary-color);
    background-color: rgb(37 99 235 / 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.template-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.template-preview {
    height: 80px;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.modern-preview {
    background: linear-gradient(45deg, #f0f9ff 25%, transparent 25%), 
                linear-gradient(-45deg, #0ea5e9 25%, transparent 25%);
    background-size: 20px 20px;
}

.ats-preview {
    background: repeating-linear-gradient(
        0deg,
        #f8fafc,
        #f8fafc 2px,
        #e2e8f0 2px,
        #e2e8f0 4px
    );
}

.executive-preview {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.template-preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.1) 50%, transparent 60%);
    animation: shimmer 2s infinite;
}

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

/* Customization Summary */
.customization-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.summary-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.summary-item i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.summary-item span {
    font-weight: 500;
    color: var(--text-primary);
}

/* Download Actions */
.download-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.download-actions .btn {
    min-width: 160px;
}

/* Responsive Design for Editor */
@media (max-width: 768px) {
    .editor-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .editor-toolbar .btn {
        justify-content: center;
    }
    
    .tab-btn {
        min-width: 100px;
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .resume-preview {
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    .resume-preview h1 {
        font-size: 1.5rem;
    }
    
    .resume-preview h2 {
        font-size: 1.125rem;
    }
    
    .resume-preview .job-header,
    .resume-preview .education-header,
    .resume-preview .project-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .template-options {
        grid-template-columns: 1fr;
    }
    
    .customization-summary {
        grid-template-columns: 1fr;
    }
    
    .download-actions {
        flex-direction: column;
    }
    
    .download-actions .btn {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tab-content {
        padding: 1rem;
    }
    
    .resume-preview {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    .resume-preview h1 {
        font-size: 1.25rem;
    }
    
    .resume-preview h2 {
        font-size: 1rem;
    }
    
    .editor-toolbar {
        padding: 0.5rem;
    }
    
    .template-card {
        padding: 0.75rem;
    }
    
    .template-preview {
        height: 60px;
    }
}
