/* Styling to match the physical book */
:root {
    --book-blue: #009ce5;
    --book-light-gray: #e6e6e6;
    --book-text: #2c2c2c;
}

body {
    background-color: #f0f0f5; /* Slight gray background around the book */
    color: var(--book-text);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 20px;
}

.book-page {
    background-color: #ffffff;
    max-width: 850px;
    margin: 0 auto 40px;
    padding: 50px 60px 80px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* Top Right Ribbon */
.lesson-ribbon {
    position: absolute;
    top: 0;
    right: 50px;
    background-color: var(--book-blue);
    color: white;
    padding: 20px 30px 40px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 85%, 0 100%);
    text-transform: uppercase;
}

.lesson-ribbon .num {
    display: block;
    font-size: 2.2rem;
    margin-top: 5px;
}

.page-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: #222;
}

/* Section Tabs */
.section-tab {
    display: inline-block;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    padding: 10px 50px 10px 20px;
    margin-left: -60px;
    margin-bottom: 30px;
    clip-path: polygon(0 0, 90% 0, 100% 50%, 90% 100%, 0 100%);
}

.tab-black {
    background-color: #1a1a1a;
}

.tab-blue {
    background-color: var(--book-blue);
}

/* Layouts */
.flex-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.flex-between {
    justify-content: space-between;
}

.flex-start {
    align-items: flex-start;
}

/* Speech Bubbles */
.bubble {
    background-color: var(--book-light-gray);
    padding: 20px 25px;
    border-radius: 40px;
    font-size: 1.2rem;
    font-weight: 500;
    position: relative;
    text-align: center;
    max-width: 250px;
    line-height: 1.4;
}

.bubble-left::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 40px;
    border-width: 15px 15px 0;
    border-style: solid;
    border-color: var(--book-light-gray) transparent transparent transparent;
}

.bubble-right::after {
    content: '';
    position: absolute;
    bottom: -15px;
    right: 40px;
    border-width: 15px 15px 0;
    border-style: solid;
    border-color: var(--book-light-gray) transparent transparent transparent;
}

/* Numbers and Inputs */
.num-text {
    font-size: 1.8rem;
    font-weight: 500;
}

.instruction-text {
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 20px;
}

.number-sequence {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.input-box {
    width: 60px;
    height: 45px;
    border: 2px solid #a0d8f1; /* Light blue border like the book */
    font-size: 1.6rem;
    text-align: center;
    font-family: inherit;
    font-weight: 500;
    color: #222;
    outline: none;
    transition: all 0.3s;
}

.input-box:focus {
    border-color: var(--book-blue);
    box-shadow: 0 0 8px rgba(0, 156, 229, 0.4);
}

.input-box.correct {
    border-color: #34c759;
    background-color: rgba(52, 199, 89, 0.1);
}

.input-box.wrong {
    border-color: #ff3b30;
    background-color: rgba(255, 59, 48, 0.1);
    animation: shake 0.4s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

/* Characters and Signs */
.character-holding-signs {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-right: 20px;
}

.signs-container {
    display: flex;
    gap: 3px;
    margin-bottom: 5px;
    z-index: 2;
}

.sign {
    background-color: white;
    border: 2px solid #333;
    border-radius: 4px;
    width: 25px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    position: relative;
}

.sign-dots {
    position: absolute;
    bottom: 2px;
    font-size: 10px;
    letter-spacing: 1px;
    line-height: 0.5;
}

.char-body {
    font-size: 4rem;
    line-height: 1;
    margin-top: -15px;
}

/* Practice layout */
.practice-item {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
}

.circle-num {
    background-color: #222;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 20px;
    flex-shrink: 0;
}

/* Back button */
.back-nav {
    margin-bottom: 20px;
    max-width: 850px;
    margin: 0 auto 20px;
}
.back-nav a {
    color: var(--book-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Page number */
.page-number {
    position: absolute;
    bottom: 30px;
    left: 40px;
    background-color: var(--book-blue);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Corkboard */
.corkboard {
    background-color: #dcb38a;
    border: 10px solid #b57a53;
    padding: 20px;
    width: 250px;
    height: 180px;
    position: relative;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.3);
}

.pinned-note {
    background-color: white;
    width: 30px;
    height: 40px;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    border-radius: 2px;
}

.pinned-note::before {
    content: '';
    position: absolute;
    top: 3px;
    width: 4px;
    height: 4px;
    background-color: #34c759;
    border-radius: 50%;
    box-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

.note-1 { top: 15%; left: 20%; }
.note-2 { top: 40%; right: 10%; }
.note-3 { top: 45%; left: 10%; }
.note-4 { top: 20%; right: 30%; }
.note-5 { top: 35%; left: 45%; }
.note-6 { top: 10%; right: 15%; }
.note-7 { bottom: 10%; right: 20%; }
.note-8 { bottom: 15%; left: 35%; }
.note-9 { bottom: 25%; right: 40%; }
.note-10 { bottom: 10%; left: 15%; }

/* Responsive styles for tablets and phones */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .book-page {
        padding: 30px 20px 60px;
        margin-bottom: 20px;
    }
    .lesson-ribbon {
        right: 0;
        padding: 10px 15px 20px;
        font-size: 1rem;
    }
    .lesson-ribbon .num {
        font-size: 1.5rem;
    }
    .page-title {
        font-size: 2rem;
        margin-top: 20px;
        margin-bottom: 30px;
    }
    .flex-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .bubble {
        margin-bottom: 15px;
    }
    .bubble-left::after, .bubble-right::after {
        display: none;
    }
    .section-tab {
        margin-left: -20px;
        font-size: 1.2rem;
        padding: 8px 30px 8px 15px;
    }
    .practice-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }
    .circle-num {
        margin-right: 0;
    }
    .page-number {
        left: 20px;
        bottom: 20px;
    }
}
