:root {
    --kumkum-red: #D32F2F;
    --marigold: #FFC107;
    --indigo: #303F9F;
    --saffron: #FF9933;
    --paper-bg: #FDFBF7;
    --border-color: #8D6E63;
    --flap-cover: #E53935;
    --holy-orange: #FF5722;
}

.jmk-wrapper {
    font-family: 'Poppins', 'Mukta', sans-serif;
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
}

.jmk-header { text-align: center; margin-bottom: 30px; }
.jmk-title { font-size: 3.5rem; margin: 0 0 15px 0; font-weight: 800; color: var(--kumkum-red); text-shadow: 2px 2px 0px var(--marigold); }

.jmk-toggle { display: inline-block; background: #eee; border-radius: 30px; padding: 5px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.1); }
.jmk-toggle input { display: none; }
.jmk-toggle-label { display: flex; cursor: pointer; font-size: 1.2rem; font-weight: bold; }
.jmk-toggle-label span { padding: 8px 20px; border-radius: 25px; transition: 0.3s; color: #555; }

#jmk-lang-toggle:not(:checked) ~ .jmk-toggle-label .jmk-toggle-hi,
#jmk-lang-toggle:checked ~ .jmk-toggle-label .jmk-toggle-mr {
    background: var(--indigo); color: white; box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.jmk-book-container { perspective: 1500px; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

.jmk-book-spread {
    display: flex; background: var(--paper-bg); border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3), inset 0 0 40px rgba(0,0,0,0.05);
    position: relative; border: 4px solid var(--border-color); min-height: 550px;
    background-image: repeating-linear-gradient(transparent, transparent 39px, rgba(0,0,0,0.05) 40px);
}

.jmk-binding-crease {
    width: 40px; background: linear-gradient(to right, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.05) 100%);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.3); z-index: 5;
}

.jmk-page { flex: 1; padding: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-content: start; }

.jmk-window { perspective: 1000px; height: 350px; position: relative; cursor: pointer; }
.jmk-flap-inner { position: relative; width: 100%; height: 100%; transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1); transform-style: preserve-3d; }
.jmk-window.open .jmk-flap-inner { transform: rotateY(-180deg); }

.jmk-flap-front, .jmk-flap-back {
    position: absolute; width: 100%; height: 100%; backface-visibility: hidden;
    border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); display: flex; flex-direction: column;
    align-items: center; justify-content: center; box-sizing: border-box;
}

.jmk-flap-front { background: var(--flap-cover); color: var(--marigold); font-size: 4rem; font-weight: bold; border: 3px solid var(--saffron); }
.jmk-flap-front::before {
    content: ''; position: absolute; top: -10px; left: 50%; transform: translateX(-50%) rotate(-3deg);
    width: 50px; height: 15px; background: rgba(255, 255, 255, 0.7); box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.jmk-flap-back { background: white; transform: rotateY(180deg); border: 2px dashed var(--indigo); padding: 15px; overflow: hidden; }

.jmk-main-word {
    font-size: 1.6rem; font-weight: bold; color: var(--kumkum-red); margin-bottom: 15px;
    cursor: pointer; text-align: center; padding: 5px; border-radius: 5px; transition: 0.2s; line-height: 1.2;
}
.jmk-main-word:hover { background: #fff3e0; transform: scale(1.05); }

.jmk-matra-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.jmk-matra-item {
    background: var(--marigold); color: #000; padding: 5px 12px; border-radius: 4px;
    font-weight: bold; font-size: 1.2rem; cursor: pointer; transition: 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.jmk-matra-item:hover { background: var(--holy-orange); color: white; transform: translateY(-2px); }

/* SVG DETAIL VIEW */
.jmk-detail-view {
    background: var(--paper-bg); border-radius: 10px; border: 8px solid var(--marigold);
    padding: 40px; min-height: 550px; box-shadow: 0 20px 40px rgba(0,0,0,0.3); animation: fadeIn 0.5s ease;
}

.jmk-detail-header { display: flex; align-items: center; margin-bottom: 40px; border-bottom: 2px solid var(--saffron); padding-bottom: 20px; }
.jmk-detail-title { font-size: 4rem; color: var(--kumkum-red); margin: 0 auto; text-align: center; background: #fff; padding: 0 40px; border-radius: 50px; border: 3px solid var(--marigold); }
.jmk-btn-back { background: var(--indigo); margin-right: 20px; }

.jmk-svg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }
.jmk-svg-card { background: #fff; border-radius: 12px; padding: 30px; text-align: center; box-shadow: 0 10px 20px rgba(0,0,0,0.1); border-top: 6px solid var(--kumkum-red); transition: transform 0.3s; }
.jmk-svg-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.15); }

.jmk-svg-container { width: 100%; height: 200px; margin-bottom: 20px; display: flex; align-items: center; justify-content: center; }
.jmk-svg-container svg { max-width: 100%; max-height: 100%; }

.jmk-svg-desc { font-size: 1.3rem; color: #444; line-height: 1.6; font-weight: 500; }
.jmk-no-data { font-size: 1.5rem; color: #666; text-align: center; width: 100%; padding: 40px; font-style: italic; }

.jmk-pagination { margin-top: 30px; display: flex; justify-content: space-between; align-items: center; }
.jmk-btn { background: var(--kumkum-red); color: white; border: none; padding: 12px 25px; border-radius: 25px; cursor: pointer; font-size: 1.1rem; font-weight: bold; box-shadow: 0 4px 6px rgba(0,0,0,0.2); }
.jmk-btn:disabled { background: #ccc; cursor: not-allowed; box-shadow: none; }

@media (max-width: 768px) {
    .jmk-book-spread { flex-direction: column; }
    .jmk-binding-crease { width: 100%; height: 20px; background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.05) 100%); }
    .jmk-page { grid-template-columns: 1fr; }
    .jmk-window { height: 320px; }
    .jmk-detail-title { font-size: 2.5rem; padding: 0 20px; }
    .jmk-detail-header { flex-direction: column; gap: 20px; }
}