/* ================================================
   zmLdm.com - Primary School English Teaching Site
   Campus/School Style CSS
   ================================================ */

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

/* CSS Variables */
:root {
    --primary: #FF6B35;
    --secondary: #4ECDC4;
    --accent: #FFE66D;
    --dark: #1A535C;
    --light: #F7FFF7;
    --white: #FFFFFF;
    --text: #2D3436;
    --radius: 16px;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Quicksand', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--light);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(78, 205, 196, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 230, 109, 0.05) 0%, transparent 70%);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    color: var(--dark);
}

h1 { font-size: 2.5rem; font-weight: 900; }
h2 { font-size: 2rem; font-weight: 800; }
h3 { font-size: 1.5rem; font-weight: 700; }
h4 { font-size: 1.25rem; font-weight: 600; }

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

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

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

.logo {
    font-family: 'Nunito', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo:hover {
    color: var(--dark);
}

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

.nav-links a {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    color: var(--text);
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-links a:hover {
    background: var(--accent);
    color: var(--dark);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    text-align: center;
    padding: 80px 20px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 30px;
    opacity: 0.95;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 50px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--accent);
    color: var(--dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: var(--white);
    border: 2px solid var(--white);
}

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

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

.btn-orange:hover {
    background: var(--dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

.btn-teal:hover {
    background: var(--dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Section Styles */
.section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    display: inline-block;
    position: relative;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.section-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-top: 10px;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.card h3 {
    margin-bottom: 10px;
}

.card p {
    color: #666;
    font-size: 0.95rem;
}

/* Tool Card */
.tool-card {
    position: relative;
    overflow: hidden;
}

.tool-card .card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent);
    color: var(--dark);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Article Card */
.article-card {
    display: flex;
    flex-direction: column;
}

.article-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
}

.article-card .card-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
}

.article-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.article-card p {
    flex-grow: 1;
}

/* Stats Bar */
.stats-bar {
    background: linear-gradient(135deg, var(--dark) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 40px 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.stat-item {
    padding: 20px;
}

.stat-number {
    font-family: 'Nunito', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent);
    display: block;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Newsletter */
.newsletter {
    background: var(--white);
    padding: 60px 20px;
    text-align: center;
}

.newsletter-form {
    max-width: 500px;
    margin: 30px auto 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.newsletter-form input {
    flex: 1;
    min-width: 250px;
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--secondary);
}

/* Breadcrumb */
.breadcrumb {
    padding: 20px 0;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: var(--secondary);
}

.breadcrumb span {
    margin: 0 8px;
}

/* Footer */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 60px 20px 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer h4 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer ul {
    list-style: none;
}

.footer li {
    margin-bottom: 10px;
}

.footer a {
    color: rgba(255,255,255,0.8);
}

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

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Tool Page Styles */
.tool-page {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 40px 0;
}

.tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.tool-header h1 {
    margin-bottom: 10px;
}

.tool-header p {
    color: #666;
    font-size: 1.1rem;
}

.tool-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius);
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Output Box */
.output-box {
    display: none;
    margin-top: 30px;
    padding: 25px;
    background: var(--light);
    border-radius: var(--radius);
    border: 2px dashed var(--secondary);
}

.output-box h3 {
    color: var(--dark);
    margin-bottom: 15px;
}

.output-box pre {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Quicksand', sans-serif;
    line-height: 1.8;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.output-buttons {
    display: flex;
    gap: 10px;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 60px 20px;
    text-align: center;
}

.page-header h1 {
    color: var(--white);
    margin-bottom: 10px;
}

.page-header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Filter/Search */
.filter-bar {
    padding: 30px 0;
    background: var(--white);
    border-bottom: 1px solid #e0e0e0;
}

.filter-bar .container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar input {
    flex: 1;
    min-width: 250px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
}

.filter-bar select {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    background: var(--white);
    cursor: pointer;
}

/* Article Content */
.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.article-featured-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-body h2 {
    margin: 40px 0 20px;
    color: var(--dark);
}

.article-body h3 {
    margin: 30px 0 15px;
    color: var(--dark);
}

.article-body p {
    margin-bottom: 20px;
}

.article-body ul,
.article-body ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-body li {
    margin-bottom: 10px;
}

.article-body blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: #666;
}

.related-tools {
    background: var(--light);
    padding: 40px;
    border-radius: var(--radius);
    margin-top: 50px;
}

.related-tools h3 {
    margin-bottom: 20px;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

/* 404 Page */
.error-page {
    text-align: center;
    padding: 100px 20px;
}

.error-page .error-icon {
    font-size: 8rem;
    margin-bottom: 20px;
}

.error-page h1 {
    margin-bottom: 15px;
}

.error-page p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Privacy, Terms, Disclaimer pages */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.legal-content h2 {
    margin: 40px 0 20px;
    color: var(--dark);
}

.legal-content h3 {
    margin: 30px 0 15px;
}

.legal-content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.legal-content ul {
    margin: 20px 0;
    padding-left: 30px;
}

.legal-content li {
    margin-bottom: 10px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        gap: 10px;
        box-shadow: var(--shadow);
    }

    .nav-links.active {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }

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

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .tool-page {
        padding: 25px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}

/* Ad Container Styling */
.ad-container {
    margin: 20px auto;
    text-align: center;
    min-height: 90px;
    background: var(--light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Page wrapper for footer spacing */
.page-wrapper {
    min-height: calc(100vh - 200px);
}
