/* Styling for the professional image */
.rounded-circle {
    border: 5px solid rgba(255, 255, 255, 0.8); /* A nice border for separation */
}

/* Ensure the hero section is centered if it wasn't already */
#hero {
    min-height: 100vh; /* Make the hero section full viewport height */
    background: #f8f9fa; /* Light background color or an image */
    color: #333; /* Dark text for contrast */
    padding-top: 100px; /* Space for the fixed navbar */
    text-align: center; /* Center the content inside the hero */
}

/* Define a professional color palette */
:root {
    --primary-dark: #2c3e50; /* Deep Charcoal */
    --secondary-gray: #7f8c8d; /* Muted Gray */
    --accent-teal: #1abc9c; /* Muted Teal */
    --light-bg: #ecf0f1; /* Light Gray Background */
    --card-bg: #ffffff; /* White Card Background */
    --text-color: #34495e; /* Darker text for readability */
    --border-color: #bdc3c7; /* Light border for subtle separation */
    --shadow-light: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Roboto', sans-serif; /* A clean, professional font */
    background-color: var(--light-bg);
    color: var(--text-color);
    padding-top: 70px; /* Space for fixed navbar */
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-dark);
    font-weight: 600;
}

/* Navbar Styling */
.navbar {
    box-shadow: var(--shadow-light);
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}
.navbar-brand {
    font-weight: 700;
    color: var(--primary-dark) !important;
    font-size: 1.5rem;
}
.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}
.nav-link:hover {
    color: var(--accent-teal) !important;
    transform: translateY(-2px);
}
.navbar-toggler {
    border-color: var(--border-color);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2844, 62, 80, 0.7%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Hero Section */
#hero {
    background: linear-gradient(135deg, var(--primary-dark), #34495e);
    color: var(--light-bg);
    padding: 100px 0;
    text-align: center;
    margin-bottom: 60px;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}
#hero::before { /* Subtle background pattern */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.2;
}
#hero h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--light-bg);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
#hero p.lead {
    font-size: 1.6rem;
    max-width: 900px;
    margin: 0 auto;
    opacity: 0.9;
}

/* QR Code Styling (Screen) */
.qr-code-box img {
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    width: 100px; /* Keep it subtle on screen */
    height: 100px;
}

.qr-code-box:hover img {
    transform: scale(1.1); /* Zoom effect on hover */
}

/* Section Heading */
.section-heading {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 50px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}
.section-heading::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100px;
    height: 5px;
    background-color: var(--accent-teal);
    border-radius: 3px;
}

/* Card Styling */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--card-bg);
}
.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
}
.card-header {
    background-color: var(--primary-dark);
    color: var(--light-bg);
    font-weight: 600;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    padding: 1.2rem 1.8rem;
    font-size: 1.2rem;
}
.card-body {
    padding: 1.8rem;
}

/* Contact Info */
#contact .list-unstyled li {
    margin-bottom: 18px;
    font-size: 1.15rem;
}
#contact .list-unstyled li i {
    color: var(--accent-teal);
    width: 35px;
    text-align: center;
    font-size: 1.3rem;
}
#contact .list-unstyled li a {
    color: var(--text-color);
    transition: color 0.3s ease;
}
#contact .list-unstyled li a:hover {
    color: var(--accent-teal);
    text-decoration: underline;
}

/* Skills Section */
.skill-badge {
    background-color: var(--secondary-gray);
    color: var(--light-bg);
    padding: 0.7em 1.4em;
    margin: 7px;
    border-radius: 0.75rem;
    font-size: 1rem;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-weight: 500;
}
.skill-badge:hover {
    background-color: var(--accent-teal);
    transform: scale(1.05);
}

/* Experience Timeline */
.timeline {
    position: relative;
    padding: 30px 0;
    list-style: none;
}
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background-color: var(--border-color);
    margin-left: -2px;
}
.timeline-item {
    margin-bottom: 40px;
    position: relative;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-item-content {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 1rem;
    box-shadow: var(--shadow-light);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.timeline-item-content:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
}
.timeline-item-content::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    top: 25px;
}
.timeline-item-left .timeline-item-content {
    margin-right: 55%;
}
.timeline-item-left .timeline-item-content::before {
    border-width: 12px 0 12px 12px;
    border-color: transparent transparent transparent var(--card-bg);
    right: -12px;
}
.timeline-item-right .timeline-item-content {
    margin-left: 55%;
}
.timeline-item-right .timeline-item-content::before {
    border-width: 12px 12px 12px 0;
    border-color: transparent var(--card-bg) transparent transparent;
    left: -12px;
}
.timeline-item-dot {
    position: absolute;
    top: 30px;
    left: 50%;
    width: 24px;
    height: 24px;
    background-color: var(--accent-teal);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 1;
    border: 4px solid var(--light-bg);
    box-shadow: 0 0 0 2px var(--accent-teal);
}
.timeline-item h5 {
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.3rem;
}
.timeline-item .text-muted {
    font-size: 0.95rem;
    margin-bottom: 12px;
}
.timeline-item ul {
    list-style-type: disc;
    padding-left: 25px;
    margin-top: 15px;
    font-size: 1rem;
    color: var(--text-color);
}
.timeline-item ul li {
    margin-bottom: 8px;
}

/* Responsive Adjustments for Timeline */
@media (max-width: 991.98px) {
    .timeline::before {
        left: 20px; /* Move timeline line to left */
    }
    .timeline-item-dot {
        left: 20px; /* Move dots to left */
        transform: translateX(-50%);
    }
    .timeline-item-left .timeline-item-content,
    .timeline-item-right .timeline-item-content {
        margin-left: 50px; /* All content on right of line */
        margin-right: 0;
    }
    .timeline-item-left .timeline-item-content::before,
    .timeline-item-right .timeline-item-content::before {
        border-width: 12px 12px 12px 0;
        border-color: transparent var(--card-bg) transparent transparent;
        left: -12px;
        right: auto;
    }
}

/* Education & Certifications */
#education .card-body h5, #certifications .card-body h5 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}
#certifications .list-unstyled li {
    font-size: 1.05rem;
    margin-bottom: 10px;
}
#certifications .list-unstyled li i {
    color: var(--accent-teal);
    font-size: 1.1rem;
}

/* Footer Styling */
footer {
    background-color: var(--primary-dark);
    color: var(--light-bg);
    padding: 35px 0;
    margin-top: 60px;
    text-align: center;
    box-shadow: var(--shadow-light);
}
footer p {
    margin-bottom: 0;
    font-size: 0.95rem;
    opacity: 0.8;
}

/* =========================================
   PRINT STYLESHEET (For PDF Generation)
   ========================================= */
@media print {
    /* 1. Page Setup */
    @page {
        margin: 0.5cm;
        size: A4;
    }

    body {
        background-color: #fff;
        color: #000;
        padding-top: 0 !important;
        font-size: 11pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 2. Hide Non-Essential Elements */
    .navbar, footer, .btn, .navbar-toggler {
        display: none !important;
    }

    /* 3. Hero Section Transformation */
    #hero {
        min-height: auto !important;
        padding: 20px 0 20px 0 !important;
        margin-bottom: 20px !important;
        box-shadow: none !important;
        background: none !important;
        color: #333 !important;
        text-align: left;
        border-bottom: 2px solid var(--primary-dark);
        /* Ensure space for the floating QR code */
        padding-right: 120px !important; 
    }

    #hero h1 {
        color: var(--primary-dark) !important;
        font-size: 2.5rem !important;
        text-shadow: none !important;
        margin-bottom: 5px;
        text-align: left; /* Align header left */
    }
    
    #hero .lead {
        font-size: 1rem !important;
        color: #333 !important;
        opacity: 1;
        text-align: left;
        margin: 0 !important;
        max-width: 100% !important;
    }

    /* Reduce Image Size */
    #hero img.rounded-circle {
        border-color: #333 !important;
        width: 100px !important;
        height: 100px !important;
        float: left;
        margin-right: 20px;
        margin-bottom: 10px;
    }

    /* PROFESSIONAL QR POSITIONING (TOP RIGHT CORNER) */
    .qr-code-box {
        position: absolute;
        top: 0;
        right: 0;
        text-align: center;
        z-index: 999;
        margin-top: 0 !important;
    }

    .qr-code-box img {
        width: 90px !important;
        height: 90px !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .qr-code-box p {
        color: #000 !important;
        font-size: 8pt !important;
        margin-top: 2px !important;
        opacity: 1 !important;
    }

    /* 4. Layout Adjustments */
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
        background: none !important;
        margin-bottom: 10px !important;
    }

    .card-body {
        padding: 10px 0 !important;
    }

    .section-heading {
        font-size: 1.6rem !important;
        margin-bottom: 15px !important;
        text-align: left !important;
        border-bottom: 1px solid #ccc;
    }
    
    .section-heading::after {
        display: none;
    }

    /* 5. Timeline Flattening (Crucial for Print) */
    .timeline::before {
        left: 0 !important;
    }
    
    .timeline-item-dot {
        left: 0 !important;
        transform: translateX(-50%);
        border-width: 2px !important;
    }

    .timeline-item-content {
        margin-left: 20px !important;
        margin-right: 0 !important;
        box-shadow: none !important;
        padding: 5px 15px !important;
        border-left: 3px solid #eee;
        background: none !important;
    }
    
    .timeline-item-left .timeline-item-content::before,
    .timeline-item-right .timeline-item-content::before {
        display: none;
    }

    /* 6. Skills & Page Breaks */
    .skill-badge {
        background-color: #fff !important;
        color: #000 !important;
        border: 1px solid #333;
        padding: 4px 8px !important;
        margin: 2px !important;
        font-size: 0.85rem;
    }

    h2, h3, h5, h6, .timeline-item { 
        page-break-after: avoid; 
        break-after: avoid; 
    }
    
    img, .card, li { 
        page-break-inside: avoid; 
        break-inside: avoid; 
    }

    a {
        text-decoration: none !important;
        color: #000 !important;
    }
}