.ai-resume-builder-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.resume-builder-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: none;
    color: #000000;
    border-radius: 12px;
}

.resume-builder-header h2 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 300;
}

.resume-builder-header p {
    margin: 0;
    font-size: 1.2em;
    opacity: 0.9;
}

.resume-builder-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
    }

/* Left Column Styles */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.input-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.input-header h3 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.5em;
}

.input-header p {
    margin: 0 0 20px 0;
    color: #7f8c8d;
}

.prompt-input textarea {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.prompt-input textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-tips {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.input-tips strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 8px;
}

.input-tips ul {
    margin: 0;
    padding-left: 20px;
    color: #5a6c7d;
}

.input-tips li {
    margin-bottom: 4px;
}

.generate-button {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.generate-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.generate-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Preview Section */
.preview-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    min-height: 400px;
}

.preview-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.preview-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5em;
}

.preview-actions {
    margin-left: auto;
}

.action-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.action-button:hover {
    background: #5a6268;
}

.empty-preview {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state .empty-icon {
    font-size: 4em;
    display: block;
    margin-bottom: 20px;
}

.empty-state h4 {
    margin: 0 0 10px 0;
    color: #495057;
}

.empty-state p {
    margin: 0;
    line-height: 1.6;
}

#resume-preview-content {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 30px;
    max-height: 1760px;
    overflow-y: hidden;
    position: relative;
}

/* Download Section */
.download-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #f8f9fa;
}

.download-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.download-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #28a745;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.download-button:hover {
    background: #218838;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.download-button.secondary {
    background: #6c757d;
}

.download-button.secondary:hover {
    background: #5a6268;
}

.download-note {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
    text-align: center;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 20px;
}

.loading-content h4 {
    margin: 20px 0 10px 0;
    color: #495057;
}

.loading-content p {
    margin: 0;
    color: #6c757d;
}

.loading-spinner-large {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid #667eea;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    text-align: center;
}

/* Right Column Styles */
.right-column {
    position: sticky;
    top: 20px;
}

.templates-sidebar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    overflow: hidden;
}

.sidebar-header {
    padding: 25px;
    background: none;
    color: rgb(0, 0, 0);
    text-align: center;
}

.sidebar-header h3 {
    margin: 0 0 8px 0;
    font-size: 1.4em;
}

.sidebar-header p {
    margin: 0;
    opacity: 0.9;
}

.template-filters {
    display: flex;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    gap: 8px;
}

.filter-button {
    flex: 1;
    background: white;
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 500;
}

.filter-button.active,
.filter-button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}
.templates-list {
    padding: 15px;
    max-height: 700px;
    overflow-y: auto;
}

.template-card {
    margin-bottom: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.template-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-card.selected {
    border-color: #28a745;
    background: #f8fff9;
}

.template-card.premium {
    border-color: #ffd700;
}
.template-preview {
  position: relative;
  height: 120px;
  width: 100%;
  overflow: hidden;
  border-radius: 8px; /* optional */
}

.template-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.template-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.template-icon {
    font-size: 2em;
    margin-bottom: 8px;
}

.template-name {
    font-size: 12px;
    font-weight: 500;
}

.template-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.template-badge.free {
    background: #28a745;
    color: white;
}

.template-badge.premium {
    background: #ffd700;
    color: #000;
}

.template-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 ease;
}

.template-card:hover .template-overlay {
    opacity: 1;
}

.select-template-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.select-template-btn:hover {
    background: #5a6fd8;
}

.template-info {
    padding: 12px;
}

.template-info h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #2c3e50;
}

.template-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.template-actions input[type="radio"] {
    margin-right: 6px;
}

.template-actions label {
    font-size: 12px;
    color: #28a745;
    font-weight: 500;
}

.premium-lock {
    font-size: 14px;
}

.sidebar-footer {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
}

.selected-template-info {
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.selected-template-info strong {
    color: #2c3e50;
}

#current-template-name {
    color: #28a745;
    font-weight: 500;
}

.template-help {
    text-align: center;
}

.template-help p {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .resume-builder-layout {
        grid-template-columns: 1fr;
    }
    
    .right-column {
        position: static;
    }
}

@media (max-width: 768px) {
    .ai-resume-builder-wrapper {
        padding: 10px;
    }
    
    .resume-builder-header {
        padding: 20px;
    }
    
    .resume-builder-header h2 {
        font-size: 2em;
    }
    
    .input-section,
    .preview-section {
        padding: 20px;
    }
    
    .download-actions {
        flex-direction: column;
    }
    
    .template-filters {
        flex-wrap: wrap;
    }
}

/* Resume Template Styles */
.resume-template {
    font-family: inherit;
    line-height: 1.6;
}

.resume-template h1, 
.resume-template h2, 
.resume-template h3, 
.resume-template h4 {
    margin-top: 0;
}

.resume-template ul {
    padding-left: 20px;
}

.resume-template .experience-item,
.resume-template .education-item {
    margin-bottom: 15px;
}

/* Print Styles */
@media print {
    .ai-resume-builder-wrapper * {
        visibility: hidden;
    }
    
    #resume-preview-content,
    #resume-preview-content * {
        visibility: visible;
    }
    
    #resume-preview-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-height: none;
        border: none;
        box-shadow: none;
    }
}





/* Default Template Badge */
.template-badge.default {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 2;
}

.default-badge {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 5px;
}

.template-card.selected {
    border-color: #28a745;
    background: #f8fff9;
}

.template-card.selected .template-badge.default {
    background: #218838;
}

/* Updated Download Section Styles */
.download-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #f8f9fa;
    text-align: center;
}

.download-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.download-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #28a745;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
    min-width: 140px;
    justify-content: center;
}

.download-button:hover {
    background: #218838;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.download-button.secondary {
    background: #007cba;
}

.download-button.secondary:hover {
    background: #005a87;
}

.download-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.download-note {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
    text-align: center;
}

/* Resume Actions in Preview */
.resume-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.resume-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #007cba;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 13px;
}

.resume-action-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    color: white;
}

.resume-action-btn.print {
    background: #6c757d;
}

.resume-action-btn.print:hover {
    background: #545b62;
}



/* Loading states for PDF generation */
.pdf-loading {
    position: relative;
}

.pdf-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #007cba;
    font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .download-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .download-button {
        width: 100%;
        max-width: 200px;
    }
    
    .resume-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .resume-action-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

/* Print-specific styles */
@media print {
    .resume-actions,
    .download-section,
    .no-print {
        display: none !important;
    }
    
    #resume-preview-content {
        max-height: none;
        overflow: visible;
        border: none;
        box-shadow: none;
        padding: 0;
    }
}




/* RTL Support for Arabic */
.resume-template.rtl {
    direction: rtl;
    text-align: right;
}

.resume-template.rtl .resume-header {
    text-align: right;
}

.resume-template.rtl .contact-info {
    text-align: right;
}

.resume-template.rtl .resume-section h2 {
    text-align: right;
}

.resume-template.rtl .experience-item,
.resume-template.rtl .education-item {
    text-align: right;
}

.resume-template.rtl ul {
    padding-right: 15px;
    padding-left: 0;
}

.resume-template.rtl .resume-columns .sidebar {
    text-align: right;
}

/* PDF RTL Support */
[dir="rtl"] .resume-template {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .resume-header {
    text-align: right;
}

[dir="rtl"] .resume-section h2 {
    text-align: right;
}

/* UI RTL Support */
.rtl-layout {
    direction: rtl;
    text-align: right;
}

.rtl-layout .input-section,
.rtl-layout .preview-section,
.rtl-layout .templates-sidebar {
    text-align: right;
}

.rtl-layout .template-info {
    text-align: right;
}