body {
    font-size: 16px;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #111111;
    font-family: 'Open Sans', sans-serif;
}

.responsive-table {
    color: #cacbce;
}

main {
    flex: 1 0 auto; /* main takes all remaining space */
}

footer {
    flex-shrink: 0; /* footer stays visible at bottom */
    padding: 2rem 1rem;
    text-align: center;
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px; /* same as bootstrap default for xl */
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1140px; /* override default 1320px */
    }
}

@media (max-width: 440px) {
    .responsive-table {
        width: 100% !important;
        max-width: 100% !important;
        display: block;
    }

    .responsive-table tr {
        display: block;
        margin-bottom: 1rem;
    }

    .responsive-table td {
        display: block;
        width: 100%;
        padding: 0.2rem 0;
    }

    .profile-img {
        max-width: 100%;
    }
}

.nav-tabs {
    max-width: 150px; /* fits ~1 tabs */
}


@media (min-width: 250px) {
    .nav-tabs {
        max-width: 250px; /* fits ~1 tabs */
    }
}

@media (min-width: 350px) {
    .nav-tabs {
        max-width: 350px; /* fits ~2 tabs */
    }
}

@media (min-width: 512px) {
    .nav-tabs {
        max-width: 512px; /* fits ~3 tabs */
    }
}

@media (min-width: 767px) {
    .nav-tabs {
        max-width: 767px; /* fits 4 tabs with content */
    }
}

header {
    background-color: #1b3b52;
}

.bg-image {
    flex: 1 0 auto;
    background-image: url('../images/bg2.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
}

.lang-toggle {
    width: 3em;
    height: 5em;
    /*border-radius: 0.5em;*/
    overflow: hidden;
    position: relative;
    /*border: 2px solid #ffffff;*/
}

.lang-toggle input[type="radio"] {
    display: none;
}

.lang-toggle label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 100%;
    height: 50%;
    padding: 0;
    margin: 0;
    border: none;
}

.lang-toggle svg.flag {
    width: 80%;
    height: 100%;
    display: block;
}

.lang-toggle .checkmark {
    position: absolute;
    top: 75%;
    left: 15.7%;
    width: 1em;
    height: 1em;
    fill: #198754; /* зелёный Bootstrap */
    background: rgba(255 255 255 / 0.8);
    border-radius: 50%;
    padding: 0.15em;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
    transform: translate(-50%, -50%);
    display: none;
}

.lang-toggle input[type="radio"]:checked + label .checkmark {
    display: block;
}

.profile-header {
    display: flex;
    gap: 1em;
    align-items: center;
}

.profile-img {
    width: 246px;
    border-radius: 3rem;
    border: 1px solid #7a3277;
    box-shadow: 0 0 6px 2px #7a3277;
}

.profile-img:hover {
    border-width: 2px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 6px 2px #7a3277;
    }
    50% {
        box-shadow: 0 0 12px 3px #7a3277;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
}

td {
    padding: 0.5em;
    vertical-align: top;
}

.tabs .tab {
    margin-bottom: 2em;
}

.tabs h2 {
    margin-top: 1em;
}

.tab-buttons {
    display: flex;
    gap: 1em;
    margin-bottom: 1em;
}

.tab-btn {
    padding: 0.5em 1em;
    cursor: pointer;
    background: #eee;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    font-weight: normal;
    transition: background 0.3s ease;
}

.tab-btn:hover {
    background: #ddd;
}

.tab-btn.active {
    /*background: white;*/
    border-bottom: 1px solid white;
    font-weight: bold;
}

.tab-pane ul {
    padding-left: 1.25em;
}

.tab-pane h4 {
    font-weight: 400;
    padding-top: 0.5em;
    padding-bottom: 0.25em;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(150px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.tab-pane ul {
    font-size: 1.125rem;
    line-height: 1.6;

    transition-duration: 0.5s;
    /*transform: translateX(0px);*/

    opacity: 0;
    transform: translateX(150px); /* hidden offscreen initially */
}

.tab-pane ul.animate-in {
    animation: slideInFromRight 0.6s ease-out forwards;
}

.tab-pane ul:hover {
    transform: translateX(10px); /* shift 10px to the right */
    transition: transform 0.5s;
}


.nav-item {
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-link {
    color: #cccdd0;
}

.nav-link:hover {
    color: #7aa4d5 !important;
}

.hobby-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

@keyframes fall-down {
    0% {
        opacity: 0;
        transform: translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hobby-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    width: 12em;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;

    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* align content to the bottom */
    align-items: center; /* keep horizontal centering */
}

.hobby-card.fall {
    animation: fall-down 0.3s ease forwards;
}

/* Outer wrapper handles hover animation */
.hobby-outer {
    display: inline-block; /* prevent layout break */
    transition: transform 0.3s ease;
}

/* Hover effect on outer */
.hobby-outer:hover {
    transform: translateY(-5px); /* or scale(1.05), etc. */
}

.hobby-content img {
    width: 50px;
    height: 50px;
    margin-bottom: 0.5rem;
}

.hobby-content p {
    margin-bottom: 0;
}

.footer-sheet {
    max-width: 960px;
    margin: 0 auto;
}

.social-icons {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 23.75rem) {
    .social-icons {
        max-width: 100%;
    }
}

.social-link {
    display: inline-block;
    width: 2.875rem;
    height: 2.875rem;
    flex: 0 0 2.875rem;
    transition: transform 0.3s ease, color 0.3s ease;
    margin-top: 0.75rem;
}

.social-link:hover {
    transform: scale(1.15);
}

.svg-link {
    display: none;
}

/* Ensure SVG fills the link square */
.svg-content {
    width: 100%;
    height: 100%;
    display: block;
}

.institution {
    font-weight: 600;
    color: #333;
}

.svg-wrapper {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    transform: translateY(-0.25em); /* Adjust up/down as needed */
}

.svg-wrapper::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 2em;
    height: 0.55em;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.5) 0%, transparent 80%);
    pointer-events: none;
}

/*** info-cards ***/

.info-card {
    position: relative;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    padding: 2rem 2rem 2rem 2rem;
    margin: 2rem auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #000;
    font-size: 1rem;
    line-height: 1.6;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.info-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, #2e607f, #588fa3);
    background-clip: border-box;
    mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
}

.info-card:hover {
    box-shadow: 0 0 32px rgb(88, 143, 163);
    transition: box-shadow 0.3s ease-in-out;
}

.info-card ul {
    padding: 0;
    margin: 0;
    list-style-type: none;
}

.info-card li {
    border-left: 4px solid #1f4564;
    padding-left: 1rem;
}

.info-card .role {
    font-weight: 700;
    background-color: rgba(0, 120, 212, 0.1);
    padding: 0.25rem 0.75rem 0.25rem 0;
    /*display: inline-block;*/
    border-radius: 6px;
    margin: 0.3rem 0;
}

.info-card .company {
    font-weight: 700;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0.75rem 0.25rem 0;
    /*display: inline-block;*/
    border-radius: 6px;
    margin: 0.3rem 0;
}

.info-card .skills {
    font-style: italic;
    background-color: rgba(136, 84, 208, 0.12); /* soft violet */
    padding: 0.25rem 0.75rem 0.25rem 0;
    /*display: inline-block;*/
    border-radius: 6px;
    margin: 0.3rem 0;
}

.info-card .course {
    /*font-weight: 700;*/
    background-color: rgba(0, 120, 212, 0.1);
    padding: 0.25rem 0.5rem 0.25rem 0.5rem;
    /*display: inline-block;*/
    border-radius: 6px;
    /*margin: 0.3rem 0;*/
}

.info-card .class {
    font-weight: 400;
    background-color: rgba(127, 190, 255, 0.12);
    padding: 0.25rem 0.75rem 0.25rem 0;
    /*display: inline-block;*/
    border-radius: 6px;
    margin: 0.3rem 0;
}

.info-card .institution {
    font-weight: 700;
    background-color: rgba(39, 47, 72, 0.1);
    padding: 0.25rem 0.75rem 0.25rem 0;
    /*display: inline-block;*/
    border-radius: 6px;
    margin: 0.3rem 0;
}

.info-card .annotation {
    font-style: italic;
    /*background-color: rgba(136, 84, 208, 0.09); /* soft violet */
    padding: 0.25rem 0.75rem 0.25rem 0;
    /*display: inline-block;*/
    border-radius: 6px;
    margin: 0.3rem 0;
}

.info-card .grade {
    font-weight: 700;
    background-color: rgba(65, 94, 197, 0.15);
    padding: 0.25rem 0.75rem 0.25rem 0;
    /*display: inline-block;*/
    border-radius: 6px;
    margin: 0.3rem 0;

    display: flex;
    align-items: baseline;
}

.info-card .ul-outer {
    transform: translateX(0); /* default position */
    transition: transform 0.5s ease; /* smooth return movement */
}

.info-card:hover .ul-outer {
    transform: translateX(0.5rem); /* or 8px for a subtle shift */
    transition: transform 0.5s ease;
}

@keyframes wave {
    0% {
        transform: rotate(0deg);
    }
    10% {
        transform: rotate(14deg);
    }
    20% {
        transform: rotate(-8deg);
    }
    30% {
        transform: rotate(14deg);
    }
    40% {
        transform: rotate(-4deg);
    }
    50% {
        transform: rotate(10deg);
    }
    60% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* Animate the hand-palm when parent .info-card is hovered */
.info-card:hover .hand-palm {
    animation: wave 1.2s ease-in-out;
    transform-origin: bottom center; /* pivot point */
}

.info-card .date {
    display: block;
    font-style: italic;
    position: relative;
}

/* '+' for immediate sibling '~' for each next sibling */
.info-card .company-logo + li .date {
    padding-top: 0.5rem;
}

.info-card .indent,
.info-card .indent-text {
    display: block;
    padding-left: 1.25em; /* space for the bullet */
    position: relative; /* to position bullet absolutely */
}

.info-card .indent::before {
    content: "・";
    position: absolute;
    left: 0;
    color: inherit;
}

.info-card.knowledge ul li:not(:first-child) .indent {
    display: inline-block; /* makes the margin actually take effect */
    margin-top: .5rem; /* adjust to taste (e.g. 0.5 rem ≈ 8 px) */
}

/* No top margin on the first <strong> */
.info-card.knowledge ul li:first-child .indent {
    margin-top: 0;
}

.company-logo {
    position: relative;
    display: inline-block;
}

/* Tooltip container */
.company-logo .logo-tooltip {
    display: none;
}

/* Optional: limit size */
.company-logo .logo-tooltip img {
    max-height: 7.5em;
}

#global-logo-tooltip {
    display: none;
    position: absolute;
    top: 50%;
    left: 0;
    margin-top: 0.5rem;
    z-index: 9999;
    background-color: white;
    padding: 0.125rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#global-tooltip {
    display: none;
    position: absolute;
    top: 50%;
    left: 0;
    margin-top: 0.5rem;
    z-index: 9999;
    background-color: white;
    padding: 0.125rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#global-logo-tooltip img {
    max-height: 8.5em;
}

.disclaimer-light {
    color: #dee5e9;
    font-size: 0.85rem;
}

.pl-05 {
    padding-left: 0.5rem;
}

.ml-05 {
    margin-left: 0.5rem;
}

.bg-lb {
    background-color: #588fa3 !important;
    color: white;
}

.tooltip-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip-wrapper .tooltip-text {
    display: none;
}

.tooltip-wrapper .btn {
    margin-left: 0.5rem;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    vertical-align: baseline;
}

.small-text {
    font-size: 0.6rem;
}

/* PDF Modal */
#pdfModal .modal-dialog {
    max-height: 95vh; /* высота окна */
}

#pdfModal .modal-content {
    height: 90vh; /* высота контента */
    overflow: hidden;
}

#pdfModal .modal-body iframe {
    height: 100%;
    width: 100%;
}
