.badge-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.badge {
  background: #fff !important;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  width: 150px;
  height: 270px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.badge iframe {
  background: #fff !important;
}

meter {
    width: 100%;
    height: 20px;
    background: #ccc;
    border: none;
    color: #000;
}

@media print {
     @page{
        size: A4;
        margin: 0;
     }
     body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 10pt;
        orphans: 3;
        widows: 3;
        background-color: var(--bg-color) !important;
    }
    
    html {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
        background-color: var(--bg-color) !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    section {
        margin: 5px;
        padding: 8px;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        page-break-inside: avoid;
        break-inside: avoid;
        page-break-after: auto;
        break-after: auto;
        background-color: var(--bg-color) !important;
        border-color: var(--border-color) !important;
    }
    
    header {
        margin: 5px;
        padding: 8px;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        page-break-inside: avoid;
        break-inside: avoid;
        background-color: var(--bg-color) !important;
        border-color: var(--border-color) !important;
        color: var(--text-color) !important;
    }
    
    h2 {
        page-break-after: avoid;
        break-after: avoid;
        page-break-inside: avoid;
        break-inside: avoid;
        margin-top: 8px !important;
        margin-bottom: 5px !important;
        padding-bottom: 3px !important;
        font-size: 14pt !important;
        font-weight: bold !important;
    }
    
    h3 {
        page-break-after: avoid;
        break-after: avoid;
        page-break-inside: avoid;
        break-inside: avoid;
        margin-top: 8px !important;
        margin-bottom: 5px !important;
        padding-bottom: 3px !important;
        font-size: 12pt !important;
    }
    
    h2 + *, h3 + * {
        page-break-before: avoid;
        break-before: avoid;
    }
    
    ul {
        page-break-inside: avoid;
        break-inside: avoid;
        margin: 3px 0 !important;
    }
    
    ol {
        page-break-inside: avoid;
        break-inside: avoid;
        margin: 3px 0 !important;
    }
    
    li {
        margin: 2px 0 !important;
        line-height: 1.4 !important;
    }
    
    div {
        page-break-inside: auto;
        break-inside: auto;
    }
    
    /* Keep languages and hobbies sections intact - short sections should stay together */
    section ul.indented {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    
    /* Specifically prevent breaks in Languages and Hobbies sections */
    section:last-of-type,
    section:nth-last-of-type(1),
    section:nth-last-of-type(2) {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        page-break-before: auto;
        break-before: auto;
    }
    
    /* Keep entire last sections together */
    section:last-of-type h2,
    section:last-of-type ul,
    section:nth-last-of-type(2) h2,
    section:nth-last-of-type(2) ul {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
    }
    
    .profile-pic-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .profile-section {
        min-height: 180px;
        margin-bottom: 5px;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    h1 {
        font-size: 1.5em !important;
        margin: 5px 0 !important;
    }
    
    h2 {
        font-size: 1.1em !important;
        margin: 5px 0 !important;
    }
    
    .contact-info {
        margin: 8px 0 !important;
        font-size: 9pt !important;
    }
    
    .indented {
        margin-left: 1.5em;
    }
    
    p {
        margin: 3px 0 !important;
        line-height: 1.4 !important;
    }
    
    .tech-icons {
        margin-left: 1.5em;
        gap: 6px;
    }
    
    .tech-icons img {
        width: 24px;
        height: 24px;
    }
    
    .education-header img {
        width: 50px;
        height: 50px;
    }
    
    /* For work experience - keep job entries together when possible */
    #jobs-container > div {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 12px;
    }
    
    #jobs-container h3 {
        margin-top: 16px;
    }
    
    /* Show certification badges but remove white boxes and frames */
    .badge-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 12px !important;
        page-break-inside: avoid;
        break-inside: avoid;
        background: transparent !important;
    }
    
    .badge {
        width: 130px !important;
        height: 220px !important;
        min-width: 130px !important;
        max-width: 130px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
    }
    
    .badge iframe {
        width: 130px !important;
        height: 220px !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }
    
    /* Ensure the iframe content shows without white background */
    .badge iframe,
    .badge iframe * {
        background: transparent !important;
        background-color: transparent !important;
    }
    
    .no-print {
        display: none !important;
    }
    
    .profile-pic-wrapper,
    .tech-icons img {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        filter: drop-shadow(10px 10px 10px rgba(135, 206, 235, 0.7)) !important;
    }
    
    .education-header {
        margin-bottom: 5px !important;
    }
    
    .education-header strong {
        font-size: 10pt !important;
    }
    
    /* Try to keep header + education on page 1 */
    header + section {
        page-break-before: avoid !important;
        break-before: avoid !important;
    }
    
    .profile-section {
        page-break-inside: avoid;
    }
    
    .badge-grid {
        page-break-inside: avoid;
    }
    
    /* This is overridden by the more specific badge rules above */
}

.print-button {
    padding: 12px 20px;
    font-size: 13px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    background-color: var(--text-color);
    color: var(--bg-color);
    transition: background-color 0.5s ease, color 0.5s ease;
    margin: 5px;
    display: inline-block;
}

@media (min-width: 768px) {
    .print-button {
        padding: 15px 25px;
        font-size: 14px;
        margin: 0 10px;
    }
}

.button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 2em;
}

@media (min-width: 768px) {
    .button-container {
        flex-direction: row;
        justify-content: center;
        gap: 0;
    }
}

:root {
    --bg-color: #e8f5e9;
    --text-color: #1b5e20;
    --border-color: #a5d6a7;
    --hover-color: #2e7d32;
  }

body,
header,
section,
h2,
h3,
ul,
a,
p,
button {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.5s ease, color 0.5s ease;
    line-height: 1.5;
}

html {
    scroll-behavior: smooth;
}

header h1,
header h2 {
    margin: 0;
    padding: 0;
}

header h1 {
    font-size: 1.5em;
    padding-bottom: 0.3em;
}

@media (min-width: 768px) {
    header h1 {
        font-size: 2em;
    }
}

header h2 {
    font-size: 1em;
    padding-bottom: 0.5em;
}

@media (min-width: 768px) {
    header h2 {
        font-size: 1.2em;
    }
}

.contact-info {
    word-break: break-word;
    line-height: 1.8;
}

section {
    border: 1px solid var(--border-color);
    margin: 20px;
    padding: 20px;
    border-radius: 5px;
}

@media (min-width: 768px) {
    section {
        margin: 50px auto;
        padding: 50px;
        max-width: 1200px;
    }
}

h2,
h3 {
    border-bottom: 1px solid;
    padding-bottom: 0.5em;
    margin-bottom: 1em;
    margin-top: 1em;
}

ul {
    list-style-type: none;
    padding: 0;
}

a:hover,
button:hover {
    color: var(--hover-color);
    transition: color 0.3s ease;
}

.profile-section {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 350px;
    margin: 20px auto 30px auto;
}

.profile-pic-wrapper {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    display: block;
    position: relative;
    z-index: 10;
    filter: drop-shadow(10px 10px 10px rgba(135, 206, 235, 0.7));
}

@media (min-width: 768px) {
    .profile-section {
        min-height: 450px;
    }
}

.profile-pic {
    width: 200px;
    height: 200px;
    object-fit: cover;
    object-position: center center;
    transform: translate(-0px, -0px);
}

@media (min-width: 768px) {
    .profile-pic-wrapper {
        width: 250px;
        height: 250px;
        margin-bottom: 20px;
    }
    
    .profile-pic {
        width: 250px;
        height: 250px;
        object-position: center center;
        transform: translate(-0px, -0px);
    }
}

header {
    margin: 20px !important;
}

@media (min-width: 768px) {
    header {
        margin: 50px auto !important;
        max-width: 1200px;
    }
}

.indented {
    margin-left: 2em;
}

@media (min-width: 768px) {
    .indented {
        margin-left: 5em;
    }
}

.tech-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

@media (min-width: 768px) {
    .tech-icons {
        justify-content: flex-start;
        margin-left: 5em;
        max-width: 390px;
    }
}

.tech-icons img {
    width: 30px;
    height: 30px;
    filter: drop-shadow(10px 10px 10px rgba(135, 206, 235, 0.7));
}

.education-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.education-header img {
    width: 60px;
    height: 60px;
}

@media (min-width: 768px) {
    .education-header img {
        width: 100px;
        height: 100px;
    }
}

.ms-transcript {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ms-transcript a {
    word-break: break-all;
}

@media (min-width: 768px) {
    .ms-transcript a {
        word-break: normal;
    }
}

