/* Общие стили */
body {
    font-family: 'Comic Sans MS', 'Comic Sans', 'Chalkboard SE', 'Bradley Hand', cursive;
    text-align: center;
    background-color: #247b27;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    /* justify-content: center; */
}

/* Видео фон с бабочками */
.background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.9;
    pointer-events: none;
}

/* Wrapper для контента чтобы copyright был внизу */
body > *:not(.copyright):not(.background-video) {
    flex-shrink: 0;
    /* position: relative; */
}

body > .copyright {
    margin-top: auto;
    position: relative;
    z-index: 1;
}

/* Главная страница */
.main-title {
    max-width: 800px;
    width: 100%;
    margin-bottom: 20px;
}

.shapka {
    position: relative;
    max-width: 800px;
    height: 250px;
}

.nav-link {
    position: absolute;
    font-family: 'Comic Sans MS', 'Comic Sans', 'Chalkboard SE', 'Bradley Hand', cursive;
    font-size: 32px;
    color: #f4d03f;
    text-decoration: underline;
    transition: transform 0.3s ease;
    text-shadow:
        1px 1px 0 #BA894D,
        -1px -1px 0 #BA894D,
        1px -1px 0 #BA894D,
        -1px 1px 0 #BA894D;
}

/* .nav-link:hover {
    transform: scale(1.15);
} */

.nav-manual {
    top: 20px;
    left: 348px;
    transform: rotate(-50deg);
}

.nav-description {
    top: 80px;
    right: 348px;
    transform: rotate(24deg);
}

.nav-garden {
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) rotate(-5deg);
    font-weight: bold;
}

/* Страницы контента */
body.content-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.page-title-plant {
    max-width: 600px;
    width: 100%;
    margin-top: 20px;
}

.page-title-about {
    max-width: 400px;
    width: 100%;
    margin-top: 100px;
}

.page-title-manual {
    max-width: 400px;
    width: 100%;
    margin-top: 50px;
    margin-bottom: 20px;
}

.content-wrapper {
    max-width: 700px;
    width: 100%;
    padding: 20px 40px;
    box-sizing: border-box;
}

/* Контейнер для кнопки Home */
.home-button-container {
    position: absolute;
    top: 40px;
    left: 40px;
    z-index: 100;
}

/* Кнопка Home */
#home-button {
    width: 100px;
    height: 100px;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    pointer-events: auto;
    position: relative;
    z-index: 100;
}

#home-button:hover {
    transform: scale(1.2);
}

#home-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .home-button-container {
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
    }

    #home-button:hover {
        transform: scale(1.2);
    }

    .main-title {
        max-width: 90%;
        margin-bottom: 30px;
    }

    .shapka {
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 70px;
        position: static;
        align-items: center;
    }

    .nav-link {
        position: static;
        font-size: 32px;
    }

    .nav-manual {
        transform: rotate(-8deg);
    }

    .nav-description {
        transform: rotate(12deg);
    }

    .nav-garden {
        transform: rotate(-5deg);
    }

    /* Страница plant на мобильных */
    body.plant-page .page-title {
        font-size: 36px;
    }

    .plant-container {
        box-sizing: border-box;
        padding: 0 20px;
    }

    .plant-circle, .user-circle {
        width: 90vw !important;
        max-width: 500px !important;
        min-width: 300px !important;
        height: 90vw !important;
        max-height: 500px !important;
        min-height: 300px !important;
    }

    .plant-image {
        width: 65% !important;
        height: 65% !important;
        max-width: none !important;
        max-height: none !important;
        min-width: 200px !important;
        min-height: 200px !important;
    }

    .user-photo {
        width: 35% !important;
        min-width: 100px !important;
    }

    .plant-name-text, .plant-description-text, .plant-date-text {
        font-size: 18px !important;
    }

    .user-name-text {
        font-size: 18px !important;
    }

    .user-city-text {
        font-size: 18px !important;
    }

    body.content-page {
        justify-content: flex-start;
    }

    .page-title-about, .page-title-manual, .page-title-plant {
        max-width: 100%;
        padding: 0 5px;
        box-sizing: border-box;
        margin-top: 120px;
        position: relative;
        z-index: 1;
    }

    picture {
        position: relative;
        z-index: 1;
    }

    .content-wrapper {
        padding: 20px;
        max-width: 100%;
    }

    .allplants {
        padding: 10px;
    }
}

/* Текстовые стили для страниц */
.manual-text {
    color: #f4d03f;
    font-size: 22px;
    text-align: center;
    margin: 0;
    text-shadow:
        1px 1px 0 #BA894D,
        -1px -1px 0 #BA894D,
        1px -1px 0 #BA894D,
        -1px 1px 0 #BA894D;
}

.manual-text a {
    color: #f4d03f;
    text-decoration: underline;
}

.description2 {
    color: #f4d03f;
    font-size: 22px;
    line-height: 1.6;
    text-align: center;
    margin: 0;
    text-shadow:
        1px 1px 0 #BA894D,
        -1px -1px 0 #BA894D,
        1px -1px 0 #BA894D,
        -1px 1px 0 #BA894D;
}

.description2 a {
    color: #f4d03f;
    text-decoration: underline;
}

/* Страница галереи растений */
body.garden-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    min-height: 100vh;
}

.allplants {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
    box-sizing: border-box;
    margin-top: 120px;
}

.width {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    width: 100%;
}

.plant {
    width: 120px;
    height: 120px;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.plant:hover {
    transform: scale(1.3);
}

/* Страница растения (Plant Description) */
body.plant-page {
    overflow-y: auto;
    min-height: 100vh;
    height: auto;
}

body.plant-page .page-title {
    font-size: 48px;
    /* margin: 0 0 0px; */
    color: #f4d03f;
    text-shadow:
        1px 1px 0 #BA894D,
        -1px -1px 0 #BA894D,
        1px -1px 0 #BA894D,
        -1px 1px 0 #BA894D,
        2px 2px 4px rgba(0, 0, 0, 0.3);
}

.plant-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* gap: 60px; */
    /* padding: 40px; */
    width: 100%;
    max-width: 900px;
}

/* Круги для растения и пользователя */
.plant-circle, .user-circle {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1 / 1;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Фикс для устройств не поддерживающих aspect-ratio */
@supports not (aspect-ratio: 1 / 1) {
    .plant-circle, .user-circle {
        height: 0;
        padding-bottom: 100%;
    }
}

.circle-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.plant-content, .user-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.plant-image {
    max-width: 60%;
    max-height: 60%;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.plant-info {
    text-align: center;
    max-width: 600px;
    /* margin: 20px auto; */
}

.plant-name-text, .plant-description-text, .plant-date-text {
    font-family: 'Comic Sans MS', 'Comic Sans', 'Chalkboard SE', 'Bradley Hand', cursive;
    color: #f4d03f;
    margin: 5px 0;
    font-size: 18px;
    text-shadow:
        1px 1px 0 #BA894D,
        -1px -1px 0 #BA894D,
        1px -1px 0 #BA894D,
        -1px 1px 0 #BA894D,
        1px 1px 2px rgba(0, 0, 0, 0.5);
}


/* Круг пользователя */
.user-photo {
    width: 30%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f4d03f;
}

.user-info {
    text-align: center;
    max-width: 600px;
    margin: 20px auto;
}

.user-name-text, .user-city-text {
    font-family: 'Comic Sans MS', 'Comic Sans', 'Chalkboard SE', 'Bradley Hand', cursive;
    color: #f4d03f;
    margin: 5px 0;
    font-size: 18px;
    font-weight: bold;
    text-shadow:
        1px 1px 0 #BA894D,
        -1px -1px 0 #BA894D,
        1px -1px 0 #BA894D,
        -1px 1px 0 #BA894D,
        1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Форма отправки на странице manual */
.plant-form {
    max-width: 500px;
    margin: 5px auto;
    padding: 0;
}

.form-group {
    margin-bottom: 16px;
}

.form-group.required label::after {
    content: " *";
    color: #ff6b6b;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #f4d03f;
    font-size: 22px;
    font-family: 'Comic Sans MS', 'Comic Sans', 'Chalkboard SE', 'Bradley Hand', cursive;
    text-shadow:
        1px 1px 0 #BA894D,
        -1px -1px 0 #BA894D,
        1px -1px 0 #BA894D,
        -1px 1px 0 #BA894D;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    background-color: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    box-sizing: border-box;
    border-radius: 50px;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: 2px solid #4CAF50;
    border-color: #4CAF50;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    background-color: #fff;
    border: 1px solid #ccc;
    font-family: Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
    box-sizing: border-box;
    border-radius: 50px;
}

.form-group .file-name {
    display: block;
    margin-top: 4px;
    color: #f4d03f;
    font-size: 13px;
    font-style: italic;
    text-shadow:
        1px 1px 0 #BA894D,
        -1px -1px 0 #BA894D,
        1px -1px 0 #BA894D,
        -1px 1px 0 #BA894D;
}

.submit-button {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background-color: #22B14C;
    border: none;
    color: white;
    font-family: 'Comic Sans MS', 'Comic Sans', 'Chalkboard SE', 'Bradley Hand', cursive;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 50px;
}

.submit-button:hover {
    background-color: #45a049;
}

.submit-button:active {
    background-color: #3d8b40;
}

.submit-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Мобильная адаптация для формы */
@media (max-width: 768px) {
    .plant-form {
        max-width: 100%;
        padding: 0 20px;
    }
}

/* Copyright footer */
.copyright {
    text-align: center;
    color: #f4d03f;
    font-size: 14px;
    font-family: 'Comic Sans MS', 'Comic Sans', 'Chalkboard SE', 'Bradley Hand', cursive;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    text-shadow:
        1px 1px 0 #BA894D,
        -1px -1px 0 #BA894D,
        1px -1px 0 #BA894D,
        -1px 1px 0 #BA894D;
}

.copyright a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    .copyright {
        font-size: 12px;
        padding: 15px;
        margin-top: 30px;
    }
}