/* Общие стили */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

/* Шапка */
header {
    background-color: #0077b6;
    color: #fff;
    padding: 20px;
    text-align: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.header-text {
    text-align: left;
}

.header-text p {
    font-size: 0.9rem;
    margin: 8px 0 10px 0;
    color: #fff;
    opacity: 0.9;
    font-weight: 300;
}

.header-text p i {
    margin-right: 5px;
}

.profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
}

.contacts {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.contacts a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
}

.contacts a:hover {
    text-decoration: underline;
}

/* Основной контент */
main {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h3 {
    color: #0077b6;
    border-bottom: 2px solid #0077b6;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

/* Таймлайн */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 0;
    width: 12px;
    height: 12px;
    background-color: #0077b6;
    border-radius: 50%;
    border: 2px solid #fff;
    z-index: 1;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 12px;
    width: 2px;
    height: 100%;
    background-color: #0077b6;
}

.timeline-connector.promotion-line {
    margin-left: 20px;
    width: 2px;
    height: 50px;
    background-image: repeating-linear-gradient(to bottom, #0077b6, #0077b6 3px, transparent 3px, transparent 6px);
}

.timeline-content {
    background-color: #e0f4ff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-left: 20px;
    margin-bottom: 30px;
}

.timeline-content a {
    color: inherit;
    text-decoration: none;
}

.timeline-content a:hover {
    text-decoration: underline;
    cursor: pointer;
}

.timeline>.timeline-item:last-child:not(:has(+ .timeline-connector))::after {
    height: 100%;
}

.timeline-item:has(+ .timeline-connector) .timeline-content {
    margin-bottom: 0;
}

/* Сетка навыков и личных качеств */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.skill-box {
    background-color: #e0f4ff;
    border: 1px solid #ccc;
    padding: 12px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 40px;
    cursor: default;
}

/* Список языков */
.languages-list {
    list-style-type: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.language-item {
    background-color: #e0f4ff;
    border: 1px solid #ccc;
    padding: 12px 15px;
    border-radius: 4px;
    text-align: left;
    font-size: 0.95rem;
    cursor: default;
}

/* Анимации */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.section-about,
.section-skills {
    animation: slideInLeft 0.5s ease-in 0.3s forwards;
}

.section-experience,
.section-languages {
    animation: slideInRight 0.5s ease-in 0.5s forwards;
}

/* Адаптивность */
@media (max-width: 768px) {
    .timeline {
        padding-left: 20px;
    }

    .timeline-item::before {
        left: 3px;
    }

    .timeline-item::after {
        left: 10px;
    }

    .timeline-connector {
        margin-left: 10px;
        height: 45px;
    }

    .timeline-content {
        margin-bottom: 20px;
    }

    .timeline-item:has(+ .timeline-connector) .timeline-content {
        margin-bottom: 0;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .languages-list {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Печать */
@media print {
    body {
        font-size: 10pt;
        color: #000;
        background-color: #fff;
        margin: 0;
        padding: 0;
    }

    header {
        background-color: #f9f9f9;
        color: #000;
        padding: 15px;
        border-bottom: 1px solid #ddd;
    }

    main {
        box-shadow: none;
        border: none;
        margin: 10mm auto;
        padding: 0;
        max-width: 100%;
    }

    a {
        color: #0056b3;
        text-decoration: underline;
    }

    a[href^="http"]::after,
    a[href^="mailto"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
        word-break: break-all;
    }

    .contacts a[href*="t.me"]::after,
    .contacts a[href*="mailto:"]::after {
        content: "";
    }

    .slide-in-left,
    .slide-in-right {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .profile-photo {
        width: 100px;
        height: 100px;
        margin: 0 auto 10px auto;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .contacts {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .contacts a {
        color: #0056b3;
    }

    .header-text h1,
    .header-text h2,
    .header-text p {
        color: #000;
        opacity: 1;
        text-align: center;
    }

    .timeline-item::before {
        background-color: #ccc;
        border-color: #fff;
    }

    .timeline-item::after {
        background-color: #ccc;
        height: 100%;
    }

    .timeline>.timeline-item:last-child:not(:has(+ .timeline-connector))::after {
        display: none;
    }

    .timeline-connector.promotion-line {
        height: 15px;
        background-image: repeating-linear-gradient(to bottom, #000, #000 3px, transparent 3px, transparent 6px);
    }

    .timeline-content,
    .skill-box,
    .language-item {
        background-color: #f9f9f9;
        border: 1px solid #ddd;
        box-shadow: none;
        padding: 10px;
        page-break-inside: avoid;
    }

    h3,
    h4 {
        color: #333;
        border-bottom-color: #ccc;
        padding-bottom: 3px;
        margin-bottom: 10px;
        page-break-after: avoid;
    }

    .skills-grid,
    .languages-list {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        page-break-inside: avoid;
    }

    section {
        page-break-inside: avoid;
        margin-bottom: 15px;
    }

    ul {
        padding-left: 20px;
        page-break-inside: avoid;
    }

    li {
        margin-bottom: 5px;
    }
}