﻿/*
Theme Name: MasterLanguage
Theme URI: https://masterlanguage.app
Author: MasterLanguage Dev Team
Author URI: https://masterlanguage.app
Description: The premier WordPress theme for IELTS & Language Learning. Features authentic 50/50 split-screen Cambridge test simulation, listening audio sync, speaking voice recorder, 3-mode exam engine (Practice, Strict Real Test, Diagnostic Review), 3D flip flashcards, Band Score Calculator, and bKash/Nagad subscription monetization.
Version: 1.1.0
Tested up to: 6.7
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: masterlanguage
Tags: education, e-learning, language, ielts, custom-menu, featured-images, full-width-template, theme-options
*/

/**
 * MasterLanguage Theme - Main UI & Test Engine Styles
 */

/* Container */
.ml-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .ml-container { padding: 0 24px; }
}

/* Header & Navbar */
.ml-header {
  background: #ffffff;
  border-bottom: 1px solid var(--ml-slate-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.ml-nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.ml-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--ml-slate-900);
}

.ml-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.ml-nav-links {
  display: none;
  align-items: center;
  gap: 24px;
}

@media (min-width: 900px) {
  .ml-nav-links { display: flex; }
}

.ml-nav-item {
  font-size: 14px;
  font-weight: 600;
  color: var(--ml-slate-600);
  transition: color 0.15s;
  position: relative;
  padding: 8px 0;
}

.ml-nav-item:hover {
  color: var(--ml-primary);
}

/* Dropdown */
.ml-dropdown {
  position: relative;
}

.ml-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 1px solid var(--ml-slate-200);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
  min-width: 260px;
  display: none;
  z-index: 1000;
}

.ml-dropdown:hover .ml-dropdown-menu {
  display: block;
}

.ml-dropdown-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ml-slate-700);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}

.ml-dropdown-link:hover {
  background: var(--ml-slate-50);
  color: var(--ml-primary);
}

.ml-auth-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.ml-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.ml-btn-primary {
  background: var(--ml-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.ml-btn-primary:hover {
  background: var(--ml-primary-hover);
  transform: translateY(-1px);
}

.ml-btn-secondary {
  background: var(--ml-slate-100);
  color: var(--ml-slate-700);
}

.ml-btn-secondary:hover {
  background: var(--ml-slate-200);
}

.ml-btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 8px;
}

/* Badges */
.ml-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.ml-badge-official { background: #e0e7ff; color: #3730a3; }
.ml-badge-free { background: #dcfce7; color: #166534; }
.ml-badge-premium { background: #fef3c7; color: #92400e; }
.ml-badge-band9 { background: #fef08a; color: #854d0e; }

/* 50/50 Split-Screen Test Engine */
.ml-engine-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 72px);
  background: #ffffff;
  overflow: hidden;
}

.ml-engine-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--ml-slate-200);
  shrink: 0;
}

.ml-timer-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #f1f5f9;
  border-radius: 10px;
  font-family: monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--ml-slate-800);
}

.ml-split-screen {
  display: flex;
  flex: 1;
  overflow: hidden;
}

@media (max-width: 900px) {
  .ml-split-screen { flex-direction: column; }
}

.ml-split-left {
  flex: 1;
  border-right: 1px solid var(--ml-slate-200);
  overflow-y: auto;
  padding: 24px 32px;
  background: #ffffff;
}

.ml-split-right {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  background: #f8fafc;
}

.ml-passage-text {
  font-family: Georgia, Cambria, 'Times New Roman', Times, serif;
  font-size: 16px;
  line-height: 1.8;
  color: #1e293b;
}

.ml-passage-text p {
  margin-bottom: 16px;
}

/* Highlight in review mode */
.ml-evidence-highlight {
  background: #fef08a !important;
  color: #854d0e !important;
  padding: 2px 4px;
  border-radius: 4px;
  border-bottom: 2px solid #ca8a04;
  font-weight: 600;
}

/* Question Cards in Engine */
.ml-question-item {
  background: #ffffff;
  border: 1px solid var(--ml-slate-200);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  transition: all 0.15s;
}

.ml-question-item.active {
  border-color: var(--ml-primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.ml-question-statement {
  font-size: 14px;
  font-weight: 600;
  color: var(--ml-slate-900);
  margin-bottom: 12px;
}

.ml-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ml-option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--ml-slate-200);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}

.ml-option-label:hover {
  background: var(--ml-slate-50);
}

.ml-option-label input:checked + span {
  font-weight: 700;
  color: var(--ml-primary);
}

/* Bottom Navigator in Test */
.ml-engine-bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #ffffff;
  border-top: 1px solid var(--ml-slate-200);
  shrink: 0;
}

.ml-nav-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ml-dot-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--ml-slate-200);
  background: #ffffff;
  font-size: 11px;
  font-weight: 700;
  color: var(--ml-slate-700);
  cursor: pointer;
}

.ml-dot-btn.answered {
  background: #e0e7ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.ml-dot-btn.active {
  background: var(--ml-primary);
  color: #ffffff;
  border-color: var(--ml-primary);
}

/* 3D Flashcards */
.ml-flashcard-scene {
  perspective: 1000px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  height: 320px;
  cursor: pointer;
}

.ml-flashcard {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.ml-flashcard.flipped {
  transform: rotateY(180deg);
}

.ml-card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--ml-slate-200);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.06);
}

.ml-card-front {
  background: #ffffff;
}

.ml-card-back {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #ffffff;
  transform: rotateY(180deg);
}

/* Modals */
.ml-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.ml-modal-content {
  background: #ffffff;
  border-radius: 24px;
  max-width: 560px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
  animation: mlModalFade 0.2s ease-out;
}

@keyframes mlModalFade {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   WORDPRESS MENUS & DROPDOWNS
   ========================================================================== */
.ml-menu-list {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ml-menu-list li {
  position: relative;
  list-style: none;
}

.ml-menu-list li a {
  font-size: 14px;
  font-weight: 600;
  color: var(--ml-slate-700);
  padding: 8px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.ml-menu-list li a:hover,
.ml-menu-list li.current-menu-item > a,
.ml-menu-list li.current-menu-ancestor > a {
  color: var(--ml-primary);
  background: rgba(79, 70, 229, 0.05);
}

.ml-menu-list .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 1px solid var(--ml-slate-200);
  border-radius: 16px;
  padding: 10px;
  min-width: 240px;
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.12);
  display: none;
  z-index: 1000;
  list-style: none;
  margin: 0;
}

.ml-menu-list li:hover > .sub-menu,
.ml-menu-list li:focus-within > .sub-menu {
  display: block;
  animation: mlFadeDown 0.2s ease-out;
}

.ml-menu-list .sub-menu li {
  width: 100%;
}

.ml-menu-list .sub-menu li a {
  display: block;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  color: var(--ml-slate-700);
}

.ml-menu-list .sub-menu li a:hover {
  background: var(--ml-slate-50);
  color: var(--ml-primary);
}

@keyframes mlFadeDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   MOBILE TOGGLE & SLIDE-IN DRAWER
   ========================================================================== */
.ml-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--ml-slate-200);
  border-radius: 10px;
  padding: 9px 8px;
  cursor: pointer;
  z-index: 101;
  transition: all 0.2s;
}

.ml-mobile-toggle span {
  display: block;
  width: 100%;
  height: 2.5px;
  background-color: var(--ml-slate-800);
  border-radius: 2px;
  transition: all 0.25s ease-in-out;
}

.ml-mobile-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.ml-mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}
.ml-mobile-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 991px) {
  .ml-nav-links { display: none !important; }
  .ml-hide-mobile { display: none !important; }
  .ml-mobile-toggle { display: flex; }
}

.ml-mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ml-mobile-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.ml-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: #ffffff;
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -10px 0 25px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.ml-mobile-drawer.active {
  transform: translateX(0);
}

.ml-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--ml-slate-200);
}

.ml-drawer-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--ml-slate-500);
  cursor: pointer;
  padding: 4px 8px;
}

.ml-drawer-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.ml-mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ml-mobile-menu-list li {
  list-style: none;
}

.ml-mobile-menu-list li a {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ml-slate-800);
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.15s;
}

.ml-mobile-menu-list li a:hover,
.ml-mobile-menu-list li.current-menu-item > a {
  background: var(--ml-slate-100);
  color: var(--ml-primary);
}

.ml-mobile-menu-list .sub-menu {
  list-style: none;
  margin: 4px 0 8px 12px;
  padding-left: 12px;
  border-left: 2px solid var(--ml-slate-200);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ml-mobile-menu-list .sub-menu li a {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--ml-slate-600);
}

/* ==========================================================================
   ELEMENTOR FULL WIDTH & RESPONSIVE LAYOUT
   ========================================================================== */
.ml-elementor-content-wrap,
.ml-elementor-fullwidth-wrapper {
  width: 100%;
  margin: 0;
  padding: 0;
}

.ml-hero-section {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 64px 0 80px 0;
  border-bottom: 1px solid var(--ml-slate-200);
}

.ml-hero-content {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.ml-hero-headline {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--ml-slate-900);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.ml-hero-desc {
  font-size: clamp(15px, 2.5vw, 18px);
  color: var(--ml-slate-600);
  line-height: 1.6;
  margin-bottom: 32px;
}

.ml-hero-cta-group {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.ml-section {
  padding: 64px 0;
}

.ml-section-header {
  text-align: center;
  margin-bottom: 48px;
}

.ml-section-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  color: var(--ml-slate-900);
}

.ml-section-desc {
  font-size: 15px;
  color: var(--ml-slate-500);
}

.ml-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.ml-card-feature {
  background: #ffffff;
  border: 1px solid var(--ml-slate-200);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
  transition: transform 0.2s, box-shadow 0.2s;
}

.ml-card-feature:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -3px rgba(0,0,0,0.06);
}

.ml-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}

.ml-pricing-card {
  background: #ffffff;
  border: 1px solid var(--ml-slate-200);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03);
}

.ml-pricing-card.ml-pricing-popular {
  border: 2px solid var(--ml-primary);
  box-shadow: 0 10px 25px -5px rgba(79,70,229,0.12);
  position: relative;
}

.ml-pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ml-primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 999px;
  text-transform: uppercase;
}

.ml-pricing-price {
  font-size: 36px;
  font-weight: 900;
  color: var(--ml-primary);
  margin: 16px 0;
}

.ml-pricing-currency {
  font-size: 16px;
  font-weight: 600;
  color: var(--ml-slate-500);
}

.ml-pricing-features {
  list-style: none;
  font-size: 13px;
  color: var(--ml-slate-600);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  padding: 0;
}

@media (max-width: 768px) {
  .ml-engine-wrap {
    height: auto;
    min-height: 100vh;
  }
  .ml-split-screen {
    flex-direction: column;
    height: auto;
  }
  .ml-split-left,
  .ml-split-right {
    height: auto;
    max-height: 55vh;
    padding: 16px;
  }
}

