

/* Common elements for styles * -----------------------------------*/
.topic-content {
    box-sizing: border-box;
    width: 80%;
    margin: 30px 0 10px 0;
    padding: 10px 15px;
}

.topic-content .a1 {
    padding: 10px 25px;
    border-bottom: solid 1px rgb(167, 167, 167);
} 




/* Style A1 ------------------------------------------------------ */

.topic-content #topic-title {
    color: rgb(87, 87, 87);
    text-shadow: 1px 1px 2px rgb(255, 255, 255);
    font-size: clamp(1.5rem, 3vw, 2.5rem); 
    margin: 25px 0 40px 0;
    text-align: center;
    text-justify: auto;
}


.a1-word-box {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 20px;
    margin: 30px 0 10px 0;
    }

.a1-word-box .vocab-box {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.a1-word-box .vocab-box #word-text {
    min-width: 80px;
        text-align: center;
}

.vocab-box #word-text a {
    text-decoration: none;
    font-size: 3rem;
    color: rgb(49, 49, 49);
    text-shadow: 1px 1px 2px rgb(207, 207, 207);
    font-weight: bold;
}


.a1-word-box .vocab-box #word-sound {
    color: rgb(49, 49, 49);
    }


.a1-word-box #word-image img {
    width: 250px;
    height: 220px;
    }


.a1-examples-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0;
    margin: 0;
}

.a1-examples-box .example-box {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.example-box  #example-text {
    margin: 10px 0;
    font-size: 1.3rem;
    color: rgb(49, 49, 49);
}

.example-box #example-sound {
    margin: 10px 0;
    font-size: 1rem;
}





/* Style A2 ======================================================== */
.a2-container {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.a2-card {
    cursor: pointer;
    width: 200px;
    height: 200px;
    perspective: 1000px;
    margin: 10px;
    display: inline-block;
}

.a2-card-inner {
    width: 100%;
    height: 100%;
    -webkit-transform-style: preserve-3d;
    -ms-transform-style: preserve-3d;
    transform-style: preserve-3d;
    -webkit-transition: -webkit-transform 0.5s;
    -moz-transition: -moz-transform 0.5s;
    -o-transition: -o-transform 0.5s;
    transition: transform 0.5s;
    position: relative;
}

.a2-card-inner.flipped {
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    -ms-transform: rotateY(180deg);
    transform: rotateY(180deg);
}

.a2-card-front, .a2-card-back {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    background-color: #fff;
    border: 1px solid #c7c7c7;
    box-shadow: 2px 2px 7px 4px rgba(240, 240, 240, 0.7);
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

.a2-card-front {
    z-index: 2;
    transform: rotateY(0deg);
}

.a2-card-front img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    -webkit-transition: -webkit-transform 0.3s ease;
    -moz-transition: -moz-transform 0.3s ease;
    -o-transition: -o-transform 0.3s ease;
    transition: transform 0.3s ease;
}

.a2-card-front img:hover {
    -webkit-transform: scale(1.05);
    -moz-transform: scale(1.05);
    -o-transform: scale(1.05);
    transform: scale(1.05);
}

.a2-audio-icon {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 25px;
    color: #1616163f;
    cursor: pointer;
    z-index: 3;
    -webkit-transition: color 0.3s ease;
    -moz-transition: color 0.3s ease;
    -o-transition: color 0.3s ease;
    transition: color 0.3s ease;
}

.a2-audio-icon i:hover {
    color: #55cfff;
}

.a2-card-back {
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    -ms-transform: rotateY(180deg);
    transform: rotateY(180deg);
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
}

.a2-card-back h2 {
    font-size: 1.5rem;
    margin: 0;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    font-family: 'Arial', sans-serif;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(231, 231, 231, 0.9);
    letter-spacing: 0.05em;
    text-transform: capitalize;
    line-height: 1.2;
    text-align: center;
    color: #4b4b4b;
}



/* Style D2 ========================================================= */
.d2-container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--white-color);
    border-radius: 10px;
    padding: 30px 0;
    box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.05);
    -webkit-transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
    -moz-transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
    -o-transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
    transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
}

/* Main Image ----------------------- */
.d2-image {
    width: 100%;
    margin: 0;
    max-height: 478px;
    height: auto;
    object-fit: cover; 
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
}

/* Title --------------------------------------------- */
.d2-title {
    font-size: calc(2em + 0.4vw);
    text-align: center;
    color: #454545;
    margin: 0;
    padding: 30px 0;
    text-transform: capitalize;
    text-shadow: #ffffff 2px 2px 5px;
    letter-spacing: 1px;
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    border-bottom: 2px solid #e0e0e0;
    font-family: 'Helvetica Neue', sans-serif;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0; 
}

/* Text ------------------------------------------ */
.d2-text {
    font-size: calc(1em + 0.25vw);
    line-height: 1.8;
    margin-bottom: 30px;
    padding: 10px 15px;
    text-align: justify;
}


/* Word Group ----------------------------------- */
.d2-word-group {
    position: relative;     display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    border-top: 1px solid #b8b8b8;
    padding: 1rem 1rem 1rem 3rem;
    box-sizing: border-box; }

/* Title within the word group */
.d2-word-group-title h2 {
    margin: 60px 0 10px 0;
    font-size: 2rem;
    color: #474747;
    text-align: center;     font-family: 'Helvetica Neue', sans-serif;
}

/* Individual word box */
.d2-wordbox {
    position: relative;
    min-width: 150px; 
    height: 3rem; 
    border: 1px solid #b8b8b8;
    border-radius: 5px;
    margin: 5px;
    cursor: pointer;
    perspective: 1000px; 
    overflow: hidden;
    box-sizing: border-box; 
    background-color: #ffffff; 
    -webkit-transition: box-shadow 0.3s ease;
    -moz-transition: box-shadow 0.3s ease;
    -o-transition: box-shadow 0.3s ease;
    transition: box-shadow 0.3s ease;
}

/* Inner container for flipping */
.d2-wordbox-inner {
    width: 100%;
    height: 100%;
    -webkit-transform-style: preserve-3d;
    -ms-transform-style: preserve-3d;
    transform-style: preserve-3d;
    -webkit-transition: transform 0.5s;
    -moz-transition: transform 0.5s;
    -o-transition: transform 0.5s;
    transition: transform 0.5s;
    position: relative;
}

/* Front of the word box */
.d2-wordbox-front,
.d2-wordbox-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    border-radius: 5px;     box-sizing: border-box;
}

.d2-wordbox-front {
    background: #effefffe;
    font-size: 1.2rem;
    z-index: 2;     transform: rotateY(0deg);
}

.d2-wordbox-front img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;     -webkit-transition: -webkit-transform 0.3s ease;
    -moz-transition: -moz-transform 0.3s ease;
    -o-transition: -o-transform 0.3s ease;
    transition: transform 0.3s ease;
}

.d2-wordbox-front img:hover {
    -webkit-transform: scale(1.05);
    -moz-transform: scale(1.05);
    -o-transform: scale(1.05);
    transform: scale(1.05);
}

.d2-wordbox-back {
    background: #f5fafafe;
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    -ms-transform: rotateY(180deg);
    transform: rotateY(180deg);
    font-size: 1rem + 0.8vw;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 0 20px;
    color: #4e4e4e;
    text-align: center;
    word-wrap: break-word;
    white-space: normal;
}

.d2-wordbox-inner.flipped {
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    -ms-transform: rotateY(180deg);
    transform: rotateY(180deg);
}

.d2-wordbox-wtype {
    font-size: 0.85rem;
    color: #555;     margin-top: 5px;
}

.d2-highlighted-word {
    position: relative;
    cursor: pointer;
    background-color: rgba(255, 255, 119, 0.283);
    border-bottom: 1px dashed #333;
    text-align: left;
    padding: 2px 5px; 
    border-radius: 3px; 
    -webkit-transition: background-color 0.3s ease, border-bottom-color 0.3s ease;
    -moz-transition: background-color 0.3s ease, border-bottom-color 0.3s ease;
    -o-transition: background-color 0.3s ease, border-bottom-color 0.3s ease;
    transition: background-color 0.3s ease, border-bottom-color 0.3s ease;
}

.d2-highlighted-word::after {
    content: attr(data-vocabulary) ": " attr(data-meaning);
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px;
    border-radius: 5px;
    top: 100%;  
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 10;
    font-size: 0.9rem;
    max-width: 400px;
    word-wrap: break-word;
    display: none;  
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.d2-highlighted-word:hover::after {
    display: block;
    white-space: normal;
    word-wrap: break-word;
    width: auto;
    min-width: 250px;
    max-width: 400px;
}

.d2-highlighted-word:hover::after {
    left: 50%;
    transform: translateX(-50%);
}





/* Style X2 ============================================================ */

.topic-content {
    box-sizing: border-box;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.x2-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--white-color, #ffffff);
    border-radius: 10px;
    padding: 30px 20px; 
    box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.05);
    -webkit-transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
    -moz-transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
    -o-transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
    transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.x2-image {
    width: 100%;
    margin: 0;
    max-height: 478px;
    height: auto;
    object-fit: cover; 
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
}

.x2-title {
    font-size: 28px; 
    text-align: center;
    color: rgb(61, 61, 61);
    text-shadow: 2px 2px 5px #ffffff; 
    text-transform: capitalize;
    letter-spacing: 1px;
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-family: 'Helvetica Neue', sans-serif;
    -webkit-transition: background-color 0.3s ease;
    -moz-transition: background-color 0.3s ease;
    -o-transition: background-color 0.3s ease;
    transition: background-color 0.3s ease;
    border-radius: 8px 8px 0 0; 
}

.x2-title:hover {
    background-color: #d0e0ff; 
}

.x2-unit-section {
    position: relative; 
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    background-color: #f2f8ff; 
    border: 1px solid #dce8f0; 
    padding: 20px; 
    margin-bottom: 30px; 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); 
    border-radius: 7px;
    box-sizing: border-box; 
}
.x2-unit-section * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;  
}

.x2-unit-section:last-child {
    margin-bottom: 0;
}

.x2-unit-section > *:not(:last-child) {
    margin-bottom: 15px;
}

.x2-unit-title {
    box-sizing: border-box;
    font-size: 26px; 
    background-color: #e0f0ff; 
    color: #003366; 
    padding: 10px 15px; 
    width: 100%; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 
    border-radius: 5px; 
    margin-bottom: 15px; 
    -webkit-transition: background-color 0.3s ease;
    -moz-transition: background-color 0.3s ease;
    -o-transition: background-color 0.3s ease;
    transition: background-color 0.3s ease;
}

.x2-unit-title:hover {
    background-color: #d0e0ff; 
}

.x2-examples-container {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    flex-direction: column;
    margin-top: 15px;
    box-sizing: border-box;
}

.x2-example-item {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.x2-audio-icon {
    margin-right: 10px;
    cursor: pointer;
    color: #007BFF;
    -webkit-transition: color 0.3s ease;
    -moz-transition: color 0.3s ease;
    -o-transition: color 0.3s ease;
    transition: color 0.3s ease;
}

.x2-audio-icon:hover {
    color: #0056b3; 
}


/* Style X3 ============================================================ */
.x3-topic-content {
    box-sizing: border-box;
    padding: 20px;
    margin: 0;
}

.x3-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 25px;
    background-color: rgba(251, 253, 255, 0.73); 
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #cfd8dc;
    -webkit-transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
    -moz-transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
    -o-transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
    transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.x3-title {
    font-size: calc(1.5rem + 1vw);
    text-align: center;
    max-width: 900px;
    margin: 35px auto;
    color: #1e3a8a;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: capitalize;
    text-shadow: 2px 2px 5px #ffffff;
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    border-bottom: 2px solid #e0e0e0;
    padding: 10px 5px;
    margin-bottom: 20px;
    font-family: 'Helvetica Neue', sans-serif;
    border-radius: 8px 8px 0 0; 
}


.x3-image-container {
    text-align: center;
    max-width: 900px;
    margin-bottom: 30px;
}

.x3-main-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    object-fit: cover; 
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
}

.x3-phrases {
    margin-top: 30px;
    padding: 15px;
    background-color: rgba(251, 253, 255, 0.73);
    border-radius: 12px;
}

.x3-text-section {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px 20px;
    background-color: #ecfcff;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -moz-user-select: none;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    -webkit-transition: background-color 0.2s ease;
    -moz-transition: background-color 0.2s ease;
    -o-transition: background-color 0.2s ease;
    transition: background-color 0.2s ease;
}

.x3-text-section * {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -moz-user-select: none;
}

.x3-text-section:hover {
    cursor: pointer;
    background-color: #cfdcff;
}

.x3-text-section:active {
    transform: scale(1.02);
}


.x3-audio-icon {
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 15px;
    font-size: 1.8rem;
    color: #2563eb;
    -webkit-transition: color 0.3s ease, -webkit-transform 0.1s;
    -moz-transition: color 0.3s ease, -moz-transform 0.1s;
    -o-transition: color 0.3s ease, -o-transform 0.1s;
    transition: color 0.3s ease, transform 0.1s;
}

.x3-audio-icon:hover {
    color: #1d4ed8;
    -webkit-transform: scale(1.07);
    -moz-transform: scale(1.07);
    -o-transform: scale(1.07);
    transform: scale(1.07);
}

.x3-text {
    font-size: calc(1rem + 0.5vw);
    color: #374151;
    line-height: 1.6;
    margin-left: 10px;
    flex: 1;
    box-sizing: border-box;
}

.x3-no-phrases {
    font-size: 1.2rem;
    color: #6b7280;
    text-align: center;
    padding: 20px 0;
}


/* Style X4 ============================================================ */
.x4-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 10px;
    padding: 30px 20px; 
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    -webkit-transition: background-color 0.3s ease, box-shadow 0.3s ease;
    -moz-transition: background-color 0.3s ease, box-shadow 0.3s ease;
    -o-transition: background-color 0.3s ease, box-shadow 0.3s ease;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.x4-container h1 {
    display: flex;
    align-items: center;
    justify-content: center; 
    font-size: calc(1.5rem + 0.4vw);
    margin: 25px 5px 40px 5px;
    padding: 10px 20px;
    color: #515151;
    text-align: center;
    font-family: "Libre Baskerville", serif;
    font-weight: 700;
    text-transform: capitalize;
    text-shadow: 2px 2px 5px #ffffff;
    background-color: #fffefe;
    border-top: 1px solid #e0e0e0;
    border-bottom: 2px solid #e0e0e0;
    border-radius: 8px 8px 0 0; 
    cursor: default; 
}


.x4-unit-box {
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin: 20px 15px;
    font-size: 1.15rem;
    line-height: 1.8;
    font-family: "Libre Baskerville", serif;
    font-weight: 400;
    color: #374151;
    background-color: #faffff;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.x4-unit-box * {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -moz-user-select: none;
}   
.x4-unit-box:hover {
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.1);
}

.x4-question-section,
.x4-answer-section {
    display: -webkit-flex;
    background-color: #faffff;
    display: -ms-flexbox;
    display: flex;
    align-items: center;
    padding: 20px 15px;
    border-radius: 5px; 
    transition: background-color 0.2s ease;
}

.x4-question-section:hover,
.x4-answer-section:hover {
    background-color: #e1ffff; 
}

.x4-audio-icon {
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 15px;
    font-size: 1.8rem;
    color: #0051ca;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-transition: color 0.3s ease, -webkit-transform 0.1s;
    -moz-transition: color 0.3s ease, -moz-transform 0.1s;
    -o-transition: color 0.3s ease, -o-transform 0.1s;
    transition: color 0.3s ease, transform 0.1s;
}

.x4-audio-icon:hover {
    color: #05c5ff;
    -webkit-transform: scale(1.07);
    -moz-transform: scale(1.07);
    -o-transform: scale(1.07);
    transform: scale(1.07);
}

.x4-audio-icon:active {
    transform: scale(0.95);
}

.x4-audio-icon:focus {
    outline: 2px solid #05c5ff;
    outline-offset: 2px;
}

.x4-text {
    font-size: calc(1rem + 0.8vw);
    color: #374151;
    line-height: 1.6;
    margin-left: 10px;
    flex: 1;
    font-family: "Libre Baskerville", serif;
}

.x4-no-phrases {
    font-size: 1.2rem;
    color: #6b7280;
    text-align: center;
    padding: 20px 0;
    font-family: "Helvetica Neue", sans-serif;
}



/* Responsive --------------------- */
/* Mobile devices ==============================================*/
@media (max-width: 480px){
    .x4-question-section,
    .x4-answer-section {
        padding: 15px 3px;
        font-size: 1rem;
    }

    .x3-topic-content {
        padding-left: 3px;
        padding-right: 3px;
    }

    .x3-container {
        padding-left: 3px;
        padding-right: 3px;
        border: none;
    }

    .x3-phrases {
        padding: 0 2px;
    }
}