/* --- Base Styles --- */
body { font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif; font-size: 9pt; line-height: 1.25; margin: 0; padding: 15px; background-color: white; color: #2c3e50; transition: background-color 0.3s ease, color 0.3s ease; }
#resume-container { max-width: 8.5in; margin: 0 auto; }
.header { display: flex; align-items: center; gap: 20px; margin-bottom: 12px; background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); padding: 18px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); position: relative; text-align: left; transition: background 0.3s ease; }
.header::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #007bff, #28a745, #17a2b8); border-radius: 8px 8px 0 0; }
.profile-pic { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 3px solid #dee2e6; box-shadow: 0 2px 6px rgba(0,0,0,0.15); flex-shrink: 0; transition: border-color 0.3s ease; }
.no-image .profile-pic { display: none !important; }
.no-image .header { display: block; text-align: center; }
.no-image .header-content { text-align: center; }
.header-content { flex: 1; }
.name { font-size: 20pt; font-weight: 700; margin-bottom: 8px; color: #1a202c; letter-spacing: 0.5px; transition: color 0.3s ease; }
.title { font-size: 13pt; margin-bottom: 12px; color: #4a5568; font-weight: 500; transition: color 0.3s ease; }
.contact-info { font-size: 9pt; line-height: 1.4; color: #6c757d; transition: color 0.3s ease; }
.contact-info a { color: #007bff; transition: color 0.2s ease; }
.contact-info a:hover { color: #0056b3; }
.section { margin-bottom: 12px; background-color: #fdfdfd; padding: 12px; border-radius: 8px; border-left: 4px solid #e9ecef; box-shadow: 0 1px 3px rgba(0,0,0,0.03); transition: box-shadow 0.2s ease, background-color 0.3s ease, border-left-color 0.3s ease; }
.section:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.section-title { font-size: 13pt; font-weight: 700; text-transform: uppercase; margin-bottom: 12px; color: #2c3e50; letter-spacing: 1px; position: relative; padding-bottom: 6px; transition: color 0.3s ease; }
.section-title::after { content: ''; position: absolute; bottom: 0; left: 0; width: 40px; height: 2px; background: linear-gradient(90deg, #007bff, #28a745); }
.summary-text { font-size: 10.5pt; line-height: 1.5; color: #4a5568; margin: 0; transition: color 0.3s ease; }
.job, .project, .education-item, .skill-category { page-break-inside: avoid; }
.job { margin-bottom: 10px; padding: 10px; background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%); border-radius: 6px; border-left: 3px solid #dee2e6; transition: all 0.2s ease; }
.job:hover { border-left-color: #007bff; transform: translateX(2px); }
.job-header { font-weight: 600; margin-bottom: 4px; }
.company { font-size: 11pt; color: #2c3e50; transition: color 0.3s ease; }
.job-details { font-size: 9pt; color: #6c757d; margin-bottom: 8px; font-style: italic; transition: color 0.3s ease; }
.achievements { margin-left: 0; padding-left: 0; }
.achievements li { margin-bottom: 2px; list-style-type: none; margin-left: 0; font-size: 9pt; position: relative; padding-left: 15px; color: #4a5568; transition: color 0.3s ease; }
.achievements li::before { content: '▸'; position: absolute; left: 0; color: #007bff; font-weight: bold; transition: color 0.3s ease; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); padding: 16px; border-radius: 8px; border: 1px solid #dee2e6; transition: background 0.3s ease, border-color 0.3s ease; }
.skill-category { background-color: white; padding: 12px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); transition: background-color 0.3s ease; }
.skill-category-title { font-weight: 600; margin-bottom: 6px; font-size: 10pt; color: #2c3e50; border-bottom: 1px solid #e9ecef; padding-bottom: 4px; transition: color 0.3s ease, border-bottom-color 0.3s ease; }
.skill-category-content { font-size: 9.5pt; color: #4a5568; line-height: 1.4; transition: color 0.3s ease; }
.project { margin-bottom: 8px; padding: 10px; background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%); border-radius: 6px; border-left: 3px solid #28a745; font-size: 9pt; transition: all 0.2s ease; }
.project:hover { border-left-color: #20c997; transform: translateX(2px); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.project-name { font-weight: 600; color: #2c3e50; transition: color 0.3s ease; }
.project-description { color: #4a5568; margin-top: 2px; transition: color 0.3s ease; }
.education-item { margin-bottom: 8px; font-size: 10pt; padding: 10px; background-color: #f8f9fa; border-radius: 6px; border-left: 2px solid #6c757d; transition: background-color 0.3s ease, border-left-color 0.3s ease; }
.degree { font-weight: 600; color: #2c3e50; transition: color 0.3s ease; }
.institution { color: #6c757d; font-size: 9pt; margin-top: 2px; transition: color 0.3s ease; }
a { color: inherit; text-decoration: none; transition: all 0.2s ease; }
a:hover { text-decoration: underline; }
.project-name a { color: inherit; font-weight: 600; }
.project-name a:hover { color: #007bff; }
.qr-code { position: absolute; top: 50%; right: 15px; transform: translateY(-50%); text-align: center; width: 90px; }
.qr-code img { width: 80px; height: 80px; border-radius: 6px; border: 1px solid #ddd; box-shadow: 0 2px 6px rgba(0,0,0,0.1); transition: border-color 0.3s ease; }
.qr-label { font-size: 8pt; color: #6c757d; margin-top: 4px; text-align: center; transition: color 0.3s ease; }
.whatsapp-float { position: fixed; width: 55px; height: 55px; bottom: 20px; right: 20px; background-color: rgba(255, 255, 255, 0.8); border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.25); z-index: 999; backdrop-filter: blur(6px); transition: transform 0.3s ease, background-color 0.3s ease; }
.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-float img { width: 28px; height: 28px; }
.fab-container { position: fixed; bottom: 95px; right: 20px; z-index: 1000; }
.fab { width: 56px; height: 56px; border-radius: 50%;  background-color: rgba(255, 255, 255, 0.9);  color: #343a40; border: none; box-shadow: 0 4px 8px rgba(0,0,0,0.2); font-size: 24px; cursor: pointer; transition: transform 0.2s ease, background-color 0.2s ease; display: flex; align-items: center; justify-content: center; }
.fab:hover { background-color: #eef2f7; }
.fab-container.active .fab { transform: rotate(45deg); }
.fab-menu { position: absolute; bottom: 65px; right: 4px; display: flex; flex-direction: column; gap: 10px; align-items: center; transform: scale(0); transform-origin: bottom right; transition: transform 0.2s ease; }
.fab-container.active .fab-menu { transform: scale(1); }
.fab-option { width: 48px; height: 48px; border-radius: 50%; background-color: #f8f9fa; color: #343a40; border: 1px solid #ddd; box-shadow: 0 2px 5px rgba(0,0,0,0.15); font-size: 20px; cursor: pointer; transition: background-color 0.2s ease, transform 0.2s ease; display: flex; align-items: center; justify-content: center; }
.fab-option:hover { background-color: #e9ecef; transform: scale(1.1); }
.qr-hidden .qr-code { display: none !important; }
.pdf-generating .fab-container, .pdf-generating .whatsapp-float { display: none !important; }
.section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Dark Mode Styles --- */
body.dark-mode { background-color: #1a202c; color: #e2e8f0; }
body.dark-mode .header { background: linear-gradient(135deg, #2d3748 0%, #1f2937 100%); box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
body.dark-mode .profile-pic { border-color: #4a5568; }
body.dark-mode .name { color: #edf2f7; }
body.dark-mode .title { color: #a0aec0; }
body.dark-mode .contact-info { color: #718096; }
body.dark-mode .contact-info a { color: #63b3ed; }
body.dark-mode .contact-info a:hover { color: #90cdf4; }
body.dark-mode .section { background-color: #2d3748; border-left-color: #4a5568; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
body.dark-mode .section-title { color: #edf2f7; }
body.dark-mode .summary-text { color: #a0aec0; }
body.dark-mode .job, body.dark-mode .project { background: linear-gradient(135deg, #1f2937 0%, #111827 100%); border-left-color: #4a5568; }
body.dark-mode .job:hover { border-left-color: #63b3ed; }
body.dark-mode .project { border-left-color: #38a169; }
body.dark-mode .project:hover { border-left-color: #48bb78; }
body.dark-mode .company, body.dark-mode .project-name, body.dark-mode .degree { color: #e2e8f0; }
body.dark-mode .job-details, body.dark-mode .institution, body.dark-mode .qr-label { color: #718096; }
.achievements li {
    list-style-type: disc; /* Use a standard bullet */
    margin-left: 15px;    /* Indent it a bit */
    padding-left: 5px;
}
.achievements li::before {
    display: none; /* Hide the custom one */
}
body.dark-mode .skills-grid { background: linear-gradient(135deg, #1f2937 0%, #111827 100%); border-color: #4a5568; }
body.dark-mode .skill-category { background-color: #111827; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
body.dark-mode .skill-category-title { color: #e2e8f0; border-bottom-color: #4a5568; }
body.dark-mode .skill-category-content { color: #a0aec0; }
body.dark-mode .education-item { background-color: #1f2937; border-left-color: #718096; }
body.dark-mode .project-name a:hover { color: #63b3ed; }
body.dark-mode .qr-code img { border-color: #4a5568; }
body.dark-mode .whatsapp-float { background-color: rgba(40, 40, 40, 0.8); }
body.dark-mode .fab {  background-color: rgba(60, 60, 60, 0.9); color: #e2e8f0; }
body.dark-mode .fab:hover { background-color: rgba(80, 80, 80, 0.9); }
body.dark-mode .fab-option { background-color: #2d3748; color: #e2e8f0; border: 1px solid #4a5568; }
body.dark-mode .fab-option:hover { background-color: #4a5568; }


/* --- FINAL & CORRECT PRINT STYLES (@media print) --- */
@media print {
    .fab-container, .whatsapp-float, .visitors-badge { display: none !important; }
    body { padding: 0; margin: 0; font-size: 9pt; line-height: 1.2; background: white !important; color: black !important; box-shadow: none; }
    #resume-container { max-width: 100%; box-shadow: none; }
    a { text-decoration: none !important; color: inherit !important; }
    .header { padding: 12px; margin-bottom: 8px; box-shadow: none !important; border: 1px solid #ddd; background: #fff !important; }
    .section { padding: 8px; margin-bottom: 8px; box-shadow: none !important; border: 1px solid #ddd; page-break-inside: auto; border-left: 1px solid #ddd; background-color: #fff !important; }
    .job, .project, .education-item, .skill-category { page-break-inside: avoid; box-shadow: none; background: #fff !important; }
    .job { margin-bottom: 6px; padding: 6px; }
    .project { margin-bottom: 4px; padding: 6px; }
    .education-item { margin-bottom: 4px; padding: 6px; }
    .skills-grid { padding: 8px; gap: 8px; background: #fff !important; }
    .skill-category { padding: 6px; }
    .achievements li { font-size: 8.5pt; margin-bottom: 1px; }
}

/* --- THE DEFINITIVE PDF GENERATION CLASS --- */
/* This class will be added to the body temporarily by the script */
body.pdf-view {
    padding: 0; /* Remove default padding for full control */
    margin: 0;
}
body.pdf-view #resume-container {
    max-width: 8.5in; /* Ensure the container is the full width of the paper */
    box-shadow: none;
    margin: 0.20;
    padding: 0;
    border: none;
}
/* Apply all compact print styles */
body.pdf-view .header { padding: 12px; margin-bottom: 8px; border: 1px solid #ddd; background: #fff !important; }
body.pdf-view .section { padding: 8px; margin-bottom: 8px; border: 1px solid #ddd; border-left: 1px solid #ddd; background-color: #fff !important; }
body.pdf-view .job { margin-bottom: 6px; padding: 6px; background: #fff !important; }
body.pdf-view .project { margin-bottom: 4px; padding: 6px; background: #fff !important; }
body.pdf-view .education-item { margin-bottom: 4px; padding: 6px; background: #fff !important; }
body.pdf-view .skills-grid { padding: 8px; gap: 8px; background: #fff !important; }
body.pdf-view .skill-category { padding: 6px; background: #fff !important; }
body.pdf-view .achievements li { font-size: 8.5pt; }
body.pdf-view a { color: inherit !important; }

/* --- Mobile Responsive Styles --- */
@media (max-width: 600px) {
    body {
        padding: 10px; /* Reduce body padding on small screens */
    }

    .header {
        flex-direction: column; /* Stack items vertically */
        text-align: center;     /* Center-align all text content */
        gap: 15px;              /* Add space between stacked items */
    }

    .header-content {
        text-align: center; /* Ensure the inner content is centered too */
    }

    .qr-code {
        position: static; /* IMPORTANT: Take QR code out of absolute positioning */
        transform: none;    /* Reset its vertical alignment */
        margin-top: 10px;   /* Add some space above the QR code */
        width: auto;        /* Let it size naturally */
    }

    .whatsapp-float {
        bottom: 15px;
        right: 15px;
    }
    .fab-container {
        bottom: 85px;
        right: 15px;
    }
}