/*
Theme Name: MyIELTSWorld LMS
Theme URI: https://myieltsworld.com
Author: MyIELTSWorld
Author URI: https://myieltsworld.com
Description: A bubbly, bright LMS theme with integrated learning management, virtual classrooms, assessments, social feed, and progress tracking. No plugin needed.
Version: 3.2.2
Tested up to: 6.7
Requires at least: 5.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: myieltsworld-lms
Tags: one-column, custom-logo, custom-menu, editor-style, translation-ready, education
*/

/* === RESET === */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Nunito:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --flavor-primary: #2B84A0;
    --flavor-primary-dark: #1F6882;
    --flavor-sky: #7BBFD0;
    --flavor-violet: #5F8CBE;
    --flavor-coral: #E07A5F;
    --flavor-amber: #E2A84B;
    --flavor-text: #1E3A4A;
    --flavor-text-soft: #4A6B7C;
    --flavor-text-muted: #8FA8B8;
    --flavor-bg: #EEF5F9;
    --flavor-border: #C1D8E4;
    --flavor-border-light: #D8EAF0;
    --flavor-radius: 18px;
    --flavor-radius-lg: 24px;
    --flavor-radius-xl: 32px;
    --flavor-radius-pill: 999px;
    --flavor-shadow: 0 4px 20px rgba(43,132,160,0.08), 0 1px 4px rgba(0,0,0,0.03);
    --flavor-shadow-lg: 0 12px 40px rgba(43,132,160,0.12), 0 4px 12px rgba(0,0,0,0.04);
    --flavor-shadow-hover: 0 18px 50px rgba(43,132,160,0.16), 0 6px 16px rgba(0,0,0,0.05);
    --flavor-grad: linear-gradient(135deg, #2B84A0 0%, #5FB8D0 50%, #7BBFD0 100%);
    --flavor-grad-cool: linear-gradient(135deg, #5F8CBE 0%, #7BBFD0 100%);
    --flavor-grad-warm: linear-gradient(135deg, #E07A5F 0%, #E2A84B 100%);
    --flavor-grad-glass: linear-gradient(160deg, rgba(255,255,255,0.92) 0%, rgba(232,243,248,0.82) 100%);
    --flavor-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --flavor-ease-smooth: cubic-bezier(0.22, 0.61, 0.36, 1);
}

body {
    font-family: 'Quicksand', 'Nunito', system-ui, sans-serif;
    line-height: 1.7;
    color: var(--flavor-text);
    background: #F5F8FA;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

#page {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    min-height: 100vh;
    position: relative; z-index: 1;
}

/* === HEADER — gradient extends behind toolbar === */
.site-header {
    text-align: center;
    padding: 20px 24px 0; /* toolbar sits at bottom inside header */
    background: var(--miw-header-bg, linear-gradient(135deg, #FFF8E7 0%, #FCEFD3 50%, #F5E6C0 100%));
    position: relative;
    border-bottom: none;
}
.site-header::before,
.site-header::after { display: none; }

.site-logo { display: inline-block; margin-bottom: 0; }
.site-logo img { max-height: 78px; width: auto; margin: 0 auto; }

.site-title {
    font-size: 1.8rem; font-weight: 800; color: var(--miw-header-text, #1E2D3D);
}
.site-title a { text-decoration: none; color: inherit; }

.site-description {
    font-size: 0.95rem; margin-bottom: 8px;
    color: var(--miw-header-text-soft, #6B7D8D); font-weight: 600;
}

/* === INLINE TOOLBAR — transparent, inside header === */
.site-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    background: transparent;
    padding: 0 24px;
}

/* === STICKY CLONE — hidden, appears on scroll with header gradient === */
.site-toolbar--sticky {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: var(--miw-header-bg, linear-gradient(135deg, #FFF8E7 0%, #FCEFD3 50%, #F5E6C0 100%));
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: none; /* JS shows it */
}
.site-toolbar--sticky.visible {
    display: flex;
}

.main-navigation {
    background: transparent; border-radius: 0; box-shadow: none;
    position: relative; z-index: 10; flex: 1; min-width: 0;
}
.main-navigation ul {
    list-style: none;
    display: flex; justify-content: flex-start; flex-wrap: wrap;
    margin: 0; padding: 0;
}
.main-navigation a {
    display: block; padding: 12px 18px;
    text-decoration: none; color: var(--miw-menu-color, #1E2D3D);
    font-weight: 700; font-size: 14px;
    transition: background 0.15s, color 0.15s;
    border-radius: 0; margin: 0;
}
.main-navigation a:hover {
    background: var(--miw-menu-hover-bg, rgba(43,132,160,0.08));
    color: var(--miw-menu-hover-color, #2B84A0);
}

.main-navigation ul ul {
    display: none;
    position: absolute; top: 100%; left: 0;
    min-width: 220px; flex-direction: column; z-index: 1000;
    background: var(--miw-dd-bg, #fff);
    border-radius: 0 0 var(--flavor-radius) var(--flavor-radius);
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    padding: 4px 0; overflow: visible;
    border: 1px solid var(--miw-dd-border, #E5ECF0); margin-top: 0;
}
.main-navigation ul ul a {
    padding: 10px 20px; font-size: 13px; border-radius: 0; margin: 0;
    color: var(--miw-dd-color, #1E2D3D);
}
.main-navigation ul ul a:hover {
    background: var(--miw-dd-hover-bg, rgba(43,132,160,0.06));
    color: var(--miw-dd-hover-color, #2B84A0);
}
.main-navigation ul ul ul {
    top: 0; left: 100%;
    border-radius: 0 var(--flavor-radius) var(--flavor-radius) 0;
}

.main-navigation li { position: relative; }
.main-navigation li:hover > ul { display: flex; }

/* User controls in toolbar */
.toolbar-user {
    display: flex; align-items: center; gap: 12px; flex-shrink: 0; padding: 8px 0;
}
.toolbar-user-greeting {
    font-family: 'Quicksand', 'Nunito', system-ui, sans-serif;
    font-size: 13px; font-weight: 700;
    color: var(--miw-greeting-color, #4A6B7C);
}
.toolbar-user-btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: 'Quicksand', 'Nunito', system-ui, sans-serif;
    font-size: 12px; font-weight: 700; padding: 5px 14px;
    border: 1px solid var(--miw-btn-border, #D5DDE3);
    border-radius: var(--flavor-radius-pill);
    background: var(--miw-btn-bg, #ffffff);
    color: var(--miw-btn-color, #1E2D3D);
    text-decoration: none; cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.toolbar-user-btn:hover {
    background: var(--miw-btn-hover-bg, #2B84A0);
    border-color: var(--miw-btn-hover-bg, #2B84A0);
    color: var(--miw-btn-hover-color, #ffffff);
}

.menu-toggle {
    display: none;
    border: 1px solid var(--miw-btn-border, #D5DDE3);
    background: var(--miw-btn-bg, #ffffff);
    padding: 8px 18px; cursor: pointer; margin: 6px 0;
    font-family: inherit; font-weight: 700;
    color: var(--miw-menu-color, #1E2D3D);
    border-radius: var(--flavor-radius-pill);
    font-size: 13px; transition: background 0.15s;
}
.menu-toggle:hover {
    background: var(--miw-menu-hover-bg, rgba(43,132,160,0.06));
    color: var(--miw-menu-hover-color, #2B84A0);
}

@media (max-width: 768px) {
    .site-toolbar { flex-wrap: wrap; padding: 0 16px; }
    .menu-toggle { display: block; }
    .main-navigation { width: 100%; order: 2; }
    .main-navigation ul { display: none; flex-direction: column; align-items: stretch; padding: 4px 0 8px; width: 100%; background: #fff; border-radius: 0 0 12px 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
    .main-navigation.toggled ul { display: flex; }
    .main-navigation a { padding: 10px 16px; text-align: left; }
    .main-navigation ul ul { position: static; box-shadow: none; border-radius: 0; border: none; background: #F5F8FA; margin: 0; }
    .main-navigation ul ul a { padding-left: 32px; }
    .toolbar-user { order: 1; margin-left: auto; padding: 10px 0; }
    .toolbar-user-greeting { display: none; }
}

/* Hide old standalone user-bar if still in markup */
.flavor-user-bar { display: none; }

/* === CONTENT === */
.site-content {
    width: 100%; margin: 0; padding: 0 0 40px 0;
    position: relative; z-index: 1;
    overflow-x: hidden;
}
.site-main { margin: 0; padding: 0; }

.entry-title {
    font-size: 1.5rem; font-weight: 800; margin-bottom: 12px;
    color: var(--flavor-primary-dark);
}
.entry-title a { text-decoration: none; color: inherit; }
.page .entry-title { display: none; }
.entry-meta { font-size: 0.85rem; margin-bottom: 14px; color: var(--flavor-text-soft); font-weight: 600; }
.entry-content { margin-bottom: 30px; }
.entry-content p { margin-bottom: 1em; }
.entry-content ul, .entry-content ol { margin: 0 0 1em 1.5em; }
.entry-footer { font-size: 0.85rem; margin-bottom: 30px; padding-bottom: 30px; border-bottom: 2px solid var(--flavor-border-light); }

/* === FOOTER === */
.site-footer {
    text-align: center; padding: 16px 24px; font-size: 0.8rem;
    color: #6B7D8D; font-weight: 600;
    background: #fff;
    border-top: 1px solid #E5ECF0;
    position: relative; z-index: 1;
}
.site-footer a { color: #2B84A0; }

/* === FORMS === */
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="number"], input[type="tel"], textarea, select {
    border: 2px solid var(--flavor-border);
    padding: 10px 18px;
    font-size: 1rem; width: 100%; max-width: 100%;
    font-family: inherit; border-radius: var(--flavor-radius);
    background: rgba(255,255,255,0.85);
    
    color: var(--flavor-text); font-weight: 600;
    transition: all 0.3s var(--flavor-ease-smooth);
}
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--flavor-primary);
    box-shadow: 0 0 0 5px rgba(43,132,160,0.2), var(--flavor-shadow);
    background: #fff; 
}

button, input[type="submit"], input[type="button"] {
    padding: 11px 26px; font-size: 1rem;
    cursor: pointer; font-family: inherit;
    border-radius: var(--flavor-radius-pill);
    border: 2px solid transparent;
    background: var(--flavor-grad);
    color: #fff; font-weight: 700;
    box-shadow: 0 4px 16px rgba(43,132,160,0.3);
    transition: all 0.2s ease;
    position: relative; overflow: hidden;
    letter-spacing: 0.02em;
}
button::after, input[type="submit"]::after, input[type="button"]::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 55%);
    border-radius: inherit; pointer-events: none;
}
button:hover, input[type="submit"]:hover, input[type="button"]:hover {
    
    box-shadow: 0 8px 28px rgba(43,132,160,0.4);
}
button:active, input[type="submit"]:active, input[type="button"]:active {
    
}

/* === COMMENTS === */
.comments-area { margin-top: 30px; }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 14px 0; border-bottom: 2px solid var(--flavor-border-light); }
.comment-meta { font-size: 0.85rem; margin-bottom: 8px; color: var(--flavor-text-soft); font-weight: 600; }

/* === ALIGNMENT === */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin: 1em auto; }
.alignwide { max-width: 1200px; margin-left: auto; margin-right: auto; }
.alignfull { max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

/* === WP === */
.wp-caption { max-width: 100%; margin-bottom: 1em; }
.wp-caption-text { font-size: 0.85rem; padding-top: 6px; color: var(--flavor-text-soft); }
.gallery { display: flex; flex-wrap: wrap; gap: 12px; }

.screen-reader-text {
    clip: rect(1px,1px,1px,1px);
    position: absolute !important;
    height: 1px; width: 1px; overflow: hidden;
}

/* === PAGINATION === */
.nav-links { display: flex; justify-content: space-between; gap: 20px; margin: 20px 0; }
.page-numbers {
    padding: 8px 16px; border-radius: var(--flavor-radius-pill);
    font-weight: 700; transition: all 0.2s ease;
}
.page-numbers:hover { background: rgba(43,132,160,0.08); }
.page-numbers.current {
    font-weight: 800; background: var(--flavor-grad); color: #fff;
    box-shadow: 0 4px 12px rgba(43,132,160,0.3);
}

/* === WIDGETS === */
.widget { margin-bottom: 28px; }
.widget-title { font-size: 1.05rem; font-weight: 800; margin-bottom: 10px; color: var(--flavor-primary-dark); }
.widget ul { list-style: none; padding: 0; }

/* (Old user-bar styles removed — now .toolbar-user inside .site-toolbar) */

/* ═══════════════════════════════════
   HOMEPAGE TILE GRID — floating glass cards
   ═══════════════════════════════════ */
.homepage-wrapper {
    position: relative;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    min-height: 50vh;
}
.homepage-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(31,104,130,0.7), rgba(43,132,160,0.5));
    pointer-events: none; z-index: 0;
}
.homepage-inner { position: relative; z-index: 1; }

[data-has-bg="1"] .homepage-title { color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.2); }
[data-has-bg="1"] .homepage-description { color: rgba(255,255,255,0.9); text-shadow: 0 1px 4px rgba(0,0,0,0.2); }

.homepage-hero {
    max-width: 1200px; margin: 0 auto;
    padding: 48px 32px 12px; text-align: center;
}
.homepage-title {
    font-size: 2.2rem; font-weight: 800;
    margin: 0 0 12px;
    /* Gradient text matching LMS */
    background: linear-gradient(135deg, #1F6882, #2B84A0, #5FB8D0);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.homepage-description {
    font-size: 1.1rem; color: var(--flavor-text-soft);
    max-width: 720px; margin: 0 auto 14px;
    line-height: 1.7; font-weight: 600;
}

.homepage-tiles {
    max-width: 1200px; margin: 0 auto;
    padding: 24px 32px 56px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px; align-items: start;
}

.homepage-tile {
    display: flex; flex-direction: column;
    background: #fff;
    border: 1px solid var(--flavor-border-light);
    border-radius: var(--flavor-radius-lg);
    overflow: hidden;
    text-decoration: none; color: var(--flavor-text);
    transition: all 0.25s ease;
    position: relative;
    box-shadow: 0 1px 4px rgba(43,132,160,0.04);
    border-top: none;
}
/* Left accent bar */
.homepage-tile::before {
    content: ''; position: absolute;
    top: 0; left: 0; bottom: 0; width: 4px;
    border-radius: var(--flavor-radius-lg) 0 0 var(--flavor-radius-lg);
    background: var(--tile-accent, var(--flavor-primary));
    z-index: 2;
}
.homepage-tile:hover {
    
    box-shadow: var(--flavor-shadow-lg);
    border-color: rgba(43,132,160,0.12);
}

.homepage-tile-image {
    width: 100%; height: 170px; overflow: hidden;
    background: linear-gradient(135deg, rgba(43,132,160,0.03), rgba(123,191,208,0.06));
    position: relative;
}
.homepage-tile-image img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.4s ease;
}
.homepage-tile:hover .homepage-tile-image img {  }

.homepage-tile-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--tile-accent, var(--flavor-grad));
    opacity: 0.15;
}
.homepage-tile-placeholder span {
    font-size: 72px; font-weight: 800;
    color: #000; text-transform: uppercase;
}

.homepage-tile-body { padding: 22px 24px; flex: 1; }
.homepage-tile-title {
    font-size: 1.2rem; font-weight: 800;
    color: var(--flavor-text); margin: 0 0 8px;
    transition: color 0.3s;
}
.homepage-tile:hover .homepage-tile-title {
    color: var(--flavor-primary);
}
.homepage-tile-desc {
    font-size: 0.9rem; color: var(--flavor-text-soft);
    line-height: 1.6; margin: 0; font-weight: 600;
}

.homepage-tile-arrow {
    padding: 14px 24px; font-size: 20px;
    color: var(--flavor-primary);
    border-top: 2px solid var(--flavor-border-light);
    text-align: right; font-weight: 800;
    transition: all 0.2s ease;
}
.homepage-tile:hover .homepage-tile-arrow {
    padding-right: 18px; color: var(--flavor-primary-dark);
}

.homepage-tiles-empty {
    max-width: 620px; margin: 60px auto; text-align: center;
    padding: 48px 28px; color: var(--flavor-text-soft);
    background: rgba(255,255,255,0.85);
    
    border: 2px solid rgba(200,221,232,0.5);
    border-radius: var(--flavor-radius-xl);
    box-shadow: var(--flavor-shadow);
    font-weight: 600;
}

.homepage-page-content {
    max-width: 960px; margin: 0 auto;
    padding: 24px 32px 48px;
}

@media (max-width: 640px) {
    .homepage-tiles { grid-template-columns: 1fr; padding: 16px 16px 48px; gap: 20px; }
    .homepage-hero { padding: 32px 16px 12px; }
    .homepage-title { font-size: 1.6rem; }
}

/* ═══════════════════════════════════
   EXPANDABLE TILES — bubbly submenu
   ═══════════════════════════════════ */
.homepage-tile--expandable {
    cursor: pointer; text-decoration: none; color: var(--flavor-text);
}

.homepage-tile-toggle {
    padding: 14px 24px;
    border-top: 2px solid var(--flavor-border-light);
    text-align: center;
    color: var(--flavor-primary);
    font-size: 13px; font-weight: 700;
    transition: all 0.3s;
}
.homepage-tile--expandable:hover .homepage-tile-toggle {
    background: rgba(43,132,160,0.04);
}
.homepage-tile-toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}
.homepage-tile--expanded .homepage-tile-toggle-icon {
    transform: rotate(180deg);
}

.homepage-tile-submenu {
    display: none; list-style: none; margin: 0; padding: 0;
    border-top: 2px solid var(--flavor-border-light);
}
.homepage-tile--expanded .homepage-tile-submenu { display: block; }
.homepage-tile-submenu li {
    border-bottom: 1px solid var(--flavor-border-light);
}
.homepage-tile-submenu li:last-child { border-bottom: none; }
.homepage-tile-submenu a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px;
    text-decoration: none; color: var(--flavor-text);
    font-size: 14px; font-weight: 700;
    transition: all 0.2s ease;
    border-radius: 0;
}
.homepage-tile-submenu a:hover {
    background: var(--flavor-grad); color: #fff;
    padding-left: 30px;
}
.homepage-tile-submenu a::after {
    content: '\2192';
    color: var(--flavor-primary); font-weight: 800;
    transition: all 0.25s;
}
.homepage-tile-submenu a:hover::after { color: #fff; transform: translateX(4px); }
