/* ================= RESET ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================= BASE ================= */
body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.lazy-ad{
    min-height:280px;
    margin:20px 0;
    text-align:center;
}

/* ================= HEADER ================= */
.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-weight: 700;
}

.header h1 i {
    font-size: 2.5rem;
    color: #9f7aea;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 300;
}

/* ================= MAIN CARD ================= */
.resume-builder {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.resume-builder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #9f7aea, #ed64a6);
}

/* ================= FORM ================= */
.form-section {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 30px;
}

.form-section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4a5568;
    font-weight: 600;
}

.form-section h2 i {
    color: #667eea;
    font-size: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 5px;
}

label.required::after {
    content: '*';
    color: #e53e3e;
    margin-left: 4px;
}

input,
select,
textarea {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    background: #f8fafc;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

input[type="month"] {
    padding: 13px 16px;
}

/* ================= CHARACTER COUNTER ================= */
.char-count {
    text-align: right;
    font-size: 0.85rem;
    margin-top: 5px;
    color: #718096;
    font-style: italic;
}

.char-count span {
    font-weight: 600;
    color: #667eea;
}

/* ================= TEMPLATE SELECTION ================= */
.template-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.template-card {
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.template-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: #667eea;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.25);
}

.template-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #f7f9ff 0%, #e6ebff 100%);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.template-card.active::before {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.template-card h3 {
    font-size: 1.3rem;
    margin: 15px 0 8px;
    color: #2d3748;
}

.template-card p {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
}

/* ================= TEMPLATE PREVIEW ================= */
.template-preview {
    height: 180px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    position: relative;
}

.preview-header {
    height: 40px;
    background: #4a5568;
    margin-bottom: 20px;
}

.preview-content {
    padding: 20px;
}

.preview-line {
    height: 8px;
    background: #cbd5e0;
    margin-bottom: 10px;
    border-radius: 4px;
}

.preview-line.short { width: 60%; }
.preview-line.medium { width: 80%; }
.preview-line.long { width: 100%; }

/* Modern template preview */
.template-preview.modern .preview-header { 
    background: linear-gradient(90deg, #1e3c72, #2a5298); 
}
.template-preview.modern .preview-line { 
    background: #a3bffa; 
}

/* Creative template preview */
.template-preview.creative .preview-header { 
    background: linear-gradient(90deg, #667eea, #764ba2); 
}
.template-preview.creative .preview-line { 
    background: #fbb6ce; 
}

/* Tabular template preview */
.template-preview.tabular {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    padding: 10px;
    background: #f8f9fa;
}

.template-preview.tabular .preview-header {
    display: none;
}

.template-preview.tabular .preview-content {
    padding: 0;
    display: contents;
}

.template-preview.tabular .grid-cell {
    background: #e2e8f0;
    border-radius: 3px;
}

.template-preview.tabular .grid-cell:nth-child(odd) {
    background: #4a5568;
}

.template-preview.tabular .grid-cell.header-cell {
    background: #2d3748;
}

.template-preview.tabular .grid-cell.content-cell {
    background: #f7fafc;
}

/* ================= GRADE SYSTEM ================= */
.grade-input {
    transition: all 0.3s ease;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grade-range {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 5px;
    font-style: italic;
    padding-left: 5px;
}

.grade-system:not([value=""]):not([value="none"]) + .grade-input {
    display: block !important;
}

/* ================= PHOTO UPLOAD ================= */
.photo-upload-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-top: 10px;
    flex-wrap: wrap;
}

.photo-preview {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 3px dashed #cbd5e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8fafc;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
}

.photo-preview:hover {
    border-color: #667eea;
    transform: scale(1.02);
}

.preview-placeholder {
    text-align: center;
    color: #a0aec0;
}

.preview-placeholder i {
    font-size: 60px;
    display: block;
    margin-bottom: 10px;
    color: #cbd5e0;
}

.preview-placeholder span {
    font-size: 0.9rem;
    display: block;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-preview:hover img {
    transform: scale(1.05);
}

.photo-upload-controls {
    flex: 1;
    min-width: 300px;
}

.file-input {
    display: none;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 30px;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
}

.btn-upload:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c6cb0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
}

.btn-remove-photo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 30px;
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    margin-left: 15px;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(252, 129, 129, 0.3);
}

.btn-remove-photo:hover {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(252, 129, 129, 0.4);
}

.photo-help {
    margin-top: 15px;
    color: #718096;
    font-size: 0.9rem;
    background: #f7fafc;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #4299e1;
}

/* ================= CHECKBOX STYLING ================= */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: normal;
    color: #4a5568;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
    cursor: pointer;
}

/* ================= ENTRY BLOCKS ================= */
.experience-entry,
.education-entry,
.skill-entry {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.experience-entry:hover,
.education-entry:hover,
.skill-entry:hover {
    border-color: #cbd5e0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.experience-entry::before,
.education-entry::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(to bottom, #667eea, #9f7aea);
    border-radius: 15px 0 0 15px;
}

.skill-entry::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(to bottom, #48bb78, #38a169);
    border-radius: 15px 0 0 15px;
}

/* ================= BUTTONS ================= */
button {
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.btn-add,
.btn-remove,
.btn-preview,
.btn-generate,
.btn-upload,
.btn-remove-photo,
.btn-close-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

/* Add Button */
.btn-add {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 14px 30px;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.btn-add:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.btn-add i {
    font-size: 1.1rem;
}

/* Remove Button */
.btn-remove {
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    color: white;
    padding: 12px 25px;
    margin-top: 15px;
    box-shadow: 0 4px 10px rgba(252, 129, 129, 0.3);
}

.btn-remove:hover {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(252, 129, 129, 0.4);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
    flex-wrap: wrap;
}

.btn-preview,
.btn-generate {
    padding: 18px 45px;
    font-size: 1.1rem;
    min-width: 220px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.btn-preview {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.btn-preview:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c6cb0 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(66, 153, 225, 0.4);
}

.btn-generate {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
    color: white;
}

.btn-generate:hover {
    background: linear-gradient(135deg, #805ad5 0%, #6b46c1 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(159, 122, 234, 0.4);
}

/* ================= MODAL ================= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 3% auto;
    padding: 40px;
    border-radius: 20px;
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

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

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 32px;
    cursor: pointer;
    color: #4a5568;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: #f7fafc;
    z-index: 1001;
}

.close-modal:hover {
    color: #e53e3e;
    background: #fed7d7;
    transform: rotate(90deg);
}

.modal-content h2 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-content h2 i {
    color: #667eea;
}

.preview-note {
    background: #e3f2fd;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #0d47a1;
    margin: 15px 0 25px;
    border-left: 5px solid #2196f3;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.preview-note i {
    color: #2196f3;
    font-size: 1.2rem;
    margin-top: 2px;
}

/* ================= RESUME PREVIEW ================= */
.resume-preview {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-top: 20px;
    max-height: 65vh;
    overflow-y: auto;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
    border: 2px solid #e2e8f0;
}

.preview-container {
    transform: scale(0.95);
    transform-origin: top center;
    width: 100%;
    max-width: 8.5in;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

/* Scrollbar styling for preview */
.resume-preview::-webkit-scrollbar {
    width: 10px;
}

.resume-preview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.resume-preview::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #667eea, #9f7aea);
    border-radius: 5px;
}

.resume-preview::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #5a67d8, #805ad5);
}

/* Preview Actions */
.preview-actions {
    display: flex;
    justify-content: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eaeaea;
}

.btn-close-preview {
    padding: 12px 35px;
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-close-preview:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* ================= TEMPLATE SPECIFIC PREVIEW STYLES ================= */
.modern-preview,
.creative-preview,
.tabular-preview,
.professional-preview {
    padding: 15px;
    border-radius: 10px;
    background: #f8f9fa;
}

.modern-resume,
.creative-resume,
.tabular-resume,
.professional-resume {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Modern Template Preview */
.modern-sidebar {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 25px;
}

.modern-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    margin: 0 auto 20px;
}

/* Creative Template Preview */
.creative-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    color: white;
}

.creative-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 6px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

/* Tabular Template Preview */
.tabular-resume {
    border: 2px solid #2c3e50;
    border-collapse: collapse;
}

.header-row {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
}

.sidebar-cell {
    background: #f8f9fa;
    border-right: 2px solid #e0e0e0;
}

/* ================= LOADING ANIMATION ================= */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================= FOOTER ================= */
.footer {
    text-align: center;
    color: white;
    padding: 30px 20px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.disclaimer {
    margin-top: 10px;
    font-size: 0.8rem;
    opacity: 0.7;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 1200px) {
    .container {
        max-width: 95%;
    }
}

@media (max-width: 992px) {
    .header h1 {
        font-size: 2.4rem;
    }
    
    .resume-builder {
        padding: 30px;
    }
    
    .form-section h2 {
        font-size: 1.6rem;
    }
    
    .template-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .photo-upload-container {
        flex-direction: column;
    }
    
    .photo-preview {
        margin: 0 auto;
    }
    
    .photo-upload-controls {
        min-width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .header {
        padding: 30px 15px;
        margin-bottom: 30px;
    }
    
    .header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .resume-builder {
        padding: 25px;
        margin-bottom: 30px;
    }
    
    .form-section {
        margin-bottom: 40px;
        padding-bottom: 25px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .template-options {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 15px;
        margin-top: 40px;
        padding-top: 25px;
    }
    
    .btn-preview,
    .btn-generate {
        width: 100%;
        padding: 16px 30px;
        min-width: auto;
    }
    
    .modal-content {
        padding: 25px;
        margin: 2% auto;
        width: 98%;
    }
    
    .modal-content h2 {
        font-size: 1.6rem;
    }
    
    .resume-preview {
  