/* Layout.css - Global styles for navigation, breadcrumbs, and footer */

/* CSS Variables for consistent theming */
:root {
    --primary: #0B1A36;
    --secondary: #C99846;
    --cta: #EB5E28;
    --bg: #F7F8FA;
    --text: #212529;
    --muted: #6c757d;
    --card: #ffffff;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(0,0,0,0.06);
}

/* Header / Nav - Universal styling from index.html */
header {
    position: sticky; 
    top: 0; 
    z-index: 1000;
    background: #ffffffe6;
    backdrop-filter: saturate(120%) blur(6px);
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}

/* Ensure dropdown menus appear above header */
.dropdown-menu {
    z-index: 1002 !important;
}

.nav {
    height: 64px;
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    width: 100%;
}

/* Brand Styles - Universal from index.html */
.brand {
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-weight: 800; 
    font-size: 16px;
}

.brand a {
    color: var(--text);
}

.brand-badge {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(11,26,54,.25);
}

.brand-name {
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    font-size: 16px;
    white-space: nowrap;
}

.brand-name:hover {
    color: var(--secondary);
}

/* Navigation Links - Universal from index.html */
.nav-links {
    display: none; 
    gap: 18px; 
    align-items: center;
}

.nav-links a {
    color: var(--text);
    padding: 8px 10px;
    border-radius: 8px;
    transition: background .2s ease, color .2s ease;
}

.nav-links a:hover {
    background: #f1f5f9;
    color: var(--secondary);
}

/* Dropdown Navigation - Universal from index.html */
.nav-item {
    position: relative;
}

.nav-item .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: var(--text);
    padding: 8px 10px;
    border-radius: 8px;
    transition: background .2s ease, color .2s ease;
}

.nav-item .dropdown-toggle:hover {
    background: #f1f5f9;
    color: var(--secondary);
}

.nav-item .dropdown-toggle::after {
    content: "▼";
    font-size: 10px;
    transition: transform 0.2s ease;
}

.nav-item:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1002 !important;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: #f8f9fa;
    color: var(--secondary);
}

/* Hamburger Menu - Universal from index.html */
.hamburger {
    background: transparent;
    border: 0;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger:focus {
    outline: 2px solid var(--secondary);
}

.hamburger span, .hamburger span::before, .hamburger span::after {
    display: block;
    background: var(--text);
    height: 2px;
    width: 20px;
    border-radius: 2px;
    position: relative;
    transition: transform .2s ease, opacity .2s ease;
}

.hamburger span::before, .hamburger span::after {
    content: "";
    position: absolute;
    left: 0;
}

.hamburger span::before {
    top: -6px;
}

.hamburger span::after {
    top: 6px;
}

/* Mobile Menu - Universal from index.html */
.mobile-menu {
    display: none; 
    padding: 10px 0; 
    border-top: 1px solid #eef2f6; 
    background: #fff;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.mobile-menu a {
    display: block; 
    padding: 10px; 
    color: var(--text); 
    text-decoration: none;
    border-radius: 8px;
}

.mobile-menu a:hover {
    background: #f1f5f9;
    color: var(--secondary);
}

/* Mobile Dropdown Navigation - Universal from index.html */
.mobile-nav-item {
    position: relative;
}

.mobile-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    background: #f8f9fa;
    margin: 5px 0;
}

.mobile-dropdown-toggle::after {
    content: "▼";
    font-size: 12px;
    transition: transform 0.2s ease;
}

.mobile-dropdown-toggle.active::after {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    display: none;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 5px 0;
    overflow: hidden;
    z-index: 1002;
}

.mobile-dropdown-menu.active {
    display: block;
}

.mobile-dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--text);
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
}

.mobile-dropdown-menu a:last-child {
    border-bottom: none;
}

.mobile-dropdown-menu a:hover {
    background: #f8f9fa;
    color: var(--secondary);
}

/* Responsive Design - Universal from index.html */
@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
    
    .hamburger {
        display: none;
    }
    
    .mobile-menu {
        display: none !important;
    }
}

/* Additional responsive adjustments - Universal from index.html */
@media (min-width: 1024px) {
    .hero-box {
        padding: 32px;
    }
}

/* RTL Specific Styles */
[dir="rtl"] .dropdown-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .mobile-dropdown-menu {
    padding-right: 0;
    padding-left: 1rem;
}

/* Breadcrumbs Styles - Clean and Simple */
.breadcrumbs {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    text-align: right;
    direction: rtl;
    display: flex;
    justify-content: flex-end;
    width: 100%;
    font-family: 'Vazirmatn', sans-serif;
    /* Ensure breadcrumbs appear below hero with proper spacing */
    order: 1;
    z-index: 100;
}

.breadcrumbs .container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 0 16px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.breadcrumbs a:hover {
    color: var(--secondary);
    background: rgba(0, 0, 0, 0.05);
}

.breadcrumbs .current {
    color: var(--text);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Ensure proper spacing between layout components */
header {
    margin-bottom: 0;
}

.breadcrumbs {
    margin: 0;
}

main {
    margin: 0;
    padding-top: 0;
}

footer {
    margin-top: 0;
}

/* Footer Styles */
footer {
    background: var(--primary);
    color: #fff;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
    z-index: 100;
}

.footer-top {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-brand h3 {
    margin: 0 0 0.5rem;
    color: #fff;
}

.footer-brand p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.footer-social a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--secondary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.2s ease;
}

.footer-social a:hover {
    background: var(--cta);
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .footer-top {
        grid-template-columns: 1fr auto;
    }
}

/* RTL breadcrumb direction */
[dir="rtl"] .breadcrumbs .container {
    flex-direction: row-reverse;
}

/* RTL breadcrumb positioning and styling */
.breadcrumbs .container {
    margin-left: auto;
    margin-right: 0;
    display: flow;
}

.breadcrumbs .container > * {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Breadcrumb separator styling */
.breadcrumbs .separator {
    color: var(--muted);
    margin: 0 0.25rem;
    font-weight: 300;
}

/* RTL breadcrumb separator positioning */
.breadcrumbs .container > *:not(:last-child)::after {
    content: " > ";
    color: var(--muted);
    margin: 0 0.25rem;
    font-weight: 300;
}

/* Ensure breadcrumb items don't wrap */
.breadcrumbs span {
    white-space: nowrap;
}

/* Current page styling */
.breadcrumbs .current {
    color: var(--text);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Navigation spacing adjustments */
.nav {
    border-bottom: none;
}

/* Main content spacing */
main {
    min-height: 60vh;
    /* Use flexbox for proper ordering of hero, breadcrumbs, and sections */
    display: flex;
    flex-direction: column;
    /* Ensure main content has proper margins */
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    z-index: 100;
}

/* Utility classes for navigation spacing */
.nav + .header {
    margin-top: 0;
}

.nav + main {
    margin-top: 0;
}

/* Ensure navigation doesn't interfere with page headers */
header[role="banner"] + .header {
    margin-top: 0;
}

/* Fix for any potential z-index issues */
.nav {
    z-index: 1000;
}

/* Ensure proper font loading */
body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== PAGE CONTENT STYLES ===== */

/* Universal page content container */
.page-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    z-index: 100;
}

/* Ensure all content sections have proper margins */
.page-content > *,
main > * {
    max-width: 100%;
}

/* Additional spacing for content elements */
.page-content section,
main section {
    margin-left: auto;
    margin-right: auto;
    z-index: 100;
}

/* Hero Section - NOT sticky, lower z-index */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    text-align: center;
    padding: 4rem 2rem;
    margin: 0;
    /* Ensure hero appears first */
    order: 0;
    /* Hero section is NOT sticky and has lower z-index */
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    margin: 0;
    opacity: 0.9;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Section Styling */
section {
    padding: 3rem 2rem;
    margin: 0;
    /* Ensure sections appear after breadcrumbs */
    order: 2;
    z-index: 100;
}

section:nth-child(even) {
    background: var(--bg);
}

section h2 {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 2rem 0;
    text-align: center;
}

section h3 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

section h4 {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

section p {
    color: var(--text);
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

section ul, section ol {
    color: var(--text);
    line-height: 1.6;
    margin: 0 0 1rem 0;
    padding-right: 1.5rem;
}

section li {
    margin-bottom: 0.5rem;
}

section strong {
    color: var(--primary);
    font-weight: 600;
}

/* ===== COACHING PAGE STYLES ===== */

/* Coaching Process Steps */
.coaching-process {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #e9ecef;
    text-align: center;
}

.step h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
}

/* ===== RESOURCES PAGE STYLES ===== */

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.book {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #e9ecef;
}

.book h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--bg);
    padding-bottom: 0.5rem;
}

.book p {
    margin-bottom: 0.75rem;
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.app {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #e9ecef;
    text-align: center;
}

.app h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tool {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #e9ecef;
    text-align: center;
}

.tool h3 {
    color: var(--secondary);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

/* ===== LEARNING HUB PAGE STYLES ===== */

/* Levels Grid */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.level {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #e9ecef;
}

.level h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
    text-align: center;
    border-bottom: 2px solid var(--bg);
    padding-bottom: 0.5rem;
}

.level ul {
    margin-top: 1rem;
}

/* Skills Lessons */
.skills-lessons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.skill {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #e9ecef;
}

.skill h3 {
    color: var(--secondary);
    margin-bottom: 1.5rem;
    text-align: center;
    border-bottom: 2px solid var(--bg);
    padding-bottom: 0.5rem;
}

.lesson-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lesson {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: calc(var(--radius) - 4px);
    border: 1px solid #e9ecef;
}

.lesson h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.lesson p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.lesson-link {
    display: inline-block;
    background: var(--secondary);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: calc(var(--radius) - 4px);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.lesson-link:hover {
    background: var(--cta);
    transform: translateY(-2px);
}

/* Mock Tests */
.mock-tests {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.test {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #e9ecef;
    text-align: center;
}

.test h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
}

.test p {
    margin-bottom: 1.5rem;
    color: var(--muted);
}

/* ===== COMMON BUTTON STYLES ===== */

.btn-primary {
    display: inline-block;
    background: var(--cta);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-secondary {
    display: inline-block;
    background: var(--secondary);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--cta);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ===== CTA SECTION STYLES ===== */

.cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    text-align: center;
    padding: 4rem 2rem;
}

.cta h2 {
    color: #fff;
    margin-bottom: 1rem;
}

.cta p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .page-content {
        padding: 0 1rem;
    }
    
    main {
        padding: 0 1rem;
    }
    
    .hero {
        padding: 3rem 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    section {
        padding: 2rem 1rem;
    }
    
    section h2 {
        font-size: 1.75rem;
    }
    
    .coaching-process,
    .books-grid,
    .apps-grid,
    .tools-grid,
    .levels-grid,
    .skills-lessons,
    .mock-tests {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .step,
    .book,
    .app,
    .tool,
    .level,
    .skill,
    .test {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 0 0.75rem;
    }
    
    main {
        padding: 0 0.75rem;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    section {
        padding: 1.5rem 1rem;
    }
    
    section h2 {
        font-size: 1.5rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}
