/* Основные стили */
html {
    height: 100%;
    margin: 0;
    padding: 0;
    transition: 1s all;
}

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Minimum height of 100% of the viewport height */  
}



h1 {
    color: #fff;
}

h2 {
    color: #333;
    font-size: calc(15px + 20 * (100vw - 320px) / 880);
}

h3 {
    color: #333;
    font-size: calc(12px + 15 * (100vw - 320px) / 880);
}



/* Стили для шапки сайта */
header {
    background-color: #333;
    color: #fff;
    padding: 0;
    text-align: center;
}

/* Стили для логотипа */
@media screen and (min-width: 320px) {
    header #logo {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 0 auto;
        object-fit: cover;
        content: url("../images/logo-phone.webp");
    }

    
    #poem-audio {
        width: 100%;
        margin-top: 20px;
    }

    audio::-webkit-media-controls-current-time-display,
    audio::-webkit-media-controls-time-remaining-display {
        display: none;
    }
}

@media screen and (min-width: 1024px) {
    header #logo {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 0 auto;
        object-fit: cover;
        content: url("../images/logo.webp");
    }

    #poem-audio {
        width: 100%;
        margin-top: 20px;
    }

    audio::-webkit-media-controls-current-time-display,
    audio::-webkit-media-controls-time-remaining-display {
        display: block;
    }
}

header h1 {
    margin: 0;
    font-size: 2em;
}



/* Верхнее навигационное меню */
header ul {
    list-style: none;
    padding: 10px;
    margin: 0;
    display: flex;
    justify-content: space-around;
}

header ul li {
    display: inline;
    margin: 1vw;
}

header ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: calc(12px + 10 * (100vw - 320px) / 880);
    white-space: nowrap;
    transition: all 0.3s ease;
    position: relative;
    padding: 1vw;
    background-color:#555;
    border-radius: 5%;
}

header ul li a:hover {
    color: #dc9b1a;
}

header ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #fff;
    transition: width 0.3s ease;
}

header ul li a:hover::after {
    width: 100%;
}

@media (max-width: 600px) {
    header ul {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
    }
    
    header ul li {
        margin: 1vh;
        margin-right: auto;
    }

    header ul li a {
        font-size: calc(16px + 10 * (100vw - 320px) / 880);
        padding: 2vw;
    }
}


.container {
    display: flex;
    flex: 1 0 auto; /* This will make the container grow to fill available space */
    min-height: 0; /* Это важно для Firefox */
}


/* Боковое навигационное меню */
/* Стили для боковой панели */
@media screen and (min-width: 320px){
    #sidebar {
        width: 15%;
        background-color: #4C4C4C;
        padding: 15px;
        color: #fff;
        overflow-y: auto; /* Добавляет прокрутку, если контент не помещается */
        flex-shrink: 0; /* Prevents the sidebar from shrinking */
    }

    #sidebar #categories-nav {
        display:none;
        list-style: none;
        padding: 0;
    }

    #poems-nav {
        display:none;
    }


    #poem-list-button {
        display: flex;
        align-items: center;
        justify-content: center;
        background: #222;
        margin: 0 auto;
        cursor: pointer;
        transition: transform 0.2s ease, opacity 0.2s ease;
        border-radius: 15%;
        padding: 5px;
    }
    
    #poem-list-button:hover {
        transform: scale(1.15);
    }
    
    #poem-list-button:active {
        transform: scale(0.95);
    }
    
    #poem-list-button img {
        min-width: 2.5rem;
        width: 4vw;
        max-width: 3rem;
        opacity: 0.8;
    }
    
    #poem-list-button:hover img {
        opacity: 1;
    }

    #poem-content {
        font-size: calc(16px + 8 * (100vw - 320px) / 880);
        white-space: pre-wrap;
        font-family: 'Arial', sans-serif;
        line-height: 1.6;
        padding: 10px;
        background-color: #f9f9f9;
        border-radius: 5px;
        padding-left: 5%;
    }

    h2 {
        color: #333;
        font-size: calc(24px + 20 * (100vw - 320px) / 880);
    }
}

@media screen and (min-width: 1024px){
    #sidebar {
        width: calc(100px + 100 * (100vw - 320px) / 880);
        background-color: #4C4C4C;
        padding: 15px;
        color: #fff;
        overflow-y: auto; /* Добавляет прокрутку, если контент не помещается */
        flex-shrink: 0; /* Prevents the sidebar from shrinking */
    }
    
    #sidebar #categories-nav {
        display:block;
        list-style: none;
        padding: 0;
    }

    #poems-nav {
        display:block;
        padding-left: calc(15px + 20 * (100vw - 320px) / 880);
    }

    #poem-list-button{
        display:none;
    }

    #poem-content {
        font-size: calc(12px + 8 * (100vw - 320px) / 880);
        white-space: pre-wrap;
        font-family: 'Arial', sans-serif;
        line-height: 1.6;
        padding: 10px;
        background-color: #f9f9f9;
        border-radius: 5px;
        padding-left: 5%;
    }
}




#sidebar #categories-nav li {
    margin-bottom: 10px;
}

#sidebar #categories-nav li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: calc(12px + 8 * (100vw - 320px) / 880);
}

#sidebar ul li a:hover {
    text-decoration: underline;
}

#poems-nav li {
    padding-top: 10px;
}

#poems-nav li a {
    color: #fff;
    text-decoration: none;
    font-weight: lighter;
    font-size: calc(12px + 8 * (100vw - 320px) / 880);
}




/* Стили для главного контента */
#main-content {
    flex: 1;
    padding: 20px;
    background: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto; /* Добавляет прокрутку, если контент не помещается */
}


/* КНОПКА ПОДЕЛИТЬСЯ НА poems.html */
#poems-shareButton {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 8px;
    margin-left: auto;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border-radius: 50%;
}

#poems-shareButton:hover {
    transform: scale(1.15);
}

#poems-shareButton:active {
    transform: scale(0.95);
}

#poems-shareButton img {
    min-width: 2.5rem;
    width: 4vw;
    max-width: 3rem;
    opacity: 0.8;
}

#poems-shareButton:hover img {
    opacity: 1;
}


/* Стили для футера */
footer {
    text-align: center;
    padding: 10px;
    background-color: #333;
    color: #fff;
}

footer p {
    margin: 0;
    margin-top: auto;
    flex-shrink: 0; /* Prevents the footer from shrinking */
}





/* Admin Panel */

/* Стили для админ-панели */
.admin-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.admin-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    padding: 25px;
}

.admin-section h2 {
    color: #333;
    border-bottom: 2px solid #4C4C4C;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.admin-form {
    display: flex;
    flex-direction: column;
}

.admin-form label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #4C4C4C;
}

.admin-form select,
.admin-form input[type="text"],
.file-input-container,
.admin-form textarea {
    margin-bottom: 20px;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: border-color 0.3s ease;
}

.admin-form input[type="file"] {
    font-size: calc(10px + 6 * (100vw - 320px) / 880);
    margin:auto;
}


.admin-form select:focus,
.admin-form input[type="text"]:focus,
.admin-form textarea:focus {
    border-color: #4C4C4C;
    outline: none;
}

.admin-form button {
    padding: 12px 20px;
    background-color: #4C4C4C;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    align-self: flex-start;
}

.admin-form .clear-file {
    font-size: 12px;
    padding: 10px 14px;
    visibility: hidden;
}

.admin-form .clear-file:hover {
    background-color:#cc0000;
}

.admin-form button:hover {
    background-color: #333;
}


#add-poem {
    background-color: #f9f9f9;
    border-left: 5px solid #4C4C4C;
}

.file-input-container {
    display: flex;
}

.file-input-container input {
    width:100%;
}



/* Специфические стили для секции редактирования */
#edit-poem {
    background-color: #f9f9f9;
    border-left: 5px solid #EFDD3D;
}

#edit-poem-select,
#delete-poem-select {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Специфические стили для секции удаления */
#delete-poem {
    background-color: #fff0f0;
    border-left: 5px solid #ff3333;
}

#delete-button {
    background-color: #ff3333;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

#delete-button:hover {
    background-color: #cc0000;
}








/* Стили для страницы контактов */
.container-line {
    display: flex;
    justify-content: center;
    flex: 1 0 auto; /* This will make the container grow to fill available space */
    min-height: 0; /* Это важно для Firefox */
}

#about-author {
    padding: 15px;
    text-align: center;
}





/* АНИМАЦИИ */
.slideFromRightClass {
    animation: slideFromRight 1.5s;
}

@keyframes slideFromRight {
    0% {
        margin-left: 30%;
        opacity:0;
    }
    100% {
        margin-left:0%;
        opacity: 1;
    }
}


.slideFromLeftClass {
    animation: slideFromLeft 1s;
}

@keyframes slideFromLeft {
    0% {
        transform: translateX(-100%);
        opacity:0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.slideFromBottomClass {
    animation: slideFromBottom 2s ease-in-out;
}

@keyframes slideFromBottom {
    0% {
        transform: translateY(100%);
        opacity:0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}


#author-description {
    font-size: calc(12px + 8 * (100vw - 320px) / 880);
    max-width: 45vw;
    text-align: left;
    padding-left: 5vw;
    animation: slideFromRight 1.5s ease-in-out;
}

#author-photo {
    max-width: 30vw;
    width:100%;
    border-radius: 20%;
    box-shadow: 2vw 2vw 2vw rgba(0, 0, 0, 0.3);
    object-fit: cover;
    opacity: 0;
}


#social-links {
    text-align: center;
    width: 100%;
}

#social-links ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

#social-links ul li a {
    text-decoration: none;
    font-size: calc(12px + 8 * (100vw - 320px) / 880);
    color: #333;
    margin-right: 2vw;
}


/* Главная страница */
.index-section {
    justify-content: center;
    text-align: center;
    width: 100%;
}

.index-section p {
    font-size: calc(14px + 12 * (100vw - 320px) / 880);
    animation: slideFromBottom 3s ease-in;
}

/* Обертка для центрирования */
.wrapper {
    display: flex;
    justify-content: center; /* Центрирует контент по горизонтали */
    padding: 20px; /* Можно настроить, чтобы добавить отступы */
  }
  
  /* Контейнер для Instagram постов */
  .instagram-container {
    width: 100%;
    columns: 400px;
    column-gap: 20px;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 15px;
    background-color: #F9F9F9;
    animation: slideFromBottom 3s ease-in;
  }
  


/* Стили для логина (входа) */
#login-container {
    max-width: 100vw;
    margin: 50px auto;
    padding: 20px;
    background-color: #f4f4f4;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-align: center;
}

#login-form {
    display: flex;
    flex-direction: column;
}

#login-form label {
    margin-bottom: 8px;
    font-size: 16px;
    text-align: left;
}

#login-form input {
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

#login-form button {
    padding: 10px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

#login-form button:hover {
    background-color: #555;
}