/* General Styles */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background: linear-gradient(135deg, #e0eafc, #cfdef3); /* Оновлено для консистентності */
    color: #333;
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header Styles */
.header {
    background: linear-gradient(90deg, #1e3c72, #2a5298); /* Синій градієнт, як на інших сторінках */
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header__nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header__logo-img {
    width: 100px;
    height: auto;
}

.header__nav-list {
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.header__nav-link {
    color: white; /* Білий текст для десктопного меню */
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: color 0.3s, transform 0.3s;
}

.header__nav-link:hover,
.header__nav-link--active {
    color: #ffd700; /* Жовтий при наведенні для десктопу */
    transform: translateY(-2px);
}

/* Бургер-меню */
.header__nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.header__nav-toggle-bar {
    width: 100%;
    height: 3px;
    background-color: white; /* Білий для контрасту на синьому хедері */
    transition: all 0.3s ease;
}

.header__nav-toggle--active .header__nav-toggle-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.header__nav-toggle--active .header__nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.header__nav-toggle--active .header__nav-toggle-bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hero Section */
.header__hero {
    text-align: center;
    padding: 50px 0;
    background-color: #ffffff;
}

.header__hero-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.header__hero-title {
    font-size: 2.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.header__hero-description {
    font-size: 1.2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

/* General Typography */
h1, h2, h3 {
    color: #333;
    margin-bottom: 15px;
}

/* Footer Styles */
.footer {
    background: linear-gradient(90deg, #1e3c72, #2a5298); /* Як хедер */
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto; /* Оновлено для флекс-лейауту */
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.2);
    width: 100%;
    flex-shrink: 0;
}

.footer__copyright {
    margin: 0;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1 0 auto;
}

/* Container */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Services Section */
.services {
    padding: 2rem 0;
    background-color: #ffffff;
}

.services__title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.services__items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 0 20px;
}

.service-item {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.service-item.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.service-item__image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
}

/* Team Section */
.team {
    padding: 2rem 0;
    background-color: #ffffff;
}

.team__title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 0 20px;
}

.team-member {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.team-member.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.team-member:hover {
    transform: translateY(-10px);
}

.team-member__image {
    width: 100%;
    height: auto;
    border-radius: 50%;
    margin-bottom: 1rem;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.team-member__name {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.team-member__position {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Calculator Section */
.calculator-section {
    padding: 50px 0;
    background-color: #ffffff;
}

.calculator-section__title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.calculator-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.calculator-form__label {
    font-size: 1rem;
    color: #6c757d;
}

.calculator-form__input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.calculator-form__button {
    padding: 0.75rem 1.5rem;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.calculator-form__button:hover {
    background-color: #0056b3;
}

.calculator-form__button.button-click {
    transform: scale(0.95);
    transition: transform 0.1s ease-out;
}

.calculator-section__result {
    margin-top: 1.5rem;
    font-size: 1.2rem;
    color: #28a745;
    font-weight: bold;
    text-align: center;
    transition: opacity 0.5s ease;
}

/* PDB Viewer Section */
.pdb-viewer-section {
    padding: 20px;
    background: linear-gradient(135deg, #f9f9f9 0%, #e9ecef 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 0 auto;
}

.pdb-viewer-section__container {
    max-width: 1400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-grow: 1;
    min-height: 0;
}

.pdb-viewer-section__title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #333;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.pdb-viewer-section__top-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    gap: 20px;
    flex-shrink: 0;
}

.pdb-viewer-section__form,
.pdb-viewer-section__url-input,
.pdb-viewer-section__mode-buttons,
.pdb-viewer-section__option-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdb-viewer-section__layout {
    display: flex;
    width: 100%;
    gap: 20px;
    flex-grow: 1;
    min-height: 0;
}

.pdb-viewer-section__sidebar {
    width: 300px;
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 300px);
    flex: 0 0 auto;
}

.pdb-viewer-section__canvas {
    width: 100%;
    flex: 1 1 auto;
    min-height: 400px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 0;
}

.pdb-viewer-section__bottom-controls {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    max-height: 200px;
    overflow-y: auto;
}

.pdb-viewer-section__main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
    height: 100%;
}

.pdb-viewer-section__input {
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    max-width: 300px;
}

.pdb-viewer-section__button {
    padding: 0.75rem 1.5rem;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.pdb-viewer-section__button:hover:not(:disabled) {
    background-color: #0056b3;
    transform: scale(1.05);
}

.pdb-viewer-section__button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.pdb-viewer-section__select {
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.pdb-viewer-section__select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.pdb-viewer-section__info,
.pdb-viewer-section__result {
    margin-top: 10px;
    font-size: 1.2rem;
    color: #28a745;
    font-weight: bold;
}

.pdb-viewer-section__history {
    margin-top: 20px;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 15vh;
    overflow-y: auto;
    font-size: 1rem;
    color: #333;
    text-align: left;
    width: 100%;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
}

.button-group label {
    font-weight: bold;
    color: #333;
}

.camera-controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.camera-controls label {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.camera-controls input {
    width: 60px;
    padding: 5px;
}

/* Motives Searcher Section */
.motives-searcher-section {
    padding: 2rem 0;
    width: 100%;
}

.motives-searcher-section__title {
    font-size: 2.8rem;
    color: #1e3c72;
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeIn 1s ease-in-out;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.motives-searcher-section__subtitle {
    font-size: 1.8rem;
    color: #2a5298;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    border-left: 5px solid #2a5298;
    padding-left: 15px;
}

.motives-searcher-form {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 3rem;
    transition: transform 0.3s;
    width: 100%;
    max-width: 800px;
}

.motives-searcher-form:hover {
    transform: translateY(-5px);
}

.motives-searcher-form__input-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.motives-searcher-form__input {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.motives-searcher-form__input:focus {
    border-color: #2a5298;
    box-shadow: 0 0 8px rgba(42, 82, 152, 0.3);
    outline: none;
}

.motives-searcher-form__buttons {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.motives-searcher-form__button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
}

.motives-searcher-form__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.motives-searcher-form__button--submit {
    background-color: #28a745;
    color: white;
}

.motives-searcher-form__button--submit:hover {
    background-color: #218838;
}

.motives-searcher-form__button--load {
    background-color: #007bff;
    color: white;
}

.motives-searcher-form__button--load:hover {
    background-color: #0056b3;
}

.motives-searcher-form__button--download {
    background-color: #17a2b8;
    color: white;
}

.motives-searcher-form__button--download:hover {
    background-color: #138496;
}

.motives-searcher-form__button--small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background-color: #f39c12;
    color: white;
}

.motives-searcher-form__button--small:hover {
    background-color: #e67e22;
}

.motives-searcher-section__list {
    list-style: none;
    padding: 0;
    width: 100%;
    max-width: 800px;
}

.motives-searcher-section__list li {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s;
}

.motives-searcher-section__list li:hover {
    transform: translateY(-3px);
}

.motif-text {
    font-weight: bold;
    color: #e74c3c;
    font-size: 1.2rem;
}

.explanation-text {
    flex: 1;
    color: #34495e;
    font-style: italic;
}

.motives-controls {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.motives-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.motives-table th,
.motives-table td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
    font-size: 0.9rem;
}

.motives-table th {
    background: #f4f4f4;
    font-weight: bold;
}

.motives-table tr:nth-child(even) {
    background: #f9f9f9;
}

.motives-table tr:hover {
    background: #e9ecef;
}

.loading-message {
    margin: 1rem 0;
    color: #007bff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message {
    color: #e74c3c;
    margin: 1rem 0;
    font-size: 1.1rem;
}

.sequence-container {
    margin: 1rem 0;
    width: 100%;
}

.sequence-scroll {
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.5rem;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.sequence-char {
    display: inline-block;
    padding: 0.2rem;
    font-family: monospace;
    font-size: 1rem;
}

.motif-highlight {
    background: #ffeb3b;
    border-radius: 2px;
}

#sequence-visualization {
    margin-bottom: 2rem;
    width: 100%;
    max-width: 1200px;
}

.visualization-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.visualization-controls label {
    font-weight: bold;
    color: #2a5298;
}

.visualization-controls select {
    padding: 0.5rem;
    border-radius: 5px;
    border: 1px solid #ddd;
}

svg title {
    background: #fff;
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Адаптивний дизайн для великих екранів */
@media (min-width: 1200px) {
    .services__items,
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .header__nav-toggle {
        display: flex;
    }

    .header__nav-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: #f4f4f4; /* Світло-сірий фон, як на інших сторінках */
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
    }

    .header__nav-list.header__nav-list--active {
        display: flex;
    }

    .header__nav-item {
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }

    .header__nav-link {
        color: #333; /* Темний текст для мобільного меню */
        font-size: 1.2rem;
    }

    .header__nav-link:hover,
    .header__nav-link--active {
        color: #007bff; /* Синій при наведенні */
        transform: none;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .motives-searcher-section__list li {
        flex-direction: column;
        align-items: flex-start;
    }

    .visualization-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .services__items,
    .team-grid {
        grid-template-columns: 1fr;
    }

    .pdb-viewer-section__top-controls,
    .pdb-viewer-section__bottom-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .pdb-viewer-section__layout {
        flex-direction: column;
    }

    .pdb-viewer-section__sidebar {
        width: 100%;
        max-height: 50vh;
    }

    .pdb-viewer-section__canvas {
        min-height: 300px;
    }

    .pdb-viewer-section__history {
        max-height: 10vh;
    }
}

@media (max-width: 480px) {
    .header__hero-title,
    .header__hero-description {
        font-size: 1.8rem;
    }

    .header__logo-img {
        width: 80px;
    }

    .services__title,
    .team__title,
    .calculator-section__title,
    .pdb-viewer-section__title,
    .motives-searcher-section__title {
        font-size: 1.5rem;
    }

    .motives-searcher-section__subtitle {
        font-size: 1.3rem;
    }

    .pdb-viewer-section__canvas {
        min-height: 250px;
    }

    .pdb-viewer-section__input {
        max-width: 100%;
    }

    .pdb-viewer-section__select {
        width: 100%;
    }

    .pdb-viewer-section__history {
        max-height: 10vh;
        font-size: 0.9rem;
    }

    .pdb-viewer-section__button,
    .motives-searcher-form__button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Вендорні префікси */
.header__hero-img,
.service-item__image,
.team-member__image {
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
}

.service-item,
.team-member,
.motives-table,
.motives-searcher-form {
    -webkit-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Анімації */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}