:root {
    --primary-color: #1a3366;
    --secondary-color: #ff6b35;
    --text-light: #f0f4ff;
    --background-dark: #0a1730;
    --background-gradient-start: #0a1730;
    --background-gradient-end: #2a4a8a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--background-gradient-start), var(--background-gradient-end));
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(10, 23, 48, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.site-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 101;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--text-light);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.audio-button {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-button i {
    color: var(--secondary-color);
}

.cover-section {
    width: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.cover-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    margin-bottom: 1.5rem;
}

.cover-img {
    width: 100%;
    height: auto;
    display: block;
}

.book-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.book-authors {
    font-size: 1.2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

.book-content {
    padding: 0 1rem 3rem;
    line-height: 1.6;
}

.book-content h1,
.book-content h2,
.book-content h3 {
    color: var(--secondary-color);
    margin: 1.5em 0 0.7em;
}

.book-content p {
    margin-bottom: 1em;
}

.book-content ul,
.book-content ol {
    margin: 0 0 1em 1.5em;
}

.book-content blockquote {
    border-left: 3px solid var(--secondary-color);
    padding-left: 1em;
    margin: 1em 0 1em 1em;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
}

/* Style dla tabel */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin: 1.5em 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

th {
    background-color: rgba(255, 107, 53, 0.2);
    color: var(--secondary-color);
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

.audiobook-info {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
}

.audiobook-info p {
    margin-bottom: 1rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.audiobook-parts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 600px) {
    .audiobook-parts {
        flex-direction: row;
        justify-content: space-between;
    }
}

.part {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    flex: 1;
}

.part-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.download-btn {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    margin-top: 0.5rem;
    transition: background-color 0.3s;
}

.download-btn:hover {
    background-color: #e55a2b;
}

.loading-message {
    text-align: center;
    padding: 2rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
}

/* Audio Player */
.audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(10, 23, 48, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 99;
}

.audio-player.active {
    transform: translateY(0);
}

.player-controls {
    flex: 1;
    display: flex;
    align-items: center;
}

.player-info {
    flex: 0 0 auto;
    margin-right: 1rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

audio {
    flex: 1;
    height: 30px;
}

.close-player {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 1rem;
}

/* Chapters Menu */
.chapter-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80%;
    max-width: 300px;
    background-color: rgba(10, 23, 48, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 5rem 1rem 1rem;
}

.chapter-menu.active {
    transform: translateX(0);
}

.chapter-title {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
}

.chapters {
    list-style-type: none;
}

.chapters li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: color 0.3s;
}

.chapters li:hover {
    color: var(--secondary-color);
}

/* Backgrounds */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: float 15s ease-in infinite;
}

@keyframes float {
    0% {
        opacity: 0;
        transform: translateY(0) rotate(0deg);
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) rotate(360deg);
    }
}

/* Overlay for menu open */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 768px) {
    .book-content {
        padding: 0 2rem 3rem;
        max-width: 800px;
        margin: 0 auto;
    }

    .cover-section {
        padding: 2rem;
    }

    .book-title {
        font-size: 2.5rem;
    }

    .menu-toggle span:first-child {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle span:last-child {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}