@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sidebar-bg: #2c5f7c;
    --main-bg: #ffffff;
    --text-dark: #1a1a1a;
    --text-light: #ffffff;
    --accent-blue: #2c5f7c;
    --border-color: #d0d0d0;
    --gray-text: #4a4a4a;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: #f5f5f5;
}

.cv-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 340px 1fr;
    background: white;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
}

/* Sidebar (Left Column) */
.sidebar {
    background: var(--sidebar-bg);
    color: var(--text-light);
    padding: 0;
}

.profile-photo {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
}

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

.sidebar-section {
    padding: 2rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.sidebar-section p {
    font-size: 0.95rem;
    line-height: 1.7;
    font-weight: 300;
}

.skills-list,
.cert-list {
    list-style: none;
    padding: 0;
}

.skills-list li,
.cert-list li {
    padding: 0.5rem 0;
    padding-left: 1.25rem;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 300;
}

.skills-list li:before,
.cert-list li:before {
    content: "▸";
    position: absolute;
    left: 0;
    font-weight: 700;
}

/* Main Content (Right Column) */
.main-content {
    padding: 3rem 3.5rem;
    background: var(--main-bg);
}

.cv-header {
    margin-bottom: 3rem;
    border-bottom: 3px solid var(--accent-blue);
    padding-bottom: 2rem;
}

.cv-header h1 {
    font-size: 3rem;
    font-weight: 300;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.cv-header h1 .surname {
    font-weight: 900;
    display: block;
}

.job-title {
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--gray-text);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-icon {
    width: 18px;
    height: 18px;
    stroke: var(--accent-blue);
    flex-shrink: 0;
}

.contact-row span {
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* Content Sections */
.content-section {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

/* Experience Items */
.experience-item,
.education-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.experience-item:last-child,
.education-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.exp-header {
    margin-bottom: 0.75rem;
}

.date-range {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--text-light);
    background: var(--accent-blue);
    padding: 0.35rem 1rem;
    border-radius: 3px;
    font-weight: 500;
}

.experience-item h3,
.education-item h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0.75rem 0 0.5rem 0;
}

.company-name,
.degree {
    font-size: 1rem;
    color: var(--gray-text);
    font-weight: 500;
    margin-bottom: 1rem;
}

.field-info {
    font-size: 0.95rem;
    color: var(--gray-text);
    margin: 0.25rem 0;
}

.job-duties {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.job-duties li {
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.95rem;
    color: var(--gray-text);
    line-height: 1.6;
}

.job-duties li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: 700;
    font-size: 1.2rem;
}

/* Languages */
.languages {
    display: grid;
    gap: 1.5rem;
}

.language-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-blue);
}

.lang-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.lang-header strong {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.level {
    background: var(--accent-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), #4a8db0);
    border-radius: 10px;
}

.level-desc {
    font-size: 0.9rem;
    color: var(--gray-text);
    margin: 0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    justify-content: center;
}

/* QR Section - hidden by default, visible only in print */
.qr-section {
    display: none;
}

.job-duties-print {
    display: none;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border: 2px solid var(--accent-blue);
    border-radius: 8px;
    background: var(--accent-blue);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
}

.btn-action:hover {
    background: #1d4a63;
    border-color: #1d4a63;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 95, 124, 0.3);
}

.btn-action svg {
    width: 20px;
    height: 20px;
}

/* Footer */
.cv-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.cv-footer p {
    font-size: 0.85rem;
    color: var(--gray-text);
    line-height: 1.6;
    font-style: italic;
}

/* Mobile header - hidden by default */
.cv-header-mobile {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 968px) {
    .cv-container {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }

    /* Sidebar - rearrange children order on mobile */
    .sidebar {
        order: 1;
        background: transparent;
        display: flex;
        flex-direction: column;
    }

    /* Show photo on mobile at the top */
    .profile-photo {
        display: block !important;
        order: 1;
        width: 100%;
        aspect-ratio: 1;
    }

    .profile-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Hide desktop header on mobile */
    .main-content .cv-header {
        display: none;
    }

    /* Show mobile header with white background */
    .cv-header-mobile {
        display: block !important;
        padding: 2rem 1.5rem;
        background: var(--main-bg);
        color: var(--text-dark);
        order: 2;
    }

    .cv-header-mobile h1 {
        font-size: 2rem;
        font-weight: 300;
        color: var(--accent-blue);
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }

    .cv-header-mobile h1 .surname {
        font-weight: 900;
        display: block;
    }

    .cv-header-mobile .job-title {
        font-size: 1rem;
        font-weight: 400;
        color: var(--text-dark);
        text-transform: uppercase;
        letter-spacing: 1.5px;
        margin-bottom: 1.5rem;
    }

    .cv-header-mobile .contact-info {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .cv-header-mobile .contact-row {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .cv-header-mobile .contact-icon {
        width: 20px;
        height: 20px;
        stroke: var(--accent-blue);
        flex-shrink: 0;
    }

    .cv-header-mobile .contact-row span {
        font-size: 0.95rem;
        color: var(--text-dark);
        line-height: 1.5;
    }

    /* Sidebar sections go to the bottom */
    .sidebar-section {
        order: 100;
        padding: 1.5rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
        background: var(--main-bg);
    }

    .sidebar-section h2 {
        color: var(--accent-blue);
        border-bottom: 2px solid var(--accent-blue);
    }

    .sidebar-section p,
    .skills-list li,
    .cert-list li {
        color: var(--text-dark);
    }

    .skills-list li:before,
    .cert-list li:before {
        color: var(--accent-blue);
    }

    /* Main content goes after mobile header */
    .main-content {
        order: 10;
        padding: 2rem 1.5rem;
    }

    .contact-info {
        flex-direction: column;
        gap: 1rem;
    }
}

@media print {
    @page {
        size: A4;
        margin: 10mm;
    }

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

    .cv-container {
        box-shadow: none;
        max-width: 100%;
        display: grid;
        grid-template-columns: 260px 1fr;
        min-height: auto;
    }

    /* Hide action buttons and full job descriptions in print */
    .action-buttons {
        display: none !important;
    }

    .job-duties {
        display: none !important;
    }

    .job-duties-print {
        display: block !important;
        list-style: none;
        padding: 0;
        margin-top: 0.3rem;
    }

    .job-duties-print li {
        padding: 0.1rem 0;
        padding-left: 1rem;
        position: relative;
        font-size: 0.7rem;
        line-height: 1.2;
        color: var(--gray-text);
    }

    .job-duties-print li:before {
        content: "•";
        position: absolute;
        left: 0;
        color: var(--accent-blue);
        font-weight: 700;
        font-size: 0.8rem;
    }

    /* Show QR section in print */
    .qr-section {
        display: block !important;
        margin: 1.5rem 0 1rem 0;
        padding: 1rem;
        border: 2px solid var(--accent-blue);
        border-radius: 8px;
        background: #f8f9fa;
    }

    .qr-content {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .qr-code {
        width: 80px;
        height: 80px;
        flex-shrink: 0;
    }

    .qr-text {
        flex: 1;
    }

    .qr-label {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--accent-blue);
        margin-bottom: 0.2rem;
    }

    .qr-url {
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--text-dark);
        margin: 0;
    }

    /* Sidebar adjustments for print */
    .sidebar {
        padding: 0;
    }

    .profile-photo {
        width: 100%;
        height: 200px;
        aspect-ratio: auto;
    }

    .profile-photo img {
        object-fit: cover;
    }

    .sidebar-section {
        padding: 0.8rem 1.2rem;
        font-size: 0.75rem;
    }

    .sidebar-section h2 {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.4rem;
    }

    .sidebar-section p,
    .skills-list li,
    .cert-list li {
        font-size: 0.7rem;
        line-height: 1.3;
        padding: 0.25rem 0;
    }

    /* Main content adjustments */
    .main-content {
        padding: 1rem 1.5rem;
    }

    .cv-header {
        margin-bottom: 1rem;
        padding-bottom: 0.8rem;
    }

    .cv-header h1 {
        font-size: 1.6rem;
        margin-bottom: 0.2rem;
    }

    .job-title {
        font-size: 0.85rem;
        margin-bottom: 0.8rem;
        letter-spacing: 1px;
    }

    .contact-info {
        gap: 0.5rem;
        margin-top: 0.6rem;
    }

    .contact-row {
        font-size: 0.7rem;
    }

    .contact-icon {
        width: 12px;
        height: 12px;
    }

    /* Content sections */
    .content-section {
        margin-bottom: 1rem;
    }

    /* Force page break before Wykształcenie section */
    .content-section:nth-of-type(2) {
        page-break-before: always;
        margin-top: 0;
    }

    .section-title {
        font-size: 1.1rem;
        margin-bottom: 0.7rem;
        padding-bottom: 0.4rem;
    }

    .experience-item,
    .education-item {
        margin-bottom: 0.8rem;
        padding-bottom: 0.8rem;
        page-break-inside: avoid;
    }

    .date-range {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }

    .experience-item h3,
    .education-item h3 {
        font-size: 0.95rem;
        margin: 0.4rem 0 0.25rem 0;
    }

    .company-name,
    .degree {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }

    .field-info {
        font-size: 0.75rem;
        margin: 0.15rem 0;
    }

    .job-duties {
        margin-top: 0.4rem;
    }

    .job-duties li {
        padding: 0.15rem 0;
        padding-left: 1rem;
        font-size: 0.72rem;
        line-height: 1.25;
    }

    .job-duties li:before {
        font-size: 0.8rem;
        left: 0;
    }

    /* Languages */
    .language-item {
        padding: 0.8rem;
        font-size: 0.85rem;
    }

    .progress-bar {
        height: 6px;
        margin-bottom: 0.3rem;
    }

    /* Footer */
    .cv-footer {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .cv-footer p {
        font-size: 0.7rem;
    }
}
