/* ==========================================================================
   Dennis Rawlusyk CV - Stylesheet
   ==========================================================================
   Color Palette:
     Sidebar BG:    #2c3e50 (dark blue-grey)
     Accent:        #3498db (blue)
     Accent Dark:   #2980b9 (darker blue for hover states)
     Main BG:       #ffffff (white)
     Text Dark:     #2d3436 (near-black)
     Text Light:    #636e72 (grey)
     Sidebar Text:  #ecf0f1 (off-white)
     Border Light:  #dfe6e9 (light grey)
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
    --sidebar-bg: #2c3e50;
    --sidebar-bg-light: #34495e;
    --accent: #3498db;
    --accent-dark: #2980b9;
    --accent-light: rgba(52, 152, 219, 0.1);
    --main-bg: #ffffff;
    --text-dark: #2d3436;
    --text-medium: #636e72;
    --text-light: #b2bec3;
    --sidebar-text: #ecf0f1;
    --sidebar-text-muted: #bdc3c7;
    --border-light: #dfe6e9;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --font-heading: 'Montserrat', 'Segoe UI', sans-serif;
    --font-body: 'Open Sans', 'Segoe UI', sans-serif;
    --sidebar-width: 30%;
    --transition-speed: 0.3s;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: #f0f2f5;
    line-height: 1.6;
    min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Print Button
   -------------------------------------------------------------------------- */
.print-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: background-color var(--transition-speed), transform var(--transition-speed);
}

.print-btn:hover {
    background-color: var(--accent-dark);
    transform: translateY(-1px);
}

.print-btn:active {
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   CV Container (Two-Column Layout)
   -------------------------------------------------------------------------- */
.cv-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--main-bg);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   LEFT SIDEBAR
   -------------------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 48px 32px 48px 32px;
    flex-shrink: 0;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 40px;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* Sidebar Section */
.sidebar-section {
    margin-bottom: 36px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

/* Sidebar Heading */
.sidebar-heading {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--sidebar-bg-light);
    position: relative;
}

.sidebar-heading::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent);
}

/* Sidebar Lists */
.sidebar-list {
    list-style: none;
    padding: 0;
}

.sidebar-list li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 10px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--sidebar-text-muted);
}

.sidebar-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent);
}

.sidebar-list--nested {
    margin-top: 8px;
    margin-left: 4px;
}

.sidebar-list--nested li {
    font-size: 0.825rem;
}

/* Competency Categories */
.competency-category {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-top: 16px;
    margin-bottom: 8px;
}

.competency-category:first-of-type {
    margin-top: 0;
}

/* Education Items */
.education-item {
    margin-bottom: 18px;
}

.education-item:last-child {
    margin-bottom: 0;
}

.education-degree {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
}

.education-field {
    font-size: 0.85rem;
    color: var(--sidebar-text-muted);
    margin-bottom: 2px;
}

.education-school {
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
}

/* PKI Items */
.pki-item {
    margin-bottom: 16px;
}

.pki-item:last-child {
    margin-bottom: 0;
}

.pki-item p {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--sidebar-text-muted);
}

/* --------------------------------------------------------------------------
   RIGHT MAIN AREA
   -------------------------------------------------------------------------- */
.main-content {
    flex: 1;
    padding: 48px 48px 48px 56px;
    background-color: var(--main-bg);
}

/* Main Header */
.main-header {
    margin-bottom: 40px;
    padding-bottom: 28px;
    border-bottom: 3px solid var(--border-light);
}

.main-name {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.1;
    margin-bottom: 8px;
}

.main-subtitle {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--accent);
    letter-spacing: 0.5px;
}

/* Section Heading */
.section-heading {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin-bottom: 24px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-light);
    position: relative;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--accent);
}

/* Main Section */
.main-section {
    margin-bottom: 40px;
}

/* Main Lists */
.main-list {
    list-style: none;
    padding: 0;
}

.main-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 0.925rem;
    line-height: 1.6;
    color: var(--text-medium);
}

.main-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--accent);
}

/* --------------------------------------------------------------------------
   JOB ENTRIES
   -------------------------------------------------------------------------- */
.job-entry {
    margin-bottom: 36px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-light);
}

.job-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.job-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

/* Date Badge */
.date-badge {
    display: inline-block;
    background-color: var(--accent);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 4px;
    white-space: nowrap;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    margin-top: 3px;
}

.job-title-block {
    flex: 1;
}

.job-company {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.job-role {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-medium);
}

.job-location {
    font-size: 0.825rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 1px;
}

.job-body p {
    font-size: 0.925rem;
    line-height: 1.65;
    color: var(--text-medium);
    margin-bottom: 10px;
}

.job-body p:last-child {
    margin-bottom: 0;
}

.job-body .main-list {
    margin-top: 12px;
}

/* --------------------------------------------------------------------------
   Scroll Animations
   -------------------------------------------------------------------------- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   RESPONSIVE DESIGN
   -------------------------------------------------------------------------- */

/* Tablet */
@media (max-width: 1024px) {
    .main-content {
        padding: 36px 32px 36px 40px;
    }

    .sidebar {
        padding: 36px 24px;
    }

    .main-name {
        font-size: 2.25rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .cv-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 32px 24px;
    }

    .main-content {
        padding: 32px 24px;
    }

    .main-name {
        font-size: 2rem;
    }

    .main-subtitle {
        font-size: 0.95rem;
    }

    .job-header {
        flex-direction: column;
        gap: 8px;
    }

    .date-badge {
        align-self: flex-start;
    }

    .print-btn {
        top: 12px;
        right: 12px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .main-name {
        font-size: 1.6rem;
    }

    .sidebar {
        padding: 24px 18px;
    }

    .main-content {
        padding: 24px 18px;
    }

    .section-heading {
        font-size: 1rem;
    }

    .sidebar-heading {
        font-size: 0.8rem;
    }
}

/* --------------------------------------------------------------------------
   PRINT STYLES
   -------------------------------------------------------------------------- */
@page {
    margin: 10mm;
}

@media print {
    /* Hide UI elements */
    .print-btn {
        display: none !important;
    }

    /* Reset layout for print */
    body {
        background-color: #ffffff;
        font-size: 11pt;
    }

    .cv-container {
        display: flex;
        flex-direction: row;
        max-width: none;
        box-shadow: none;
        min-height: auto;
    }

    .sidebar {
        width: 32%;
        padding: 20px 16px;
        background-color: #2c3e50 !important;
        color: #ecf0f1 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .main-content {
        width: 68%;
        padding: 20px 24px;
    }

    /* Ensure colors print */
    .date-badge {
        background-color: #3498db !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sidebar-heading,
    .section-heading,
    .main-subtitle {
        color: #3498db !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sidebar-list li::before,
    .main-list li::before {
        background-color: #3498db !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .profile-photo {
        border-color: rgba(255, 255, 255, 0.3) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Prevent page breaks inside entries */
    .job-entry {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .sidebar-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Reset animations for print */
    .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Reduce spacing for print */
    .main-header {
        margin-bottom: 20px;
        padding-bottom: 14px;
    }

    .main-section {
        margin-bottom: 20px;
    }

    .job-entry {
        margin-bottom: 18px;
        padding-bottom: 16px;
    }

    .sidebar-section {
        margin-bottom: 20px;
    }

    .main-name {
        font-size: 22pt;
    }

    .main-subtitle {
        font-size: 10pt;
    }

    .section-heading {
        font-size: 10pt;
    }

    .sidebar-heading {
        font-size: 8pt;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    /* Compact sidebar for print */
    .sidebar-header {
        margin-bottom: 16px;
    }

    .profile-photo {
        width: 100px;
        height: 100px;
    }

    .sidebar-section {
        margin-bottom: 12px;
    }

    .competency-category {
        font-size: 7pt;
        margin-top: 8px;
        margin-bottom: 4px;
    }

    .sidebar-list li {
        font-size: 8pt;
        line-height: 1.35;
        margin-bottom: 3px;
        padding-left: 12px;
    }

    .sidebar-list li::before {
        width: 4px;
        height: 4px;
        top: 5px;
    }

    .education-degree {
        font-size: 9pt;
    }

    .education-field,
    .education-school {
        font-size: 8pt;
    }

    /* Smaller text for print */
    .job-body p,
    .main-list li {
        font-size: 9pt;
        line-height: 1.45;
    }

    .date-badge {
        font-size: 7pt;
        padding: 3px 8px;
    }

    .job-company {
        font-size: 10pt;
    }

    .job-role {
        font-size: 9pt;
    }
}
