:root {
    --primary-color: #2A5C82;
    --secondary-color: #F5A623;
    --accent-color: #27AE60;
    --text-dark: #2C3E50;
    --text-light: #ECF0F1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

.services-hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 8rem 0;
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4rem;
    padding: 0 2rem;
}

.animated-book {
    perspective: 2000px;
    position: relative;
    width: 400px;
    height: 500px;
}

.book-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateY(-15deg);
}

.book-cover {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transform-origin: left center;
    backface-visibility: hidden;
    z-index: 30;
    border-radius: 5px 15px 15px 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.book-spine {
    position: absolute;
    left: -15px;
    top: 0;
    width: 15px;
    height: 100%;
    background: #f0f0f0;
    transform: rotateY(90deg);
    border-radius: 3px 0 0 3px;
    box-shadow: inset -5px 0 10px rgba(0,0,0,0.1);
}

.pages-container {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.page {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transform-origin: left center;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    border-radius: 0 8px 8px 0;
    animation-duration: 116s;
    animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
    animation-iteration-count: infinite;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.1);
}

@keyframes pageTurn {
    0% {
        transform: rotateY(0deg);
        z-index: 1;
        filter: brightness(1);
    }
    2% {
        transform: rotateY(-10deg);
        z-index: 2;
    }
    4% {
        transform: rotateY(-30deg);
        z-index: 1;
    }
    6% {
        transform: rotateY(-60deg);
        filter: brightness(0.98);
    }
    8% {
        transform: rotateY(-90deg);
        z-index: -1;
    }
    10%, 100% {
        transform: rotateY(-180deg);
        z-index: -1;
        filter: brightness(0.95);
    }
}

.p1 { animation-name: pageTurn; animation-delay: 0s }
.p2 { animation-name: pageTurn; animation-delay: 4s }
.p3 { animation-name: pageTurn; animation-delay: 8s }
.p4 { animation-name: pageTurn; animation-delay: 12s }
.p5 { animation-name: pageTurn; animation-delay: 16s }
.p6 { animation-name: pageTurn; animation-delay: 20s }
.p7 { animation-name: pageTurn; animation-delay: 24s }
.p8 { animation-name: pageTurn; animation-delay: 28s }
.p9 { animation-name: pageTurn; animation-delay: 32s }
.p10 { animation-name: pageTurn; animation-delay: 36s }
.p11 { animation-name: pageTurn; animation-delay: 40s }
.p12 { animation-name: pageTurn; animation-delay: 44s }
.p13 { animation-name: pageTurn; animation-delay: 48s }
.p14 { animation-name: pageTurn; animation-delay: 52s }
.p15 { animation-name: pageTurn; animation-delay: 56s }
.p16 { animation-name: pageTurn; animation-delay: 60s }
.p17 { animation-name: pageTurn; animation-delay: 64s }
.p18 { animation-name: pageTurn; animation-delay: 68s }
.p19 { animation-name: pageTurn; animation-delay: 72s }
.p20 { animation-name: pageTurn; animation-delay: 76s }
.p21 { animation-name: pageTurn; animation-delay: 80s }
.p22 { animation-name: pageTurn; animation-delay: 84s }
.p23 { animation-name: pageTurn; animation-delay: 88s }
.p24 { animation-name: pageTurn; animation-delay: 92s }
.p25 { animation-name: pageTurn; animation-delay: 96s }
.p26 { animation-name: pageTurn; animation-delay: 100s }
.p27 { animation-name: pageTurn; animation-delay: 104s }
.p28 { animation-name: pageTurn; animation-delay: 108s }
.p29 { animation-name: pageTurn; animation-delay: 112s }

.hero-content {
    flex: 1;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    word-wrap: break-word;
}

.title-line {
    display: block;
}

.highlight {
    color: var(--primary-color);
    position: relative;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #495057;
    margin-bottom: 2rem;
    max-width: 500px;
    line-height: 1.4;
}

.series-showcase {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.series-card {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.series-card:hover {
    transform: translateY(-5px);
}

.book-animation {
    position: relative;
    perspective: 1000px;
}

.book {
    width: 200px;
    height: 280px;
    border-radius: 5px 10px 10px 5px;
    transform-style: preserve-3d;
    animation: bookOpen 5s infinite;
    background-size: cover;
    background-position: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

@keyframes bookOpen {
    0%, 100% { transform: rotateY(-20deg) }
    50% { transform: rotateY(-35deg) }
}

.series-content h3 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.series-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.series-tags span {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.series-features {
    padding: 4rem 2rem;
    background: #f9f9f9;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon img {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
}

@media (max-width: 1200px) {
    .hero-container {
        padding: 0 1.5rem;
        gap: 3rem;
    }
    .hero-title {
        font-size: 3rem;
    }
    .animated-book {
        width: 350px;
        height: 450px;
    }
    .series-showcase {
        padding: 4rem 1.5rem;
    }
}

@media (max-width: 992px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
        padding: 6rem 2rem;
    }
    .animated-book {
        width: 300px;
        height: 400px;
    }
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    .hero-subtitle {
        font-size: 1.1rem;
        max-width: 100%;
        margin: 0 auto 2rem auto;
        padding: 0 1rem;
    }
    .series-card {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    .book {
        width: 160px;
        height: 230px;
        margin: 0 auto;
    }
    .section-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .services-hero {
        padding: 6rem 0;
    }
    .animated-book {
        width: 260px;
        height: 340px;
    }
    .book-cover {
        width: 260px;
        height: 340px;
    }
    .hero-title {
        font-size: 2.2rem;
        padding: 0 1rem;
    }
    .hero-subtitle {
        font-size: 1rem;
        padding: 0 0.5rem;
    }
    .series-card {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .feature-card {
        padding: 1.5rem;
    }
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-container {
        padding: 4rem 1rem;
    }
    .animated-book {
        width: 220px;
        height: 300px;
    }
    .book-cover {
        width: 220px;
        height: 300px;
    }
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.3;
        margin-bottom: 1rem;
        hyphens: auto;
    }
    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.5;
        padding: 0 0.5rem;
    }
    .book {
        width: 140px;
        height: 200px;
    }
    .series-content h3 {
        font-size: 1.5rem;
    }
    .series-content p {
        font-size: 0.9rem;
    }
    .series-tags span {
        font-size: 0.8rem;
    }
    .section-title {
        font-size: 1.8rem;
    }
    .feature-icon img {
        width: 60px;
        height: 60px;
    }
    .feature-card h3 {
        font-size: 1.2rem;
    }
    .feature-card p {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .hero-container {
        padding: 3rem 0.5rem;
    }
    .animated-book {
        width: 200px;
        height: 260px;
    }
    .book-cover {
        width: 200px;
        height: 260px;
    }
    .hero-title {
        font-size: 1.6rem;
        padding: 0 0.5rem;
    }
    .hero-subtitle {
        font-size: 0.9rem;
        padding: 0;
    }
    .series-card {
        padding: 1rem;
    }
    .section-title {
        font-size: 1.6rem;
    }
}