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

body {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-family: 'Segoe UI', 'Times New Roman', Georgia, serif;
    padding: 15px;
}

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

/* Header with Stats */
.site-header {
    background: linear-gradient(135deg, #ffffff 0%, #fef9e6 100%);
    padding: 25px 30px;
    margin-bottom: 25px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #166534;
    padding: 8px 18px;
    border-radius: 40px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.back-home:hover {
    background: #0f4a2a;
    transform: translateX(-3px);
}

.stats-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-card {
    background: white;
    padding: 8px 18px;
    border-radius: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.stat-number {
    font-weight: bold;
    color: #166534;
    font-size: 1.1rem;
}

.site-header h1 {
    font-size: 1.8rem;
    color: #1e293b;
    margin-bottom: 8px;
}

.site-header p {
    color: #475569;
    font-size: 0.9rem;
}

/* Customer Reviews Section */
.reviews-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #bbf7d0;
}

.reviews-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.reviews-header h3 {
    color: #166534;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-badge {
    background: #fbbf24;
    color: #78350f;
    padding: 5px 12px;
    border-radius: 40px;
    font-weight: bold;
    font-size: 0.85rem;
}

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

.review-card {
    background: white;
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.review-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.review-stars {
    color: #fbbf24;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.review-text {
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 10px;
    line-height: 1.4;
}

.review-author {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

/* Two Column Layout */
.two-columns {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

@media (min-width: 1024px) {
    .two-columns {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* LEFT SIDE - FORM PANEL */
.form-panel {
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

@media (min-width: 1024px) {
    .form-panel {
        flex: 1;
        min-width: 400px;
        max-height: 85vh;
        overflow-y: auto;
        position: sticky;
        top: 20px;
    }
}

.form-section {
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    background: #fefefe;
    transition: all 0.2s;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #166534;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.drag-handle {
    cursor: move;
    color: #94a3b8;
    font-size: 1.2rem;
}

.section-name-input {
    font-size: 1rem;
    font-weight: bold;
    border: 1px solid #cbd5e1;
    background: white;
    padding: 6px 10px;
    border-radius: 6px;
    width: 100%;
    max-width: 200px;
}

.section-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.move-up-btn,
.move-down-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
}

.move-up-btn:disabled,
.move-down-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.remove-section-btn,
.add-field-btn-section {
    background: #dc2626;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
}

.add-field-btn-section {
    background: #166534;
}

.field-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 12px;
    background: #f9fafb;
    padding: 10px;
    border-radius: 8px;
}

.field-row .field-content {
    flex: 1;
}

.field-label-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    background: white;
}

.field-value-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.8rem;
}

.remove-field-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
    margin-top: 28px;
}

.btn-sm {
    background: #166534;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    margin-top: 8px;
}

.btn-primary {
    background: #166534;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #0f4a2a;
    transform: translateY(-2px);
}

/* RIGHT SIDE - PREVIEW PANEL */
.preview-panel {
    background: #f1f5f9;
    border-radius: 24px;
    padding: 20px;
}

@media (min-width: 1024px) {
    .preview-panel {
        flex: 1.2;
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
}

/* Action Buttons */
.preview-actions {
    background: white;
    border-radius: 60px;
    padding: 12px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Style Controls */
.style-controls {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
}

.style-controls h4 {
    color: #166534;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.style-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
}

.style-row label {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 100px;
}

.style-row select,
.style-row input {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.8rem;
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

#headerColorPicker {
    width: 45px;
    height: 40px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
}

/* A4 Resume Paper */
.resume-paper {
    width: 100%;
    max-width: 210mm;
    min-height: 297mm;
    background: white;
    margin: 0 auto;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    padding: 12mm 10mm;
    line-height: 1.4;
    transition: all 0.3s ease;
}

/* Print Optimization */
@media print {
    body * {
        visibility: hidden;
    }

    .resume-paper,
    .resume-paper * {
        visibility: visible;
    }

    .resume-paper {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 12mm;
        box-shadow: none;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .form-panel,
    .preview-actions,
    .site-header,
    .info-sections,
    .back-home,
    .style-controls,
    .reviews-section,
    footer {
        display: none !important;
    }
}

/* Resume Internal Styles */
.resume-title {
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.resume-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    border-bottom: 2px solid #166534;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.header-left h1 {
    margin-bottom: 8px;
    color: #000;
}

.contact-details p {
    margin: 3px 0;
}

.photo-container {
    width: 90px;
    height: 110px;
    border: 1px solid #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    overflow: hidden;
}

.photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-head {
    padding: 6px 10px;
    font-weight: bold;
    margin: 15px 0 10px 0;
    text-transform: uppercase;
}

.qualification-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
}

.qualification-table th,
.qualification-table td {
    border: 1px solid #000;
    padding: 6px 5px;
    text-align: left;
}

.qualification-table th {
    background: #f0f0f0;
}

.bullet-list {
    margin-left: 25px;
    list-style-type: disc;
}

.two-column {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 8px 0;
}

.col {
    width: 48%;
}

.declaration-text {
    margin-top: 10px;
    text-align: justify;
}

.signature-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 25px;
}

/* Info Sections */
.info-sections {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}

.howto-card,
.faq-card {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.howto-card h3,
.faq-card h3 {
    color: #166534;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

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

.step-item {
    text-align: center;
}

.step-number {
    width: 40px;
    height: 40px;
    background: #166534;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: bold;
}

.faq-item {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 0;
    cursor: pointer;
}

.faq-question {
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    font-size: 0.85rem;
    color: #4b5563;
}

.faq-answer.show {
    max-height: 150px;
    padding-top: 10px;
}

.photo-upload-area {
    border: 2px dashed #166534;
    padding: 15px;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 15px;
    background: #f9fafb;
    transition: all 0.2s;
}

.photo-upload-area:hover {
    background: #f0fdf4;
}

/* Footer */
footer {
    margin-top: 40px;
    background: white;
    border-radius: 20px;
    padding: 25px 30px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.footer-links a {
    color: #166534;
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

.copyright {
    color: #64748b;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .resume-paper {
        transform: scale(0.95);
        transform-origin: top center;
    }

    .preview-actions button {
        font-size: 0.7rem;
        padding: 6px 12px;
    }

    .site-header h1 {
        font-size: 1.4rem;
    }

    .stats-container {
        width: 100%;
        justify-content: center;
    }

    .reviews-grid {
        grid-template-columns: 1fr;
    }
}

/* Hide Personal Details heading in preview */
.personal-details-hidden {
    display: none !important;
}