:root {
    --accent-color: #dc2626;
}
[data-theme="dark"] {
    --accent-color: #ef4444;
}

/* Print Media Queries */
@media print {
    @page {
        size: A4;
        margin: 1cm 1cm 1cm 1cm; /* Top margin increased for 2nd page spacing */
    }
    
    body {
        background-color: white !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 10.5pt !important; /* Increased font size */
        line-height: 1.35 !important; /* Increased line height */
    }
    
    /* Main Layout Structure */
    main {
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
    }
    
    .resume-container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important; /* Removed internal padding, relying on @page margin */
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    /* Spacing Adjustments for 2 Pages */
    .mb-12, .mb-10, .mb-8 {
        margin-bottom: 1.5rem !important; /* Increased margin */
    }
    
    .mb-6, .mb-4 {
        margin-bottom: 0.75rem !important; /* Increased margin */
    }

    .space-y-10 > :not([hidden]) ~ :not([hidden]) {
        margin-top: 1.5rem !important; /* Increased job separation */
    }

    /* Force Grid Layouts (2 Columns) */
    .grid, .grid-cols-1 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    /* Header Layout */
    header.flex-col {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        margin-bottom: 1.5rem !important; /* Increased margin */
        padding-bottom: 1rem !important; /* Increased padding */
        border-bottom: 2px solid #e5e7eb !important;
    }
    
    /* Typography Scaling */
    h1 { 
        font-size: 24pt !important; /* Increased size */
        line-height: 1.2 !important; 
        margin-bottom: 0.5rem !important; 
        color: #000 !important;
    }
    
    h2 { 
        font-size: 14pt !important; /* Increased size */
        margin-bottom: 0.5rem !important; 
        color: #dc2626 !important; 
    }
    
    h3 { 
        font-size: 12pt !important; /* Increased size */
        margin-top: 1rem !important; 
        margin-bottom: 0.5rem !important; 
        color: #374151 !important;
        break-after: avoid !important;
    }
    
    h4 { 
        font-size: 11pt !important; /* Increased size */
        margin-bottom: 0.25rem !important; 
        color: #000 !important;
    }
    
    p, li { 
        margin-bottom: 0.25rem !important; 
        color: #1f2937 !important;
    }
    
    ul {
        margin-left: 0 !important;
        padding-left: 1.5rem !important;
        list-style-position: outside !important;
    }
    
    li {
        padding-left: 0.5rem !important;
    }
    
    li::marker {
        color: #000 !important;
        font-size: 1.1em !important;
    }
    
    /* Timeline & Borders */
    .border-l, .border-l-2 {
        border-left-width: 2px !important;
        border-color: #e5e7eb !important;
        margin-left: 2rem !important; /* Move timeline right */
        padding-left: 2.5rem !important; /* More space between line and text */
    }
    
    /* Fix Timeline Dot Position */
    .absolute.-left-\[41px\] {
        left: -2.35rem !important;
        width: 0.85rem !important;
        height: 0.85rem !important;
        top: 0.25rem !important;
        background-color: white !important;
        border: 2px solid #dc2626 !important;
    }

    /* Project Cards */
    .bg-card-light, .dark\:bg-card-dark {
        background-color: #f3f4f6 !important; /* Restore light gray background */
        border: 1px solid #e5e7eb !important;
        border-radius: 8px !important;
        break-inside: avoid !important;
        padding: 0.5rem !important;
        margin-bottom: 0.5rem !important;
        box-shadow: none !important;
    }
    
    /* Tags in Projects */
    .bg-card-light .flex-wrap {
        margin-bottom: 0.25rem !important;
        gap: 0.25rem !important;
    }
    
    .bg-card-light span {
        padding: 0.1rem 0.5rem !important;
        font-size: 9pt !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 4px !important;
    }

    /* Hide decorative/interactive elements */
    .no-print, 
    #theme-toggle, 
    button, 
    nav, 
    .fixed, 
    .absolute.top-0.left-0.w-full.h-1 {
        display: none !important;
    }
    
    /* Force Light Theme Colors */
    :root {
        --accent-color: #dc2626 !important;
        --text-color: #000000 !important;
        --text-muted: #374151 !important;
        --border-color: #e5e7eb !important;
    }
    
    /* Text Colors overrides */
    /* Remove force black to allow theme colors */
    /* * { color: black !important; } */
    .text-accent, .text-accent-dark { color: #dc2626 !important; }
    .text-muted-light, .text-muted-dark { color: #374151 !important; }
    
    /* Links */
    a { text-decoration: none !important; color: #111 !important; }
    a[href^="http"]:after { content: none !important; }
    
    /* QR Code - Increased Size */
    .qr-code {
        display: block !important;
    }
    .qr-code img {
        width: 140px !important; /* Increased to match screen size */
        height: auto !important;
        max-width: 187px !important;
    }
    
    /* Ensure page breaks avoid breaking inside important elements */
    .break-inside-avoid, .group {
        break-inside: avoid !important;
    }

    /* Allow job entries to break to fill page 1 */
    .space-y-10 > div {
        break-inside: auto !important;
    }
    
    /* Allow sections to break across pages */
    section {
        break-inside: auto !important;
    }
}