/**
 * Enhanced Material Generator Styles
 * AI-powered interface with quality indicators
 */

.enhanced-materials-container {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header Section */
.materials-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
}

.materials-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.materials-header p {
    font-size: 16px;
    opacity: 0.95;
}

/* Job Insights Panel */
.job-insights-panel {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.job-insights-panel h3 {
    font-size: 20px;
    color: #1f2937;
    margin-bottom: 20px;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.insight-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.insight-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    border-radius: 10px;
}

.insight-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.insight-value {
    font-size: 16px;
    color: #1f2937;
    font-weight: 600;
}

/* Tabs */
.materials-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #4b5563;
}

.tab-btn.active {
    color: #4f46e5;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #4f46e5;
}

/* Material Workspace */
.material-workspace {
    background: white;
    border-radius: 12px;
    padding: 30px;
    min-height: 500px;
}

.status-bar {
    padding: 12px 20px;
    background: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 14px;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* AI Recommendations */
.ai-recommendation {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #4f46e5;
    transition: all 0.3s ease;
}

.ai-recommendation:hover {
    background: #f3f4f6;
    transform: translateX(5px);
}

.rec-number {
    width: 32px;
    height: 32px;
    background: #4f46e5;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.rec-content {
    flex: 1;
}

.rec-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

.rec-detail {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

.rec-example {
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    color: #4b5563;
    font-style: italic;
}

.btn-apply-ai-rec {
    padding: 8px 16px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-apply-ai-rec:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* Keyword Analysis */
.keyword-analysis {
    background: #fefce8;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    border: 1px solid #fef3c7;
}

.keyword-analysis h4 {
    font-size: 18px;
    color: #713f12;
    margin-bottom: 20px;
}

.keywords-to-add,
.keywords-matched {
    margin-bottom: 20px;
}

.keywords-to-add h5,
.keywords-matched h5 {
    font-size: 14px;
    color: #92400e;
    margin-bottom: 10px;
}

.keyword-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.keyword-pill.missing {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.keyword-pill.matched {
    background: #dcfce7;
    color: #14532d;
    border: 1px solid #bbf7d0;
}

/* Quality Score Display */
.score-display {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 8px;
    font-size: 18px;
}

.letter-quality-score {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e5e7eb;
}

.letter-quality-score h4 {
    font-size: 18px;
    color: #1f2937;
    margin-bottom: 20px;
}

.score-breakdown {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.score-item span {
    min-width: 120px;
    font-size: 14px;
    color: #4b5563;
}

.score-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    transition: width 0.5s ease;
}

/* Cover Letter Options */
.cover-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.option-group {
    background: #f9fafb;
    padding: 20px;
    border-radius: 10px;
}

.option-group h4 {
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 15px;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 14px;
    color: #4b5563;
}

.option-group input[type="radio"] {
    width: 18px;
    height: 18px;
}

/* AI Cover Letter Display */
.ai-cover-letter {
    background: #f9fafb;
    border-radius: 12px;
    padding: 30px;
    margin: 25px 0;
    border: 1px solid #e5e7eb;
}

.letter-body {
    font-size: 15px;
    line-height: 1.8;
    color: #374151;
    white-space: pre-wrap;
}

/* LinkedIn Optimization */
.optimization-content {
    background: #f0f9ff;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    border: 1px solid #bae6fd;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 12px 24px;
    background: white;
    color: #4b5563;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Materials Footer */
.materials-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    margin-top: 30px;
}

.progress-indicator {
    font-size: 14px;
    color: #6b7280;
}

#materials-completed {
    font-weight: 600;
    color: #4f46e5;
}

/* Loading State */
.materials-loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #e5e7eb;
    border-top-color: #4f46e5;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.materials-loading h3 {
    font-size: 22px;
    color: #1f2937;
    margin-bottom: 10px;
}

.materials-loading p {
    font-size: 16px;
    color: #6b7280;
}

/* Notifications */
.material-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
    }
    to {
        transform: translateX(0);
    }
}

.material-notification.success {
    border-left: 4px solid #10b981;
}

.material-notification.info {
    border-left: 4px solid #3b82f6;
}

.material-notification.error {
    border-left: 4px solid #ef4444;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .enhanced-materials-container {
        padding: 15px;
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
    }
    
    .materials-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 100px;
    }
    
    .cover-options {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
    
    .materials-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .ai-recommendation {
        flex-direction: column;
    }
    
    .rec-number {
        align-self: flex-start;
    }
}