/*
 * MarathiBaraKhadi.com - Global Stylesheet
 * Vibrant, playful, educational, and modern UI.
 */

:root {
    --primary: #FF7A00;
    --primary-rgb: 255, 122, 0;
    --primary-light: #FF9E43;
    --secondary: #FFB703;
    --accent: #4CC9F0;
    --accent-rgb: 76, 201, 240;
    --bg-color: #FFF9F2;
    --card-bg: #FFFFFF;
    --text-color: #3D2D1B;
    --text-muted: #8E7A66;
    --success: #2ECC71;
    --error: #FF4757;
    --border-color: #F3E5D8;
    
    --shadow-soft: 0 10px 30px rgba(255, 122, 0, 0.05);
    --shadow-medium: 0 15px 40px rgba(255, 122, 0, 0.08);
    --shadow-hover: 0 20px 45px rgba(255, 122, 0, 0.15);
    --shadow-inset: inset 0 2px 5px rgba(0,0,0,0.05);
    
    --border-radius-sm: 12px;
    --border-radius-md: 20px;
    --border-radius-lg: 30px;
    --border-radius-pill: 50px;
    
    --font-title: 'Outfit', sans-serif;
    --font-body: 'Poppins', sans-serif;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

img {
    max-width: 100%;
    height: auto;
}

/* Floating Shapes Background */
.bg-decorations {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    opacity: 0.12;
    animation: floatAround 25s infinite linear;
}

.floating-shape-1 {
    width: 120px;
    height: 120px;
    background: var(--primary);
    border-radius: 43% 57% 70% 30% / 45% 45% 55% 55%;
    top: 15%;
    left: 5%;
}

.floating-shape-2 {
    width: 150px;
    height: 150px;
    background: var(--secondary);
    border-radius: 50% 50% 30% 70% / 50% 60% 40% 50%;
    bottom: 20%;
    right: 5%;
    animation-delay: -5s;
}

.floating-shape-3 {
    width: 100px;
    height: 100px;
    background: var(--accent);
    border-radius: 30% 70% 70% 30% / 50% 30% 70% 50%;
    top: 60%;
    left: 80%;
    animation-delay: -10s;
}

/* Header & Navigation */
header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.logo-block {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.4rem;
    box-shadow: 0 4px 10px rgba(255, 122, 0, 0.25);
    animation: bounce 2s infinite;
}

nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: var(--border-radius-pill);
    transition: all 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
    background-color: rgba(255, 122, 0, 0.1);
    color: var(--primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Theme Switcher */
.theme-switch {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-color);
    box-shadow: var(--shadow-soft);
}

.theme-switch:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

/* Streak Counter */
.streak-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #FF4757, #FF7A00);
    color: white;
    padding: 6px 14px;
    border-radius: var(--border-radius-pill);
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(255, 71, 87, 0.25);
}

.streak-badge span {
    animation: flame 1.5s infinite alternate;
}

/* Mobile Nav Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* Main Content Area */
main.container {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
    min-width: 0;
}

/* Responsive Table Wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 20px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}
.table-responsive table {
    min-width: 650px;
    width: 100%;
    margin: 0;
}

/* Split feature blocks */
.features-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

/* Rounded content cards on homepage */
.feature-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-soft);
}

/* Large content sections on homepage */
.showcase-section {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 60px;
    text-align: center;
}

.guide-section {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 45px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 60px;
    line-height: 1.8;
}


/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 50px;
    align-items: center;
    padding: 60px 0;
}

.hero-text h1 {
    font-family: var(--font-title);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 15px;
    color: var(--text-color);
}

.hero-text h1 span.highlight {
    color: var(--primary);
    position: relative;
    z-index: 1;
}

.hero-text h1 span.highlight::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    height: 12px;
    background: rgba(255, 183, 3, 0.35);
    z-index: -1;
    border-radius: 4px;
}

.hero-marathi {
    font-size: 1.8rem;
    color: var(--secondary);
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 35px;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.hero-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero-illustration img,
.hero-illustration svg {
    max-width: 100%;
    max-height: 400px;
    height: auto;
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.08));
    animation: float 4s infinite ease-in-out;
}


/* Rounded Pill Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--border-radius-pill);
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.12);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    box-shadow: 0 10px 25px rgba(255, 122, 0, 0.3);
}

.btn-secondary {
    background-color: var(--secondary);
    color: #3D2D1B;
}

.btn-secondary:hover {
    background-color: #FFC93C;
    box-shadow: 0 10px 25px rgba(255, 183, 3, 0.3);
}

.btn-accent {
    background-color: var(--accent);
    color: #1A3E4C;
}

.btn-accent:hover {
    background-color: #7BE4FF;
    box-shadow: 0 10px 25px rgba(76, 201, 240, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Section Common Styles */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-family: var(--font-title);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-color);
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 10px auto 0;
}

/* Cards & Layout Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.card {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 25px 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}

/* Letters Layout (Barakhadi table) */
.barakhadi-container {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-medium);
    margin-top: 20px;
}

.consonant-row {
    margin-bottom: 40px;
}

.consonant-row:last-child {
    margin-bottom: 0;
}

.consonant-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 8px;
}

.row-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 12px;
}

.letter-card {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 12px 6px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.letter-card:hover {
    background: var(--card-bg);
    border-color: var(--primary);
    transform: scale(1.08);
    box-shadow: var(--shadow-soft);
    z-index: 2;
}

.letter-card .marathi-char {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
}

.letter-card .translit {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

.letter-card .speaker-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.letter-card:hover .speaker-btn {
    opacity: 0.8;
}

/* Playing Animation on Card */
.letter-card.playing {
    border-color: var(--primary);
    background-color: rgba(255, 122, 0, 0.05);
    animation: bounceMini 0.5s ease;
}

.letter-card.playing .marathi-char {
    color: var(--primary);
}

/* Bookmark Favorite Heart Button */
.fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: #CCC;
    transition: all 0.2s ease;
    z-index: 5;
}

.fav-btn.active {
    color: #FF4757;
    animation: heartBeat 0.3s ease;
}

.fav-btn:hover {
    transform: scale(1.2);
}

/* Practice Mode Carousel */
.practice-stage {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.practice-card {
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 60px 40px;
    box-shadow: var(--shadow-medium);
    margin-bottom: 30px;
    position: relative;
}

.practice-card .letter-main {
    font-size: 8rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.1;
    margin-bottom: 10px;
}

.practice-card .pronounce-main {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 5px;
}

.practice-card .english-main {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.practice-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.auto-play-indicator {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(46, 204, 113, 0.1);
    color: var(--success);
    border-radius: var(--border-radius-pill);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 15px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.auto-play-indicator.active {
    opacity: 1;
    transform: scale(1);
    animation: pulse 1.5s infinite;
}

/* Quiz Mode Layout */
.quiz-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-medium);
}

.quiz-progress {
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 25px;
}

.quiz-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--secondary), var(--primary));
    border-radius: 6px;
    transition: width 0.3s ease;
}

.quiz-stats {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.quiz-question {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text-color);
    text-align: center;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.quiz-option {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    padding: 20px;
    border-radius: var(--border-radius-md);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.quiz-option:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft);
}

.quiz-option.correct {
    background-color: rgba(46, 204, 113, 0.15);
    border-color: var(--success);
    color: var(--success);
    animation: correctBounce 0.5s ease;
}

.quiz-option.incorrect {
    background-color: rgba(255, 71, 87, 0.15);
    border-color: var(--error);
    color: var(--error);
    animation: shake 0.5s ease;
}

.quiz-results {
    text-align: center;
    padding: 30px 0;
}

.results-score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 8px solid var(--primary);
    margin: 20px auto 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
}

.results-score-circle .percentage {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
}

.results-score-circle .score-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Drag & Drop Matching Game */
.game-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 30px 0;
}

.game-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-item {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    cursor: grab;
    user-select: none;
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    transition: all 0.2s ease;
}

.game-item:hover {
    border-color: var(--primary);
    transform: scale(1.02);
    box-shadow: var(--shadow-medium);
}

.game-item:active {
    cursor: grabbing;
}

.game-item.dragging {
    opacity: 0.5;
    transition: none !important;
}

.game-item.selected {
    border-color: var(--primary);
    background-color: rgba(255, 122, 0, 0.1);
    transform: scale(1.03);
    box-shadow: var(--shadow-medium);
}

.game-item.incorrect {
    border-color: var(--error);
    background-color: rgba(255, 71, 87, 0.1);
    color: var(--error);
    animation: shake 0.5s ease;
}

.drop-zone {
    border: 3px dashed var(--border-color);
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 600;
    transition: all 0.2s ease;
}

.drop-zone.hover {
    border-color: var(--primary);
    background-color: rgba(255, 122, 0, 0.05);
}

.drop-zone.correct {
    border-style: solid;
    border-color: var(--success);
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--success);
    font-size: 1.8rem;
    font-weight: 700;
}

.drop-zone.incorrect {
    border-style: solid;
    border-color: var(--error);
    background-color: rgba(255, 71, 87, 0.1);
    color: var(--error);
    animation: shake 0.5s ease;
}

/* Drawing Canvas Section */
.canvas-container {
    max-width: 1050px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.8fr 320px;
    gap: 30px;
}

.canvas-panel {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-medium);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #FFFFFF;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-inset);
    touch-action: none;
    container-type: inline-size;
}

#drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: crosshair;
}

#guide-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.canvas-bg-letter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 55cqw;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.05);
    user-select: none;
    z-index: 1;
    pointer-events: none;
    transition: color 0.3s ease;
}

/* Dotted tracing lines helper */
.canvas-bg-letter.trace-mode {
    color: transparent;
    -webkit-text-stroke: 3px #DDD;
    letter-spacing: 2px;
}

.dark-theme .canvas-bg-letter.trace-mode {
    -webkit-text-stroke: 3px #444;
}

.canvas-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-box {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.color-palette {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.color-dot {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.color-dot.active {
    border-color: var(--text-color);
    transform: scale(1.15);
}

.brush-sizes {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    align-items: center;
}

.brush-size {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brush-size.active {
    border-color: var(--primary);
    background: var(--card-bg);
}

/* Voice Check Module */
.voice-check-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-medium);
    max-width: 600px;
    margin: 30px auto;
}

.mic-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    font-size: 2rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px auto;
    box-shadow: 0 8px 25px rgba(255, 122, 0, 0.3);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.mic-btn:hover {
    transform: scale(1.05);
}

.mic-btn.listening {
    background-color: var(--error);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.4);
}

.mic-btn.listening::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 4px solid var(--error);
    animation: ping 1.2s infinite ease-out;
    z-index: -1;
}

.voice-feedback {
    margin-top: 20px;
    font-size: 1.4rem;
    font-weight: 700;
}

.voice-feedback.success { color: var(--success); }
.voice-feedback.warning { color: var(--secondary); }
.voice-feedback.error { color: var(--error); }

/* Search Page Styles */
.search-box-container {
    max-width: 600px;
    margin: 0 auto 30px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.15rem;
    font-family: var(--font-body);
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-pill);
    box-shadow: var(--shadow-soft);
    color: var(--text-color);
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}

/* Certificate Styles */
.certificate-preview-container {
    max-width: 800px;
    margin: 0 auto;
}

.certificate-border {
    border: 15px solid var(--primary);
    background-color: #FFF;
    padding: 40px;
    position: relative;
    box-shadow: var(--shadow-medium);
    border-radius: 10px;
    background-image: radial-gradient(circle, #FFF9F2 20%, transparent 20%), radial-gradient(circle, #FFF9F2 20%, transparent 20%);
    background-size: 15px 15px;
    background-position: 0 0, 7.5px 7.5px;
}

.certificate-inner {
    border: 4px solid var(--secondary);
    padding: 40px;
    text-align: center;
    background: #FFF;
    border-radius: 5px;
}

.certificate-logo {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.cert-title {
    font-family: var(--font-title);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.cert-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 40px;
}

.cert-name {
    font-family: var(--font-title);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--border-color);
    display: inline-block;
    padding: 0 30px;
    margin-bottom: 30px;
}

.cert-text {
    font-size: 1.1rem;
    max-width: 550px;
    margin: 0 auto 40px;
}

.cert-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 40px;
    padding: 0 20px;
}

.cert-sig {
    border-top: 2px solid var(--border-color);
    padding-top: 8px;
    width: 180px;
    font-size: 0.9rem;
    font-weight: 600;
}

.cert-no {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Footer styling */
footer {
    background-color: var(--card-bg);
    border-top: 2px solid var(--border-color);
    padding: 30px 20px;
    text-align: center;
    margin-top: auto;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 12px 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary);
}

/* Keyframe Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

@keyframes floatAround {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, 50px) rotate(120deg); }
    66% { transform: translate(-20px, 80px) rotate(240deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.05); }
}

@keyframes bounceMini {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.04); }
}

@keyframes flame {
    0% { transform: scale(1); filter: drop-shadow(0 2px 2px rgba(255, 71, 87, 0.4)); }
    100% { transform: scale(1.1); filter: drop-shadow(0 4px 6px rgba(255, 71, 87, 0.6)); }
}

@keyframes ping {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.95); opacity: 0.7; }
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.25); }
    28% { transform: scale(1); }
    42% { transform: scale(1.25); }
    70% { transform: scale(1); }
}

@keyframes correctBounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.1) translateY(-6px); }
    60% { transform: scale(0.95) translateY(2px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.chart-showcase-split {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 40px;
    align-items: center;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 30px;
        padding: 30px 0;
        width: 100%;
    }
    .hero-text {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .hero-marathi {
        width: 100%;
        text-align: center;
        font-size: 1.4rem;
        margin-bottom: 12px;
    }
    .hero-text h1 {
        width: 100%;
        text-align: center;
        font-size: 2.2rem;
    }
    .hero-subtitle {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
        margin-bottom: 25px;
    }
    .hero-buttons {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
    }
    .hero-illustration {
        width: 100%;
        max-width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .hero-illustration svg {
        width: 100%;
        max-width: 320px;
        height: auto;
    }
    .canvas-container {
        grid-template-columns: 1fr;
    }
    .chart-showcase-split {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 10px 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .logo {
        order: 1;
        font-size: 1.25rem;
        gap: 8px;
    }
    .logo-block {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
        border-radius: 10px;
    }
    nav {
        order: 2;
        gap: 10px;
        margin-left: auto;
    }
    .nav-right {
        gap: 8px;
    }
    .streak-badge {
        padding: 4px 10px;
        font-size: 0.85rem;
        gap: 4px;
    }
    .theme-switch {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }
    .menu-toggle {
        order: 3;
        display: block;
        font-size: 1.35rem;
        padding: 5px;
        margin-left: 8px;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--card-bg);
        border-bottom: 2px solid var(--border-color);
        padding: 15px 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.08);
        gap: 8px;
        z-index: 1001;
    }
    .nav-links.show {
        display: flex;
    }
    .nav-links a {
        padding: 10px 20px;
        width: 100%;
        text-align: left;
        border-radius: var(--border-radius-md);
    }
    .hero-text h1 {
        font-size: 2.2rem;
    }
    .hero-marathi {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }
    .features-split {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .feature-card {
        padding: 25px 20px;
    }
    .showcase-section {
        padding: 25px 20px;
        margin-bottom: 40px;
    }
    .guide-section {
        padding: 25px 20px;
        margin-bottom: 40px;
    }
    .quiz-options {
        grid-template-columns: 1fr;
    }
    .barakhadi-container {
        padding: 15px;
    }
    .game-board {
        gap: 20px;
        margin: 15px 0;
    }
    .game-item {
        padding: 10px;
        font-size: 1.5rem;
        min-height: 65px;
    }
    .drop-zone {
        min-height: 65px;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .logo span {
        display: none; /* Hide logo title text on very narrow screens (e.g. phones) to prevent header squeezing */
    }
    .hero-text h1 {
        font-size: 1.8rem;
    }
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    .hero-buttons .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
    }
    .tabs-container {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    .tabs-container .tab-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
    }
    .game-board {
        gap: 12px;
    }
    .game-item {
        font-size: 1.3rem;
        min-height: 55px;
        padding: 8px;
    }
    .drop-zone {
        min-height: 55px;
        font-size: 0.95rem;
        padding: 8px;
    }
}

/* --------------------------------------------------
   MARATHI MULAKSHARE (ALPHABETS) CHART
   -------------------------------------------------- */
.mulakshare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}
.mulakshare-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease-in-out;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.mulakshare-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-medium);
}
.mulakshare-card .char {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
}
.mulakshare-card .pic {
    font-size: 2.6rem;
    margin-bottom: 5px;
    transition: transform 0.2s ease;
    user-select: none;
}
.mulakshare-card:hover .pic {
    transform: scale(1.18);
}
.mulakshare-card .word {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 2px;
}
.mulakshare-card .meaning {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out forwards;
}
.tab-content.active {
    display: block;
}
.tabs-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.tab-btn {
    padding: 10px 24px;
    font-size: 1.05rem;
    transition: all 0.25s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------
   ALPHABET REFERENCE DRAWER (WRITING BOARD)
   -------------------------------------------------- */
.reference-drawer {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    max-width: 100%;
    height: 100vh;
    background-color: var(--card-bg);
    border-right: 2px solid var(--border-color);
    box-shadow: 5px 0 25px rgba(0,0,0,0.15);
    z-index: 1005;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.reference-drawer.open {
    left: 0;
}
.drawer-header {
    padding: 20px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.drawer-header h3 {
    font-family: var(--font-title);
    font-size: 1.3rem;
    color: var(--primary);
    margin: 0;
}
.drawer-header .close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
}
.drawer-header .close-btn:hover {
    color: var(--error);
}
.drawer-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.drawer-section-title {
    font-family: var(--font-title);
    font-size: 1.1rem;
    margin-bottom: 12px;
    margin-top: 15px;
    color: var(--text-color);
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 4px;
}
.drawer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
.drawer-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.drawer-item:hover {
    border-color: var(--primary);
    background-color: rgba(255, 122, 0, 0.05);
    transform: translateY(-2px);
}
.drawer-item .char {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-color);
}
.drawer-item .meaning {
    font-size: 0.65rem;
    color: var(--text-muted);
}
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.4);
    z-index: 1004;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.drawer-overlay.active {
    display: block;
    opacity: 1;
}

/* --------------------------------------------------
   MODAL DIALOG (PRACTICE PAGE ALPHABETS REFERENCE)
   -------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.5);
    z-index: 1010;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.modal-overlay.active {
    display: block;
    opacity: 1;
}
.practice-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 750px;
    max-height: 85vh;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    z-index: 1011;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.practice-modal.open {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.modal-header {
    padding: 20px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-family: var(--font-title);
    font-size: 1.4rem;
    color: var(--primary);
    margin: 0;
}
.modal-header .close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}
.modal-header .close-btn:hover {
    color: var(--error);
}
.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.modal-section-title {
    font-family: var(--font-title);
    font-size: 1.15rem;
    margin-bottom: 12px;
    margin-top: 15px;
    color: var(--text-color);
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 4px;
}
.modal-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.modal-grid-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.modal-grid-item:hover {
    border-color: var(--primary);
    background-color: rgba(255, 122, 0, 0.05);
    transform: translateY(-2px);
}
.modal-grid-item .char {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}
.modal-grid-item .pic {
    font-size: 1.4rem;
    margin: 2px 0;
}
.modal-grid-item .word {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .modal-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 576px) {
    .modal-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .modal-grid-item .char {
        font-size: 1.3rem;
    }
}

/* Force 12 columns for Barakhadi row on desktop screens */
@media (min-width: 992px) {
    .row-grid {
        grid-template-columns: repeat(12, 1fr);
        gap: 10px;
    }
    .letter-card {
        padding: 10px 4px;
    }
    .letter-card .marathi-char {
        font-size: 1.8rem;
    }
    .letter-card .translit {
        font-size: 0.8rem;
    }
    .letter-card .fav-btn {
        font-size: 0.9rem;
        top: 4px;
        right: 4px;
    }
}

/* FAQ Section Styles */
.faq-section {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 45px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 60px;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item[open] {
    border-color: var(--primary);
    box-shadow: var(--shadow-soft);
    background-color: var(--card-bg);
}

.faq-item summary {
    padding: 18px 24px;
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    cursor: pointer;
    list-style: none;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    outline: none;
    transition: color 0.2s ease;
}

.faq-item summary:hover {
    color: var(--primary);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-item[open] summary::after {
    content: '−';
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 24px 24px;
    font-size: 0.98rem;
    color: var(--text-muted);
    line-height: 1.6;
    animation: slideDown 0.3s ease-out;
}

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


