        :root {
            --transition-base: cubic-bezier(0.4, 0, 0.2, 1);
            --transition-smooth: cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            margin: 0;
            padding: 0;
            width: 100%;
            max-width: 100%;
            overflow-x: hidden;
        }
        
        body {
            margin: 0;
            padding: 0;
            width: 100vw;
            max-width: 100vw;
            overflow-x: hidden;
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 50%, #f0f4f8 100%);
            min-height: 100vh;
            transition: background 0.3s ease, transform 0.3s ease;
            transform-origin: top center;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
        }

        /* Wrapper dla zawartości z pomniejszeniem o 10% */
        .content-wrapper {
            width: 100%;
            max-width: 100%;
            transform: scale(0.9);
            transform-origin: center top;
            display: flex;
            flex-direction: column;
            align-items: center;
            margin: 0 auto;
        }

        body.zoom-50 {
            transform: scale(0.5);
        }

        body.zoom-75 {
            transform: scale(0.75);
        }

        body.zoom-90 {
            transform: scale(0.9);
            transform-origin: top center;
        }

        body.zoom-100 {
            transform: scale(1);
        }

        body.zoom-110 {
            transform: scale(1.1);
        }

        body.zoom-125 {
            transform: scale(1.25);
        }

        body.zoom-150 {
            transform: scale(1.5);
        }

        body.dark {
            background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e293b 100%);
        }

        /* Glassmorphism */
        .glass {
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(0, 0, 0, 0.05);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        }

        .dark .glass {
            background: rgba(30, 41, 59, 0.8);
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }

        /* Header */
        header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 100;
            width: 100vw;
            margin: 0;
            padding: 1rem 0;
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(0, 0, 0, 0.05);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            box-sizing: border-box;
        }

        .dark header {
            background: rgba(30, 41, 59, 0.8);
            border-bottom-color: rgba(255, 255, 255, 0.1);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }

        .header-content {
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 2rem;
        }

        .logo {
            font-family: 'Plus Jakarta Sans', sans-serif;
            font-size: 1.75rem;
            font-weight: 800;
            background: linear-gradient(135deg, #475569 0%, #64748b 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .dark .logo {
            background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .search-container {
            flex: 1;
            max-width: 500px;
            position: relative;
        }

        .search-input {
            width: 100%;
            padding: 0.75rem 1rem 0.75rem 3rem;
            border-radius: 0.75rem;
            border: none;
            font-size: 1rem;
            transition: all 0.3s var(--transition-base);
            background: rgba(255, 255, 255, 0.9);
            color: #1e293b;
        }

        .dark .search-input {
            background: rgba(30, 41, 59, 0.9);
            color: #f1f5f9;
        }

        .search-input:focus {
            outline: none;
            transform: scale(1.01);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .dark .search-input:focus {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .search-icon {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            opacity: 0.5;
        }

        .theme-toggle {
            width: 3rem;
            height: 3rem;
            border-radius: 50%;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s var(--transition-smooth);
            font-size: 1.25rem;
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(0, 0, 0, 0.05);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        }

        .dark .theme-toggle {
            background: rgba(30, 41, 59, 0.8);
            border-color: rgba(255, 255, 255, 0.1);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }

        .theme-toggle:hover {
            transform: rotate(180deg) scale(1.1);
        }

        /* Hero Section */
        .hero {
            text-align: center;
            padding: calc(1rem + 80px) 2rem 0; /* Minimalny padding - tylko odstęp od headera */
            max-width: 1400px;
            margin: 0 auto;
            width: 100%;
            box-sizing: border-box;
        }

        .hero h1 {
            font-family: 'Plus Jakarta Sans', sans-serif;
            font-size: clamp(2rem, 5vw, 3.5rem);
            font-weight: 800;
            margin: 0;
            padding: 2rem 0; /* Padding góra-dół dla wyśrodkowania napisu w pionie */
            color: #1e293b;
        }

        .dark .hero h1 {
            color: #f1f5f9;
        }

        .hero p {
            font-size: 1.25rem;
            color: #64748b;
            margin-bottom: 2rem;
        }

        .dark .hero p {
            color: #cbd5e1;
        }

        /* Books Grid */
        .books-container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 2rem;
            width: 100%;
            align-self: center;
            box-sizing: border-box;
        }

        .books-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 2rem;
        }

        @media (max-width: 768px) {
            .books-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (min-width: 769px) and (max-width: 1024px) {
            .books-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (min-width: 1025px) {
            .books-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        @media (min-width: 1400px) {
            .books-grid {
                grid-template-columns: repeat(4, 1fr);
            }
        }

        .book-card {
            background: rgba(255, 255, 255, 1);
            border-radius: 1.125rem;
            padding: 1.5rem;
            cursor: pointer;
            transition: all 0.3s var(--transition-base);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            position: relative;
            overflow: hidden;
            border: 1px solid rgba(0, 0, 0, 0.05);
        }

        .dark .book-card {
            background: rgba(30, 41, 59, 1);
            color: white;
            border-color: rgba(255, 255, 255, 0.1);
        }

        .book-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #94a3b8, #64748b);
            transform: scaleX(0);
            transition: transform 0.3s var(--transition-base);
        }

        .book-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        }

        .dark .book-card:hover {
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        }

        .book-card:hover::before {
            transform: scaleX(1);
        }

        .book-cover {
            width: 100%;
            aspect-ratio: 1516 / 2000;
            border-radius: 0.75rem;
            overflow: hidden;
            margin-bottom: 1rem;
            position: relative;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
            cursor: pointer;
            transition: transform 0.3s var(--transition-base);
        }

        .book-cover:hover {
            transform: scale(1.02);
        }

        .book-cover img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.4s var(--transition-smooth);
            opacity: 0;
        }

        .book-cover img.loaded {
            opacity: 1;
        }

        .book-card:hover .book-cover img {
            transform: scale(1.05);
        }

        .book-title {
            font-family: 'Plus Jakarta Sans', sans-serif;
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            color: #1a1a2e;
        }

        .dark .book-title {
            color: white;
        }

        .book-class {
            font-size: 0.9rem;
            color: #666;
            margin-bottom: 1rem;
        }

        .dark .book-class {
            color: #aaa;
        }

        .book-btn {
            width: 100%;
            padding: 0.75rem;
            border-radius: 0.5625rem;
            border: none;
            background: linear-gradient(135deg, var(--book-primary, #64748b) 0%, var(--book-secondary, #475569) 100%);
            color: white;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s var(--transition-base);
            position: relative;
            overflow: hidden;
        }

        .book-btn::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.2);
            transform: translate(-50%, -50%);
            transition: width 0.4s, height 0.4s;
        }

        .book-btn:hover::before {
            width: 200px;
            height: 200px;
        }

        .book-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px var(--book-primary-shadow, rgba(100, 116, 139, 0.3));
            background: linear-gradient(135deg, var(--book-secondary, #475569) 0%, var(--book-primary, #334155) 100%);
        }

        .book-btn:active {
            transform: translateY(0);
        }

        /* Empty State */
        .empty-state {
            grid-column: 1 / -1;
            text-align: center;
            padding: 4rem 2rem;
        }

        .empty-state-icon {
            font-size: 4rem;
            margin-bottom: 1rem;
            opacity: 0.5;
        }

        .empty-state-text {
            font-size: 1.25rem;
            color: #64748b;
        }

        .dark .empty-state-text {
            color: #cbd5e1;
        }

        /* Modal */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 1000;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 0.5rem 0;
            margin: 0;
            overflow-y: auto;
            width: 100vw;
            height: 100vh;
        }

        .modal.active {
            display: flex;
        }

        .modal-backdrop {
            display: none;
        }

        .modal-content {
            position: relative;
            background: white;
            border-radius: 1.5rem;
            max-width: 1400px;
            width: 100%;
            margin: 0 auto;
            max-height: calc(100vh - 1rem);
            min-height: auto;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            transform: translateY(-20px) scale(0.9);
            transform-origin: center center;
            opacity: 0;
            transition: all 0.4s var(--transition-smooth);
            z-index: 1002;
            border-top: 4px solid var(--book-primary, #64748b);
        }

        @media (min-width: 1400px) {
            .modal-content {
                margin: 0 auto;
            }
        }

        .dark .modal-content {
            background: #1a1a2e;
            color: white;
        }

        .modal.active .modal-content {
            transform: translateY(0) scale(0.9);
            opacity: 1;
        }

        @media (max-width: 768px) {
            .modal {
                padding: 0.5rem 0;
            }
            .modal-content {
                border-radius: 1rem;
                max-height: calc(100vh - 1rem);
                min-height: auto;
            }
        }

        .modal-header {
            padding: 1.5rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(0, 0, 0, 0.1);
            flex-shrink: 0;
        }

        .dark .modal-header {
            border-bottom-color: rgba(255, 255, 255, 0.1);
        }

        .modal-cover {
            width: 200px;
            height: 300px;
            border-radius: 0.75rem;
            overflow: hidden;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
            flex-shrink: 0;
            transform: scale(0.9);
            transform-origin: center center;
        }

        .modal-cover img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        @media (max-width: 768px) {
            .modal-cover {
                width: 150px;
                height: 225px;
                margin: 0 auto 1.5rem;
            }
        }

        .modal-title-section {
            flex: 1;
            margin-left: 2rem;
        }

        @media (max-width: 768px) {
            .modal-title-section {
                margin-left: 0;
                text-align: center;
            }
        }

        .modal-title {
            font-family: 'Plus Jakarta Sans', sans-serif;
            font-size: 2rem;
            font-weight: 800;
            margin-bottom: 0.5rem;
        }

        .modal-close {
            width: 2.5rem;
            height: 2.5rem;
            border-radius: 50%;
            border: none;
            background: rgba(0, 0, 0, 0.05);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            transition: all 0.3s var(--transition-base);
            flex-shrink: 0;
        }

        .dark .modal-close {
            background: rgba(255, 255, 255, 0.1);
            color: white;
        }

        .modal-close:hover {
            transform: rotate(90deg) scale(1.1);
            background: rgba(0, 0, 0, 0.1);
        }

        .modal-body {
            flex: 1;
            overflow-y: auto;
            padding: 1.5rem 2rem;
            min-height: 0;
        }

        .chapters-list {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .chapter-item {
            border-radius: 1rem;
            overflow: hidden;
            border: 1px solid rgba(0, 0, 0, 0.1);
            transition: all 0.3s var(--transition-base);
        }

        .dark .chapter-item {
            border-color: rgba(255, 255, 255, 0.1);
        }

        .chapter-header {
            padding: 1.25rem;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: rgba(0, 0, 0, 0.02);
            transition: all 0.3s var(--transition-base);
        }

        .section-header {
            margin-top: 1.5rem;
            margin-bottom: 0.75rem;
            padding: 0.75rem 1.25rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            background: rgba(0, 0, 0, 0.03);
            border-left: 4px solid var(--book-primary, #64748b);
            border-radius: 0.375rem;
        }

        .dark .section-header {
            background: rgba(255, 255, 255, 0.05);
        }

        .section-header:first-child {
            margin-top: 0;
        }

        .section-icon {
            font-size: 1.5rem;
            line-height: 1;
        }

        .section-title {
            font-family: 'Plus Jakarta Sans', sans-serif;
            font-size: 1.125rem;
            font-weight: 600;
            margin: 0;
            color: var(--text-primary, #1e293b);
        }

        .dark .section-title {
            color: var(--text-primary-dark, #f1f5f9);
        }

        .dark .chapter-header {
            background: rgba(255, 255, 255, 0.05);
        }

        .chapter-header:hover {
            background: rgba(0, 0, 0, 0.05);
        }

        .dark .chapter-header:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .chapter-title {
            font-family: 'Plus Jakarta Sans', sans-serif;
            font-size: 1.1rem;
            font-weight: 600;
            flex: 1;
        }

        .chapter-icon {
            transition: transform 0.3s var(--transition-base);
            font-size: 1.25rem;
            opacity: 0.6;
        }

        .chapter-item.expanded .chapter-icon {
            transform: rotate(180deg);
        }

        .chapter-content {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.4s var(--transition-base);
        }

        .chapter-item.expanded .chapter-content {
            max-height: 2000px;
        }

        .lessons-list {
            padding: 0 1.25rem 1.25rem;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .lesson-item {
            padding: 0.75rem 1rem;
            border-radius: 0.375rem;
            cursor: pointer;
            transition: all 0.2s var(--transition-base);
            border-left: 3px solid transparent;
        }

        .lesson-item:hover {
            background: var(--book-primary-hover, rgba(148, 163, 184, 0.1));
            border-left-color: var(--book-primary, #64748b);
            transform: translateX(2px);
        }

        .dark .lesson-item:hover {
            background: var(--book-primary-hover-dark, rgba(148, 163, 184, 0.15));
        }

        .lesson-text {
            font-size: 0.95rem;
            color: #475569;
        }

        .dark .lesson-text {
            color: #cbd5e1;
        }

        .lesson-item:hover .lesson-text {
            color: #334155;
            font-weight: 500;
        }

        .dark .lesson-item:hover .lesson-text {
            color: #f1f5f9;
        }

        /* Lesson Modal */
        .lesson-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 2000;
            display: none;
            align-items: flex-start;
            justify-content: center;
            padding: 1rem;
            padding-top: 2rem;
            overflow-y: auto;
            width: 100vw;
            height: 100vh;
        }

        .lesson-modal.active {
            display: flex;
        }

        .lesson-modal .modal-backdrop {
            display: none;
        }

        .lesson-modal-content {
            position: relative;
            background: white;
            border-radius: 1.5rem;
            max-width: 800px;
            width: 100%;
            max-height: auto;
            height: auto;
            margin: auto;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            transform: scale(0.95);
            opacity: 0;
            transition: all 0.4s var(--transition-smooth);
        }

        .lesson-modal-content.fullscreen {
            max-width: 100vw;
            width: 100vw;
            max-height: 100vh;
            height: 100vh;
            border-radius: 0;
            margin: 0;
            transform: scale(1);
            position: fixed;
            top: 0;
            left: 0;
        }

        .dark .lesson-modal-content {
            background: #1a1a2e;
            color: white;
        }

        .lesson-modal.active .lesson-modal-content {
            transform: scale(1);
            opacity: 1;
        }

        .lesson-modal-header {
            padding: 2rem;
            border-bottom: 1px solid rgba(0, 0, 0, 0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }

        .lesson-modal-content.fullscreen .lesson-modal-header {
            padding: 1rem 1.5rem;
            padding-right: 5rem;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 9999;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            height: auto;
        }

        .dark .lesson-modal-header {
            border-bottom-color: rgba(255, 255, 255, 0.1);
        }

        .dark .lesson-modal-content.fullscreen .lesson-modal-header {
            background: rgba(30, 41, 59, 0.95);
        }

        .lesson-breadcrumb {
            font-size: 0.9rem;
            color: #666;
            margin-bottom: 0.5rem;
        }

        .dark .lesson-breadcrumb {
            color: #aaa;
        }

        .lesson-modal-title {
            font-family: 'Plus Jakarta Sans', sans-serif;
            font-size: 1.75rem;
            font-weight: 800;
            margin-bottom: 0.5rem;
        }

        .lesson-modal-body {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 2rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 0;
        }

        .lesson-modal-content.fullscreen .lesson-modal-body {
            padding: 0;
            height: calc(100vh - 120px);
            overflow: hidden;
        }

        .lesson-play-container {
            text-align: center;
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
        }

        .lesson-debug-info {
            margin-top: 1rem;
            padding: 0.75rem 1.5rem;
            background: rgba(59, 130, 246, 0.1);
            border: 1px solid rgba(59, 130, 246, 0.3);
            border-radius: 0.5rem;
            font-size: 0.875rem;
            font-family: 'Courier New', monospace;
            color: #1e40af;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .dark .lesson-debug-info {
            background: rgba(59, 130, 246, 0.15);
            border-color: rgba(59, 130, 246, 0.4);
            color: #93c5fd;
        }

        .debug-label {
            font-weight: 600;
            opacity: 0.8;
        }

        .debug-id {
            font-weight: 700;
            color: #1e40af;
            font-size: 0.9rem;
        }

        .dark .debug-id {
            color: #60a5fa;
        }

        .lesson-play-button {
            padding: 1.5rem 3rem;
            border-radius: 0.75rem;
            border: none;
            background: linear-gradient(135deg, var(--book-primary, #64748b) 0%, var(--book-secondary, #475569) 100%);
            color: white;
            font-weight: 700;
            font-size: 1.25rem;
            cursor: pointer;
            transition: all 0.3s var(--transition-base);
            display: inline-flex;
            align-items: center;
            gap: 1rem;
            box-shadow: 0 4px 12px var(--book-primary-shadow, rgba(100, 116, 139, 0.3));
        }

        .lesson-play-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px var(--book-primary-shadow-hover, rgba(100, 116, 139, 0.4));
            background: linear-gradient(135deg, var(--book-secondary, #475569) 0%, var(--book-primary, #334155) 100%);
        }

        .lesson-play-button:active {
            transform: translateY(0);
        }

        .lesson-play-icon {
            font-size: 1.5rem;
        }

        .lesson-iframe-container {
            width: 100%;
            height: 100%;
            position: relative;
            display: none;
        }

        .lesson-iframe-container.active {
            display: flex;
            flex-direction: column;
        }

        .lesson-modal-content.fullscreen .lesson-iframe-container.active {
            height: calc(100vh - 120px);
            margin-top: 60px;
            margin-bottom: 60px;
        }

        .lesson-iframe {
            width: 100%;
            height: 100%;
            border: none;
            border-radius: 0.75rem;
            flex: 1;
        }

        .lesson-modal-content.fullscreen .lesson-iframe {
            border-radius: 0;
        }

        .lesson-iframe-controls {
            display: flex;
            justify-content: flex-end;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            background: rgba(0, 0, 0, 0.02);
            flex-shrink: 0;
        }

        .lesson-modal-content.fullscreen .lesson-iframe-controls {
            position: absolute;
            top: 1rem;
            right: 5rem;
            z-index: 9998;
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(10px);
            border-radius: 0.375rem;
            padding: 0.25rem 0.5rem;
        }

        .dark .lesson-modal-content.fullscreen .lesson-iframe-controls {
            background: rgba(30, 41, 59, 0.9);
        }

        .fit-page-btn {
            padding: 0.5rem 1rem;
            border-radius: 0.375rem;
            border: 1px solid rgba(0, 0, 0, 0.1);
            background: white;
            color: #475569;
            font-size: 0.875rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s var(--transition-base);
        }

        .dark .fit-page-btn {
            background: rgba(30, 41, 59, 1);
            border-color: rgba(255, 255, 255, 0.1);
            color: #cbd5e1;
        }

        .fit-page-btn:hover {
            background: rgba(0, 0, 0, 0.05);
        }

        .dark .fit-page-btn:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .fit-page-btn.active {
            background: #64748b;
            color: white;
            border-color: #64748b;
        }

        .lesson-navigation {
            padding: 1.5rem 2rem;
            border-top: 1px solid rgba(0, 0, 0, 0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
            flex-shrink: 0;
        }

        .lesson-modal-content.fullscreen .lesson-navigation {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 9999;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-top: 1px solid rgba(0, 0, 0, 0.1);
            height: auto;
        }

        .dark .lesson-navigation {
            border-top-color: rgba(255, 255, 255, 0.1);
        }

        .dark .lesson-modal-content.fullscreen .lesson-navigation {
            background: rgba(30, 41, 59, 0.95);
        }

        .nav-button {
            padding: 0.75rem 1.5rem;
            border-radius: 0.5625rem;
            border: none;
            background: linear-gradient(135deg, #64748b 0%, #475569 100%);
            color: white;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s var(--transition-base);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .nav-button:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .nav-button:not(:disabled):hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
            background: linear-gradient(135deg, #475569 0%, #334155 100%);
        }

        .lesson-close {
            width: 2.5rem;
            height: 2.5rem;
            border-radius: 50%;
            border: none;
            background: rgba(0, 0, 0, 0.05);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            transition: all 0.3s var(--transition-base);
            flex-shrink: 0;
        }

        .lesson-modal-content.fullscreen .lesson-close {
            position: fixed;
            top: 1rem;
            right: 1rem;
            z-index: 10001;
            background: rgba(255, 255, 255, 0.95);
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
            width: 3rem;
            height: 3rem;
        }

        .dark .lesson-close {
            background: rgba(255, 255, 255, 0.1);
            color: white;
        }

        .dark .lesson-modal-content.fullscreen .lesson-close {
            background: rgba(30, 41, 59, 0.95);
            color: white;
        }

        .lesson-close:hover {
            transform: rotate(90deg) scale(1.1);
        }

        /* Lesson Viewer Modal (nowy modal po kliknięciu Play) */
        .lesson-viewer-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 3000;
            display: none;
            width: 100vw;
            height: 100vh;
        }

        .lesson-viewer-modal.active {
            display: flex;
        }

        .lesson-viewer-modal .modal-backdrop {
            display: none;
        }

        .lesson-viewer-modal-content {
            position: relative;
            width: 100vw;
            height: 100vh;
            background: white;
            display: flex;
            flex-direction: column;
        }

        .dark .lesson-viewer-modal-content {
            background: #1a1a2e;
        }

        .lesson-viewer-close {
            position: fixed;
            top: 1rem;
            right: 1rem;
            z-index: 3001;
            width: 3rem;
            height: 3rem;
            border-radius: 50%;
            border: none;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            transition: all 0.3s var(--transition-base);
        }

        .dark .lesson-viewer-close {
            background: rgba(30, 41, 59, 0.95);
            color: white;
        }

        .lesson-viewer-close:hover {
            transform: rotate(90deg) scale(1.1);
        }

        .lesson-viewer-iframe {
            width: 100%;
            height: 100%;
            border: none;
            flex: 1;
        }

        .modal-footer {
            padding: 1rem 2rem;
            border-top: 1px solid rgba(0, 0, 0, 0.1);
            display: flex;
            justify-content: flex-end;
            flex-shrink: 0;
        }

        .dark .modal-footer {
            border-top-color: rgba(255, 255, 255, 0.1);
        }

        .cta-button {
            padding: 0.875rem 2rem;
            border-radius: 0.5625rem;
            border: none;
            background: linear-gradient(135deg, #64748b 0%, #475569 100%);
            color: white;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s var(--transition-base);
            font-size: 1rem;
        }

        .cta-button:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
            background: linear-gradient(135deg, #475569 0%, #334155 100%);
        }

        .cta-button:active {
            transform: translateY(0);
        }

        /* Scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
        }

        ::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.05);
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.5);
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: rgba(148, 163, 184, 0.7);
        }

        /* Loading State */
        .book-cover::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            animation: shimmer 1.5s infinite;
        }

        @keyframes shimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }

        .book-cover img.loaded + ::after {
            display: none;
        }

        /* Focus States for Accessibility */
        *:focus-visible {
            outline: 2px solid #64748b;
            outline-offset: 2px;
        }

        /* Animations */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .book-card {
            animation: fadeInUp 0.6s var(--transition-base) backwards;
        }

        .book-card:nth-child(1) { animation-delay: 0.1s; }
        .book-card:nth-child(2) { animation-delay: 0.2s; }
        .book-card:nth-child(3) { animation-delay: 0.3s; }
        .book-card:nth-child(4) { animation-delay: 0.4s; }
        .book-card:nth-child(5) { animation-delay: 0.5s; }
        .book-card:nth-child(6) { animation-delay: 0.6s; }
        .book-card:nth-child(7) { animation-delay: 0.7s; }
