body, html {
    margin: 0;
    padding: 0;
    font-family: 'Cormorant Garamond', serif;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), 
                url('../images/deskbackground.jpg') no-repeat center center fixed;
    background-size: cover;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

header {
    background-color: rgba(255, 255, 255, 0.5); /* Полупрозрачен фон */
    backdrop-filter: blur(10px); /* Замъгляване */
    color: #fff;
    text-align: center;
    padding: 20px;
    position: fixed; /* Фиксиране на хедера */
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.3s ease-in-out; /* Гладък ефект при скриване */
}
header.hidden {
    transform: translateY(-100%); /* Премества хедера извън видимостта */
}

header h1 {
    margin: 0;
    font-size: 2em;
}

nav ul {
    list-style: none;
    padding: 0;
}

nav ul li {
    display: inline;
    margin-right: 15px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
}

/* бутони напред - назад */
.navigation {
    position: fixed; /* Фиксира бутоните в долната част на страницата */
    bottom: 20px; /* Отстояние от долния край */
    width: 100%; /* Заемане на пълната ширина */
    text-align: center; /* Центриране на бутоните */
    z-index: 1000; /* Над всички други елементи */
}

.navigation button {
    background-color: #333; /* Тъмен фон */
    color: white; /* Бял текст */
    border: none; /* Премахване на границите */
    padding: 10px 20px; /* Пространство вътре в бутона */
    margin: 0 10px; /* Разстояние между бутоните */
    border-radius: 5px; /* Закръглени ръбове */
    cursor: pointer; /* Показване на ръчичка при посочване */
    transition: background-color 0.3s ease; /* Плавна промяна на цвета */
    font-size: 16px; /* По-голям текст за четимост */
}

.navigation button:hover {
    background-color: #555; /* По-светъл фон при задържане */
}

/* бутони напред - назад *******************************/

.main-header {
    background-color: rgba(255, 255, 255, 0.5); /* Полупрозрачен фон */
    backdrop-filter: blur(10px); /* Замъгляване */
    color: #fff;
    text-align: center;
    padding: 2px;
    position: fixed; /* Фиксиране на хедера */
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.3s ease-in-out; /* Гладък ефект при скриване */
}

.main-header.hidden {
    transform: translateY(-100%); /* Премества хедера извън видимостта */
}    


/* header */


.background {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.flipbook {
    width: 90%; /* Приспособяване към ширината на екрана */
    max-width: 800px; /* Горна граница за по-големи екрани */
    height: auto;
    max-height: 550px; /* Гъвкава височина */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    perspective: 1500px;
    user-select: none;
    overflow: visible; /* Позволява видимост на всички елементи */
}

/* Корицата (предна) */
.flipbook .cover.front {
    background: url('../images/leather-texture-background.jpg') no-repeat center center;
    background-size: cover;
    position: relative;
    box-shadow: inset -10px 0px 15px rgba(0, 0, 0, 0.8), 0 5px 15px rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
/* Вдлъбнатина от лявата страна */
.flipbook .cover.front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8), transparent);
    box-shadow: inset -5px 0 10px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* Светлинен градиент от дясната страна */
.flipbook .cover.front::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 100%;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.15), transparent);
    box-shadow: -10px 0px 15px rgba(0, 0, 0, 0.3); /* Сянка за подсилване на дълбочината */
    pointer-events: none;
    z-index: 4;
}

/* Шевове */
.flipbook .cover.front .seams {
    position: absolute;
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border: 2px dashed rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.7); /* Подсилена сянка */
    pointer-events: none;
    z-index: 2;
}

/* Вдлъбнатини */
.flipbook .cover.front .indentation {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 60%;
    border: 2px solid rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    box-shadow: inset 4px 4px 10px rgba(0, 0, 0, 0.7),
                inset -4px -4px 10px rgba(255, 255, 255, 0.2);
    pointer-events: none;
    z-index: 3;
}

/* Драскотини */
.flipbook .cover.front .overlay-scratches {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    background: url('../images/scratches.jpg') repeat;
    opacity: 0.1;
    pointer-events: none;
    z-index: 2;
}

/* Винтидж петна */
.flipbook .cover.front .overlay-stains {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/vintage-stains.png') no-repeat center center;
    background-size: cover;
    opacity: 0.2;
    pointer-events: none;
    mix-blend-mode: multiply;
    z-index: 2;
}

/* Страници */
.flipbook .page {
    background: url('../images/old_paper_texture.jpg') no-repeat center center;
    background-size: cover;
    text-align: justify;
    font-size: 18px;
    color: #2e2e2e;
    padding: 30px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4), /* Дълбочина вътре */
                5px 5px 10px rgba(0, 0, 0, 0.5); /* Дълбочина на външния ръб */
    transform-origin: left center;
    overflow-y: auto; /* Скролиране при излишък от съдържание */

}

/*******************************оформление на текста *******************************/
.page-number {
    position: absolute;
    bottom: 10px;
    right: 20px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 14px;
    color: #5a3d1b;
}

.flipbook .page h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    margin-bottom: 10px;
    text-align: center;
    color: #5a3d1b;
}

.flipbook .page h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    margin-bottom: 8px;
    color: #784212;
}

.flipbook .page ul {
    margin: 20px;
    padding-left: 20px;
    list-style-type: square;
}

.flipbook .page ul li {
    margin-bottom: 10px;
}

.flipbook .page p {
    margin: 15px 0;
}
/************************************************************************/
/* Сянка между страниците */
.flipbook .page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.4), transparent);
    pointer-events: none;
    z-index: 2;
}

/* Заглавие */
.flipbook .cover.front h1 {
    font-family: 'Playfair Display', serif;
    font-size: 60px; /* Увеличен размер за заглавието */
    text-transform: uppercase;
    color: white; /* Видим цвят за текст */
    text-shadow:
        2px 2px 5px rgba(0, 0, 0, 0.7), /* Подсилен релеф */
        -2px -2px 5px rgba(255, 255, 255, 0.3); /* Светлинен ефект */
    margin: 0;
    letter-spacing: 2px;
    text-align: center;
    position: absolute;
    top: 30%; /* Позициониране в центъра на корицата */
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}
/* Центриране и поправка на подзаглавието */
.flipbook .cover.front h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    color: white; /* За видимост на текста */
    text-shadow:
        1px 1px 2px rgba(0, 0, 0, 0.6),
        -1px -1px 2px rgba(255, 255, 255, 0.3);
    line-height: 1.5;
    margin-top: 15px;
    text-align: center;
    position: absolute;
    top: 45%; /* Позиционирано под заглавието */
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

/* Светлинен градиент от дясната страна */
.flipbook .cover.front::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 100%;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.1), transparent);
    box-shadow: -10px 0px 15px rgba(0, 0, 0, 0.3); /* Сянка за подсилване на дълбочината */
    pointer-events: none;
    z-index: 1;
}

/* Визуални корекции на металните ъгли */
.metal-corner {
    position: absolute;
    width: 50px;
    height: 50px;
    background: url('../images/metal-corner.png') no-repeat center;
    background-size: contain;
    z-index: 4; /* Над останалите елементи */
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.5); /* Сянка под металните ъгли */
}

.metal-corner.top-left {
    top: 5px;
    left: 5px;
    transform: none; /* Без завъртане */
}

.metal-corner.top-right {
    top: 5px;
    right: 5px;
    transform: rotate(90deg); /* Завъртане на 45 градуса */
}

.metal-corner.bottom-left {
    bottom: 5px;
    left: 5px;
    transform: rotate(270deg); /* Завъртане на 90 градуса */
}

.metal-corner.bottom-right {
    bottom: 5px;
    right: 5px;
    transform: rotate(180deg); /* Завъртане на 135 градуса */
}
/* Отзивчивост */
@media (max-width: 768px) {
    .flipbook {
        width: 90%; /* Адаптира се към ширината на екрана */
        height: auto; /* Автоматична височина спрямо пропорциите */
    }

    .flipbook .cover.front,
    .flipbook .page {
        width: 100%; /* Пълна ширина на flipbook */
        height: auto; /* Височината ще се адаптира спрямо ширината */
    }

    .metal-corner {
        width: 30px; /* Намаляване на размерите за малки екрани */
        height: 30px;
    }
    .flipbook .cover.front h1 {
        font-size: 40px; /* Умалено заглавие */
    }

    .flipbook .cover.front h2 {
        font-size: 18px; /* Умалено подзаглавие */
    }
}

@media (max-width: 480px) {
    .flipbook {
        width: 100%; /* За най-малки устройства */
        height: auto;
    }

    .flipbook .cover.front,
    .flipbook .page {
        padding: 15px; /* Намаляване на вътрешните отстъпи */
        font-size: 14px; /* По-малък текст */
    }

    .metal-corner {
        width: 20px;
        height: 20px;
    }
	.flipbook .cover.front h1 {
        font-size: 30px; /* По-компактен текст */
    }

    .flipbook .cover.front h2 {
        font-size: 14px;
    }
}