:root {
    --primary: #0066ff;
    --primary-dark: #004ecb;
    --secondary: #ffbf00;
    /* Yellow for accent */
    --dark: #1a1a2e;
    --light: #ffffff;
    --bg-light: #f4f7f9;
    --text-gray: #666;
    --shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
    --radius: 15px;
}

/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--dark);
    line-height: 1.7;
    background-color: var(--bg-light);
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: 0.3s;
}

a:hover {
    color: var(--secondary);
}

ul {
    list-style: none;
}

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

/* Layout Helpers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px;
}

.section-padding {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.text-center {
    text-align: center;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 35px;
    border-radius: 50px;
    font-weight: 600;
    transition: 0.3s all ease;
}

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

.btn-primary:hover {
    background: var(--secondary);
    color: var(--dark);
    transform: translateY(-3px);
}

.btn-secondary {
    background: transparent;
    color: var(--light);
    border: 2px solid var(--light);
    margin-left: 15px;
}

.btn-secondary:hover {
    background: var(--light);
    color: var(--primary);
}

/* Header & Nav */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 0;
    z-index: 1000;
    transition: 0.4s;
    background: transparent;
}

.site-header.sticky {
    background: var(--light);
    padding: 15px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 a {
    color: var(--light);
    font-weight: 700;
    font-size: 28px;
}

.site-header.sticky .logo h1 a {
    color: var(--primary);
}

.dot {
    color: var(--secondary);
}

/* Joomla Menu Styles */
.main-nav ul {
    display: flex;
    gap: 25px;
}

.main-nav ul li a {
    color: var(--light);
    font-weight: 500;
    padding: 10px 0;
    font-size: 16px;
}

.site-header.sticky .main-nav ul li a {
    color: var(--dark);
}

.main-nav ul li a:hover,
.main-nav ul li.active a {
    color: var(--secondary);
}

.site-header.sticky .main-nav ul li a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero-section {
    min-height: 85vh;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    color: var(--light);
    padding-top: 80px;
    border-bottom-right-radius: 100px;
}

.hero-content {
    max-width: 800px;
}

.sub-title {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 10px;
}

.hero-content h1 {
    font-size: 4rem;
    line-height: 1.2;
    margin-bottom: 25px;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 35px;
    opacity: 0.9;
}

/* Animations */
.animate-up {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUp 0.8s forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Content Area */
.content-box {
    background: var(--light);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.inner-page .site-header {
    background: var(--primary);
    position: relative;
}

.inner-page .site-main {
    padding-top: 50px;
}

/* Section Titles */
.section-header {
    margin-bottom: 50px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--secondary);
}

/* Modules & Cards (Classes/News) */
/* This targets Joomla blog style outputs in modules */
.classes-section .item,
.news-section .item {
    background: var(--light);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: 0.3s;
    border: none;
    padding: 0;
}

.classes-section .item:hover,
.news-section .item:hover,
.teacher-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.item-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.item-content {
    padding: 30px;
}

.item-title a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.readmore a {
    display: inline-block;
    margin-top: 20px;
    font-weight: 600;
}

/* Teachers Section */
.teachers-grid .item {
    text-align: center;
    padding: 30px;
    background: var(--light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: 0.3s;
}

/* Assuming your teacher images are square, this makes them round */
.teachers-grid .item-image img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 5px solid var(--bg-light);
}

.teachers-grid .item-title {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

/* Footer */
.site-footer {
    background: var(--dark);
    color: #aaa;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
}

.footer-col h3 {
    color: var(--light);
    font-size: 1.5rem;
    margin-bottom: 25px;
}

.footer-menu ul li {
    margin-bottom: 15px;
}

.footer-menu ul li a {
    color: #aaa;
}

.footer-menu ul li a:hover {
    color: var(--secondary);
    padding-left: 5px;
}

.footer-bottom {
    padding: 25px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Zig-Zag Logic (වැදගත්ම කොටස) */
/* ඉරට්ටේ සංඛ්‍යා (2, 4, 6...) තියෙන Articles අනිත් පැත්ත හරවන්න */
.blog .items-row:nth-child(even) .item {
    flex-direction: row-reverse;
    text-align: right;
}

/* Teachers Page Zig-Zag Layout */

/* 1. ප්‍රධාන පෙට්ටිය (Flex Box) */
.teacher-item-row {
    display: flex;
    align-items: center;
    /* මැදට align කිරීම */
    gap: 40px;
    /* පින්තූරය සහ විස්තරය අතර පරතරය */
    margin-bottom: 50px;
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* 2. පින්තූරයේ ප්‍රමාණය */
.teacher-image img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
    /* රවුමක් ලෙස */
    border: 5px solid #f0f0f0;
}

/* 3. විස්තර කොටස */
.teacher-info {
    flex: 1;
    /* ඉතිරි ඉඩ සම්පූර්ණයෙන්ම ගන්න */
}

.teacher-name {
    color: #0066ff;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.8rem;
    font-weight: bold;
}

/* 4. Zig-Zag Logic (ඉරට්ටේ අංක තියෙන ඒවා අනිත් පැත්ත හරවන්න) */
/* .blog-item යනු Joomla වලින් දෙන පන්තියකි. අපි එය භාවිතා කරමු */
.blog-item:nth-child(even) .teacher-item-row {
    flex-direction: row-reverse;
    /* පින්තූරය දකුණට, විස්තරය වමට */
    text-align: right;
}

/* Mobile Responsive (ෆෝන් වලදී කෙලින් අතට) */
@media (max-width: 768px) {

    .teacher-item-row,
    .blog-item:nth-child(even) .teacher-item-row {
        flex-direction: column;
        /* යටින් යටට */
        text-align: center;
        gap: 20px;
    }
}

/* class සඳහා අළුතින් දාපු ටික */
/* Classes Page - Card Design Styles */

/* 1. Blog Items එක Grid එකක් ලෙස සැකසීම */
.blog .items-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px; /* Columns අතර පරතරය හදන්න */
}

/* 2. තනි Article එක Card එකක් ලෙස හැඩ ගැන්වීම */
.blog .item {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    height: 100%; /* කාඩ් එකේ උස සමාන කිරීමට */
    border: 1px solid #eee;
    padding: 0; /* පරණ padding අයින් කිරීම */
    display: flex;
    flex-direction: column;
}

/* Mouse එක ගෙනිච්චාම උඩට එන එක */
.blog .item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

/* 3. පින්තූරය */
.blog .item-image {
    width: 100%;
    height: 200px; /* පින්තූරයේ උස */
    overflow: hidden;
}

.blog .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0; /* උඩ රවුම් හැඩය අයින් කිරීම (Card එක ඇතුලේ නිසා) */
    transition: 0.5s;
}

.blog .item:hover .item-image img {
    transform: scale(1.1); /* Zoom Effect */
}

/* 4. අකුරු කොටස */
.blog .item-content {
    padding: 25px;
    text-align: center;
}

.blog .page-header h2 {
    display: none; /* උඩින් වැටෙන මාතෘකාව අයින් කිරීම */
}

/* මාතෘකාව (Title) */
.blog .item-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.blog .item-title a {
    color: #0066ff;
    text-decoration: none;
}

/* Read More Button */
.readmore a.btn {
    background: #0066ff;
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-top: 10px;
}


/* --- Dropdown Menu CSS --- */

/* මෙනු අයිතමය (Li) Relative කරන්න */
.main-nav ul li {
    position: relative;
}

/* Dropdown කොටස (Sub Menu) */
.main-nav ul ul {
    display: none; /* මුලින් හංගලා තියන්න */
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 250px; /* Dropdown එකේ පළල */
    flex-direction: column; /* පේළියට නැතුව යටින් යටට */
    z-index: 1000;
    gap: 0; /* පරතරය අයින් කරන්න */
}

/* Mouse එක ගෙනිච්චම Dropdown එක පෙන්වන්න */
.main-nav ul li:hover > ul,
.main-nav ul li ul:hover {
    display: flex;
}

/* Dropdown එකේ Link Styles */
.main-nav ul ul li a {
    color: #333 !important; /* අකුරු කළු පාටින් */
    padding: 12px 20px;
    display: block;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.main-nav ul ul li:last-child a {
    border-bottom: none;
}

.main-nav ul ul li a:hover {
    background-color: #f4f7f9;
    color: #0066ff !important;
    padding-left: 25px; /* Hover කළාම පොඩ්ඩක් පනින්න */
}

/* =========================================
   PAGE SPECIFIC STYLES (NEW FIXED VERSION)
   ========================================= */

/* --- 1. TEACHERS PAGE (ZIG-ZAG) --- */
/* මේ විලාසය අදාළ වෙන්නේ teachers-page කියන පිටුවට විතරයි */

.teachers-page .teacher-item-row {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 50px;
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.teachers-page .teacher-image img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid #f0f0f0;
}

.teachers-page .teacher-info {
    flex: 1;
}

.teachers-page .teacher-name {
    color: #0066ff;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.8rem;
    font-weight: bold;
}

/* Zig-Zag Logic (Teachers වලට පමණයි) */
.teachers-page .blog-item:nth-child(even) .teacher-item-row {
    flex-direction: row-reverse;
    text-align: right;
}


/* --- 2. CLASSES PAGE (CARDS) --- */
/* මේ විලාසය අදාළ වෙන්නේ classes-page කියන පිටුවලට විතරයි */

/* Grid එක හදන්න */
.classes-page .items-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.classes-page .blog-item {
    width: 33.333%; /* තීරු 3ක් */
    padding: 0 15px;
    margin-bottom: 30px;
}

/* Card එක ඇතුලේ Style එක */
.classes-page .blog-item .teacher-item-row {
    display: flex;
    flex-direction: column; /* කාඩ් එක ඇතුලේ යටින් යටට */
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    height: 100%;
    padding: 0; /* Padding අයින් කරන්න */
    gap: 0;
    border: 1px solid #eee;
    transition: 0.3s;
}

.classes-page .blog-item:hover .teacher-item-row {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

/* Classes පින්තූරය */
.classes-page .teacher-image {
    width: 100%;
    height: 200px;
}

.classes-page .teacher-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0; /* රවුම් අයින් කරන්න */
    border: none;
}

/* Classes විස්තර */
.classes-page .teacher-info {
    padding: 25px;
    text-align: center;
}

.classes-page .teacher-name {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

/* Mobile Responsive Fixes */
@media (max-width: 768px) {
    /* Teachers Zig-Zag Remove on Mobile */
    .teachers-page .teacher-item-row,
    .teachers-page .blog-item:nth-child(even) .teacher-item-row {
        flex-direction: column;
        text-align: center;
    }

    /* Classes Grid 1 Column on Mobile */
    .classes-page .blog-item {
        width: 100%;
    }
}
/* Classes Menu Font & Alignment Fix */
.main-nav ul li span.separator,
.main-nav ul li span.nav-header {
    font-family: 'Poppins', sans-serif !important;
    /* Font එක අනිත් ඒවා වගේම කරන්න */
    font-weight: 500 !important;
    /* අකුරු වල මහත අනිත් ඒවාට සමාන කරන්න */
    color: var(--light) !important;
    font-size: 16px;
    padding: 0px 0;
    /* ඔයා දැම්ම අගය */
    cursor: pointer;
    display: inline-block;
    line-height: 1.7;
}

/* Sticky Header (පහළට එද්දී) පාට */
.site-header.sticky .main-nav ul li span.separator,
.site-header.sticky .main-nav ul li span.nav-header {
    color: var(--dark) !important;
}

/* Mouse එක ගෙනිච්චම පාට (Hover) */
.main-nav ul li span.separator:hover,
.main-nav ul li span.nav-header:hover {
    color: var(--secondary) !important;
}
/* =========================================
   MOBILE RESPONSIVE STYLES (PHONE FIXES)
   ========================================= */

@media (max-width: 768px) {

    /* 1. General Layout Fixes */
    body {
        overflow-x: hidden; /* තිරයෙන් එලියට යාම වලක්වන්න */
    }
    .container {
        width: 100%;
        padding: 0 20px;
    }

    /* 2. Header & Menu Fixes */
    .site-header {
        position: relative; /* ෆෝන් එකේදි Fixed නැතුව Normal තියන්න */
        background: #fff; /* අකුරු පේන්න පසුබිම සුදු කරන්න */
        padding: 10px 0;
    }
    
    .header-flex {
        flex-direction: column; /* ලෝගෝ එක සහ මෙනු එක යටින් යටට */
        gap: 15px;
    }

    .logo h1 a {
        color: #0066ff; /* ලෝගෝ එක නිල් පාට කරන්න */
    }

    .main-nav ul {
        flex-wrap: wrap; /* මෙනු අයිතම ඉඩ මදි නම් යටට කඩන්න */
        justify-content: center;
        gap: 10px;
    }

    .main-nav ul li a {
        color: #333; /* මෙනු අකුරු කළු පාට කරන්න */
        font-size: 14px;
        padding: 5px 10px;
    }

    /* 3. Hero Section (මුල් පිටුවේ ලොකු කොටස) */
    .hero-section {
        text-align: center; /* මැදට ගන්න */
        padding-top: 40px;
        min-height: auto; /* උස අවශ්‍ය ප්‍රමාණයට විතරක් ගන්න */
        border-bottom-right-radius: 40px;
    }

    .hero-content h1 {
        font-size: 2.2rem; /* ලොකු අකුරු ෆෝන් එකට ගැලපෙන්න පොඩි කරන්න */
        line-height: 1.3;
    }

    .hero-content p {
        font-size: 1rem;
    }

    /* 4. Footer (යටම කොටස) */
    .footer-grid {
        grid-template-columns: 1fr; /* තීරු 3ක් නැතුව එක තීරුවක් කරන්න */
        gap: 40px;
        text-align: center;
    }

    .footer-col {
        padding: 0 10px;
    }

    /* 5. Teachers & Classes Pages Fixes */
    
    /* Teachers Zig-Zag එක කෙලින් අතට */
    .teachers-page .teacher-item-row,
    .teachers-page .blog-item:nth-child(even) .teacher-item-row {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .teachers-page .teacher-image img {
        width: 150px;
        height: 150px;
    }

    /* Classes Cards - එක පේළියට එකක් පෙන්වන්න */
    .classes-page .blog-item {
        width: 100%;
        padding: 0;
    }
    
    .classes-page .items-row {
        margin: 0;
    }
}
/* Classes Separator Color Fix for Mobile Header */
@media (max-width: 768px) {
    .main-nav ul li span.separator, 
    .main-nav ul li span.nav-header {
        color: #333 !important; /* White background එකේදී පේන්න කළු කරන්න */
    }
}