/* Enhanced Resume Builder CSS Styles */

/* Container and General Styles */
#resume-builder-container {
    max-width: 1400px;
    margin: 0 auto;
    font-family: 'Arial', sans-serif;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.resume-step {
    display: none;
}

.resume-step.active {
    display: block;
}

/* Template Selection Styles */
#template-selection {
    text-align: center;
}

#template-selection h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.2em;
    font-weight: 300;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.template-option {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.template-option:hover {
    border-color: #3498db;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.2);
}

.template-option.selected {
    border-color: #2ecc71;
    background: #f8fff9;
}

/* Template Sample Previews */
.template-sample {
    height: 200px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    position: relative;
    font-size: 10px;
    padding: 10px;
}

.modern-sample {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 30%, white 30%);
}

.classic-sample {
    background: white;
    border: 2px solid #000;
}

.creative-sample {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 30%, white 30%);
}

.minimal-sample {
    background: white;
    border: 1px solid #bdc3c7;
}

.executive-sample {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 25%, white 25%);
}

.portfolio-sample {
    background: linear-gradient(135deg, #e74c3c 0%, #f39c12 35%, white 35%);
}

.sample-header {
    color: white;
    padding: 5px 0;
}

.modern-sample .sample-header,
.creative-sample .sample-header,
.executive-sample .sample-header,
.portfolio-sample .sample-header {
    color: white;
}

.classic-sample .sample-header,
.minimal-sample .sample-header {
    color: #000;
    border-bottom: 1px solid #000;
    padding-bottom: 3px;
}

.sample-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: bold;
}

.sample-header p {
    margin: 2px 0 0 0;
    font-size: 9px;
    opacity: 0.8;
}

.sample-section {
    margin-top: 8px;
    color: #333;
}

.sample-section h4 {
    margin: 0 0 3px 0;
    font-size: 9px;
    font-weight: bold;
    border-bottom: 1px solid #3498db;
    padding-bottom: 1px;
}

.classic-sample .sample-section h4 {
    border-bottom: 1px solid #000;
    text-transform: uppercase;
}

.sample-item {
    font-size: 8px;
    margin-top: 2px;
}

/* Photo support in template previews */
.sample-photo-section {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    padding: 5px 0;
}

.sample-photo-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    padding: 5px 0;
}

.sample-photo {
    width: 25px;
    height: 25px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    flex-shrink: 0;
}

.sample-info h3 {
    margin: 0;
    font-size: 11px;
    font-weight: bold;
}

.sample-info p {
    margin: 1px 0 0 0;
    font-size: 8px;
    opacity: 0.8;
}

.template-option h4 {
    margin: 10px 0 5px 0;
    color: #2c3e50;
    font-size: 1.2em;
    font-weight: 600;
}

.template-option p {
    margin: 0 0 15px 0;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Photo Upload Styles */
.photo-section {
    border: 2px dashed #3498db;
    border-radius: 8px;
    background: #f8f9fa;
}

.photo-upload-area {
    text-align: center;
    padding: 20px;
}

.photo-preview {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.photo-preview:hover {
    border-color: #3498db;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #95a5a6;
    font-size: 12px;
    text-align: center;
}

/* Button Styles */
.btn-primary, .btn-secondary, .btn-success, .btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    margin: 5px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    padding: 8px 16px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #c0392b;
}

.select-template {
    width: 100%;
    margin-top: 10px;
}

/* Resume Editor Styles */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.editor-header h2 {
    color: #2c3e50;
    margin: 0;
    font-size: 2em;
    font-weight: 300;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.editor-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.editor-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Form Styles */
.form-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-label {
    flex-direction: row !important;
    align-items: center;
    cursor: pointer;
    margin-top: 25px;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    margin-bottom: 0;
    width: auto;
}

/* Dynamic Form Items */
.experience-item,
.education-item,
.custom-field-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    position: relative;
}

.remove-experience,
.remove-education,
.remove-custom-field {
    margin-top: 15px;
    float: right;
}

/* Custom Fields Styles */
.custom-field-item {
    border-left: 4px solid #3498db;
}

.custom-field-item .form-row {
    margin-bottom: 10px;
}

/* Preview Styles */
.resume-preview {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.preview-placeholder {
    text-align: center;
    color: #95a5a6;
    padding: 60px 20px;
}

.preview-placeholder h3 {
    margin-bottom: 10px;
    color: #7f8c8d;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5em;
    font-weight: 600;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #95a5a6;
    transition: color 0.3s ease;
}

.close:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Enhanced Resume Preview Templates */
.resume-modern {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
}

.resume-modern .header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    margin: -30px -30px 30px -30px;
    border-radius: 12px 12px 0 0;
}

.resume-modern .name {
    font-size: 2.5em;
    font-weight: 300;
    margin-bottom: 5px;
}

.resume-modern .title {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 20px;
}

.resume-modern .contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    font-size: 0.9em;
}

.resume-modern .section {
    margin-bottom: 30px;
}

.resume-modern .section-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.resume-modern .experience-item,
.resume-modern .education-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.resume-modern .experience-item:last-child,
.resume-modern .education-item:last-child {
    border-bottom: none;
}

.resume-modern .job-title,
.resume-modern .degree {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 3px;
}

.resume-modern .company,
.resume-modern .school {
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 3px;
}

.resume-modern .date {
    color: #95a5a6;
    font-size: 0.85em;
    margin-bottom: 8px;
}

.resume-modern .skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.resume-modern .skill-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

/* Executive Template with Photo */
.resume-executive .photo-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.resume-executive .profile-photo {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 3px solid white;
}

/* Portfolio Template with Photo */
.resume-portfolio .photo-center {
    text-align: center;
    margin-bottom: 20px;
}

.resume-portfolio .profile-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .template-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .template-grid {
        grid-template-columns: 1fr 1fr;
    }

    .editor-content {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .editor-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .editor-actions {
        justify-content: center;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .resume-modern .contact-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .template-grid {
        grid-template-columns: 1fr;
    }

    #resume-builder-container {
        padding: 15px;
    }

    .editor-form,
    .resume-preview {
        padding: 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .experience-item,
    .education-item,
    .custom-field-item {
        padding: 15px;
    }
}

/* Print Styles */
@media print {
    .editor-header,
    .editor-actions,
    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-danger {
        display: none !important;
    }

    .editor-content {
        grid-template-columns: 1fr;
    }

    .editor-form {
        display: none;
    }

    .resume-preview {
        box-shadow: none;
        padding: 0;
    }
}

/* Success/Error Messages */
.message {
    padding: 15px;
    margin: 15px 0;
    border-radius: 6px;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Auto-save indicator */
.auto-saved {
    color: #2ecc71;
    font-size: 0.8em;
    font-weight: normal;
}