:root {
    --doc-bg: #ffffff;
    --doc-text: #1e293b;
    --doc-accent: #8b5cf6;
    --doc-muted: #64748b;
    --doc-border: #e2e8f0;
    --doc-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

@media print {
    @page {
        margin: 15mm;
    }

    body {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .doc-container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .doc-page {
        box-shadow: none !important;
        margin: 0 !important;
        border: NONE !important;
        width: 100% !important;
        padding: 10mm !important;
        max-width: 100% !important;
        overflow: visible !important;
        float: none !important;
        display: block !important;
    }

    .no-print {
        display: none !important;
    }

    p,
    li,
    h1,
    h2,
    h3,
    div,
    span {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100% !important;
    }

    .doc-header {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .doc-meta {
        text-align: left !important;
        min-width: 200px !important;
    }

    h1,
    h2,
    h3 {
        page-break-after: avoid;
    }

    p,
    li {
        page-break-inside: avoid;
    }

    table {
        table-layout: auto !important;
        width: 100% !important;
        border-collapse: collapse !important;
    }

    td,
    th {
        word-wrap: break-word;
        white-space: normal !important;
        padding: 8px !important;
    }

    .highlight-box {
        padding: 15mm !important;
        margin: 10mm 0 !important;
    }
}

body {
    background-color: #f8fafc;
    color: var(--doc-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    padding: 4rem 1rem;
    margin: 0;
}

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

.doc-page {
    background: var(--doc-bg);
    border: 1px solid var(--doc-border);
    box-shadow: var(--doc-shadow);
    padding: 5rem;
    border-radius: 12px;
    position: relative;
}

.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid var(--doc-accent);
    padding-bottom: 2rem;
    margin-bottom: 4rem;
}

.doc-logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    color: #0f172a;
}

.doc-meta {
    font-size: 0.85rem;
    text-align: right;
    color: var(--doc-muted);
}

.doc-meta b {
    color: var(--doc-text);
}

/* Typography */
h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    margin-bottom: 2rem;
    letter-spacing: -2px;
    color: #0f172a;
    line-height: 1.1;
}

h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    margin-top: 4.5rem;
    margin-bottom: 1.5rem;
    color: #1e293b;
    border-bottom: 1px solid var(--doc-border);
    padding-bottom: 0.5rem;
}

h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--doc-accent);
}

p,
li {
    margin-bottom: 1.4rem;
    font-size: 1.1rem;
    color: #334155;
    text-align: justify;
}

ul,
ol {
    padding-left: 2rem;
    margin-bottom: 3rem;
}

li {
    margin-bottom: 1rem;
}

.highlight-box {
    background: #fdfcff;
    border: 1px solid #e9e2ff;
    padding: 2.5rem;
    border-radius: 20px;
    margin: 4rem 0;
    position: relative;
    font-style: italic;
    font-size: 1.15rem;
}

.highlight-box::before {
    content: "“";
    position: absolute;
    top: -20px;
    left: 20px;
    font-size: 5rem;
    color: var(--doc-accent);
    opacity: 0.2;
    font-family: serif;
}

/* Legal Footer */
.doc-footer-legal {
    margin-top: 8rem;
    border-top: 1px solid var(--doc-border);
    padding-top: 2.5rem;
    font-size: 0.8rem;
    color: var(--doc-muted);
    line-height: 1.5;
}

.doc-footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.doc-footer-content p {
    margin: 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--doc-muted);
}

.doc-pagination {
    margin-top: 1.5rem;
    text-align: center;
    font-weight: 600;
    color: var(--doc-text);
}

/* Indicators Removal */
.qualiopi-indicator,
.indicator-tag {
    display: none !important;
}

.print-btn {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    background: #0f172a;
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 100px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
}

.print-btn:hover {
    transform: translateY(-5px);
    background: var(--doc-accent);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 3rem 0;
    font-size: 1rem;
}

th,
td {
    border: 1px solid var(--doc-border);
    padding: 1.2rem;
    text-align: left;
}

th {
    background: #f8fafc;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* CV specific */
.cv-header {
    display: flex;
    gap: 4rem;
    align-items: center;
    margin-bottom: 5rem;
}

.cv-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.25), 0 0 0 2px rgba(139, 92, 246, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    float: right;
    margin: 0 0 1.5rem 2rem;
    shape-outside: circle(50%);
}
.cv-photo:hover {
    transform: scale(1.04);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.35), 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.cv-badge {
  display: inline-block;
  padding: 6px 16px;
  margin-bottom: 0.8rem;
  border-radius: 99px;
  background: white;
  color: var(--primary-color);
  font-weight: 600;
  letter-spacing: -0.01em;
  
  /* The "Premium" touches */
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05), 
              0 1px 2px rgba(0, 0, 0, 0.03);
  
  /* Smooth Animation */
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 140px; /* Prevents the layout from jumping */
  text-align: center;
}

/* Utility Classes for Dense Technical Lessons */
.ld-util-subtitle {
    font-size: 1.4rem;
    color: var(--doc-muted);
    margin-bottom: 2rem;
    font-style: italic;
}

.ld-util-badges {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.ld-util-badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ld-util-badge-level {
    background: #fee2e2;
    color: #991b1b;
}

.ld-util-badge-time {
    background: #fef9c3;
    color: #854d0e;
}

.ld-util-badge-tech {
    background: #dcfce7;
    color: #166534;
}

.ld-util-box {
    padding: 2rem;
    border-radius: 12px;
    margin: 2.5rem 0;
    border-left: 6px solid;
}

.ld-util-box-tip {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

.ld-util-box-warn {
    background: #fff1f2;
    border-color: #f43f5e;
    color: #9f1239;
}

.ld-util-box-grow {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.ld-util-code-window {
    background: #0f172a;
    border-radius: 12px;
    margin: 2rem 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.ld-code-header {
    background: #1e293b;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
}

.ld-code-body {
    padding: 1.5rem;
    margin: 0;
    overflow-x: auto;
}

.ld-code-body pre {
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Syntax Highlighting */
.syn-k {
    color: #c678dd !important;
    font-weight: 600;
}

/* Keyword */
.syn-s {
    color: #98c379 !important;
}

/* String */
.syn-c {
    color: #5c6370 !important;
    font-style: italic;
}

/* Comment */
.syn-f {
    color: #61afef !important;
}

/* Function */
.syn-n {
    color: #d19a66 !important;
}

/* Number */

.ld-util-table-container {
    overflow-x: auto;
    margin: 3rem 0;
}

.ld-util-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--doc-border);
}

.ld-util-table th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--doc-border);
}

.ld-util-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--doc-border);
}

.ld-util-svg-container {
    background: #f8fafc;
    border: 1px solid var(--doc-border);
    border-radius: 12px;
    padding: 2rem;
    margin: 2.5rem 0;
    display: flex;
    justify-content: center;
}

.ld-util-svg-container svg {
    max-width: 100%;
    height: auto;
}

.ld-code-body pre {
    color: #e2e8f0;
}