:root {
    --primary-color: #D32F2F; /* Deep red */
    --primary-hover: #B71C1C;
    --secondary-color: #FFC107; /* Gold */
    --secondary-hover: #FFA000;
    --text-main: #2D3748;
    --text-muted: #718096;
    --bg-main: #F7FAFC;
    --bg-card: #FFFFFF;
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius-md: 8px;
    --radius-lg: 16px;
    --transition-speed: 0.3s;
}

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

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

ul {
    list-style: none;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(211, 47, 47, 0.39);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-large {
    padding: 14px 32px;
    font-size: 1.1rem;
}

/* Header */
.main-header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    max-height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    color: var(--text-main);
    font-weight: 600;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    position: relative;
    padding: 120px 0;
    text-align: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFF9F9 0%, #FFF0F0 100%);
    z-index: -1;
}

.hero-background::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(211,47,47,0.05) 0%, rgba(211,47,47,0) 70%);
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 20px;
    line-height: 1.1;
    animation: fadeInUp 0.8s ease backwards;
}

.hero-title span {
    color: var(--primary-color);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

/* Features */
.features {
    padding: 80px 0;
    background-color: var(--bg-card);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--text-main);
}

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

.feature-card {
    background-color: var(--bg-main);
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    border: 1px solid var(--border-color);
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

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

.page-title {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.page-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* Resources Grid */
.resources-section {
    padding: 80px 0;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.resource-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-speed) ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease forwards;
}

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

.resource-img-container {
    height: 200px;
    overflow: hidden;
    position: relative;
    background-color: #f0f0f0;
}

.resource-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.resource-card:hover .resource-img {
    transform: scale(1.05);
}

.resource-type-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.resource-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.resource-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

.resource-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.resource-action {
    margin-top: auto;
}

.btn-download {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background-color: var(--primary-color);
    color: white;
}

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

.error-msg {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--primary-color);
    padding: 40px;
    background-color: #FFF5F5;
    border-radius: var(--radius-md);
}

/* Footer */
.main-footer {
    background-color: #1A202C; /* Dark text main */
    color: white;
    padding: 60px 0 20px;
}

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

.footer-logo {
    height: 60px;
    filter: brightness(0) invert(1);
    margin-bottom: 20px;
}

.footer-col h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: white;
}

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

.footer-col ul a {
    color: #A0AEC0;
}

.footer-col ul a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #718096;
    font-size: 0.9rem;
}

/* Loading state */
.loading-spinner {
    border: 4px solid rgba(0,0,0,0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    text-align: center;
    color: var(--text-muted);
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--bg-main);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.page-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

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

.loader-logo {
    max-width: 150px;
    width: 60vw;
    height: auto;
    margin: 0 auto;
    animation: shake 0.6s ease-in-out infinite alternate;
}

@keyframes shake {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-5deg) scale(1.05); }
    50% { transform: rotate(0deg) scale(1.1); }
    75% { transform: rotate(5deg) scale(1.05); }
    100% { transform: rotate(0deg) scale(1); }
}

/* Stats Section */
.stats {
    background-color: var(--primary-color);
    padding: 80px 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}
.stat-item {
    background-color: var(--bg-card);
    padding: 40px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-speed) ease;
}
.stat-item:hover {
    transform: translateY(-5px);
}
.stat-item h3 { font-size: 3rem; margin-bottom: 10px; color: var(--primary-color); }
.stat-item p { font-size: 1.1rem; color: var(--text-main); font-weight: 600; }

/* Languages Section */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}
.language-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed) ease;
}
.language-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-hover);
}
.lang-icon { font-size: 3rem; margin-bottom: 15px; }
.lang-name { font-weight: 700; font-size: 1.25rem; color: var(--text-main); }

/* Testimonials */
.testimonials { background-color: var(--bg-main); padding: 80px 0; }
.testimonial-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: relative;
    border: 1px solid var(--border-color);
}
.testimonial-quote { font-style: italic; margin-bottom: 20px; color: var(--text-muted); }
.testimonial-author { font-weight: 600; color: var(--text-main); }
.testimonial-author span { display: block; font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }

/* Contact Form */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
}
@media (max-width: 768px) {
    .contact-grid { grid-template-columns: 1fr; }
}
.contact-info-card {
    background: var(--primary-color);
    color: white;
    padding: 40px;
    border-radius: var(--radius-lg);
}
.contact-info-card h3 { color: white; margin-bottom: 20px; }
.info-item { margin-bottom: 20px; }
.info-item strong { display: block; margin-bottom: 5px; }

.contact-form {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-main); }
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition-speed) ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* About Us Image */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.about-img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
@media (max-width: 768px) { .about-grid { grid-template-columns: 1fr; } }

/* That's Mandarin Inspired Styles */
.tm-hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.7)), url('https://images.unsplash.com/photo-1523240795612-9a054b0db644?auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
    color: white;
    padding: 160px 0;
}
.tm-hero .hero-title {
    color: white;
    font-size: 4.5rem;
}
.tm-hero .hero-title span { color: var(--secondary-color); }
.tm-hero .hero-subtitle {
    color: rgba(255,255,255,0.9);
}

.tm-section { padding: 80px 0; }
.bg-light { background-color: var(--bg-main); }

.tm-section-header { text-align: center; margin-bottom: 50px; }
.tm-section-header h2 { font-size: 2.5rem; color: var(--text-main); margin-bottom: 15px; }
.tm-section-header p { font-size: 1.15rem; color: var(--text-muted); max-width: 700px; margin: 0 auto; }

.tm-grid-5 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
@media (min-width: 1024px) {
    .tm-grid-5 { grid-template-columns: repeat(5, 1fr); }
}

.lang-img-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 300px;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-md);
}
.lang-img-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-5px); }
.lang-img-card:hover .tm-card-overlay { background: linear-gradient(transparent 40%, rgba(211,47,47,0.9)); }
.tm-card-overlay {
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(transparent 50%, rgba(0,0,0,0.8));
    display: flex; align-items: flex-end; padding: 25px;
    transition: background var(--transition-speed) ease;
}
.tm-card-overlay h3 { color: white; font-size: 1.5rem; margin: 0; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

.tm-stats {
    background-color: var(--primary-color);
    padding: 60px 0;
    color: white;
}
.tm-stats-grid {
    display: flex; justify-content: space-around; flex-wrap: wrap; text-align: center; gap: 40px;
}
.tm-stat strong { display: block; font-size: 3.5rem; line-height: 1; margin-bottom: 5px; }
.tm-stat span { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.9; font-weight: 600; }

.tm-split { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.tm-split-text h2 { font-size: 2.5rem; margin-bottom: 20px; color: var(--text-main); }
.tm-split-text p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 20px; line-height: 1.8; }
.tm-split-image img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; }

.btn-outline {
    display: inline-block; padding: 12px 28px; border: 2px solid var(--primary-color); color: var(--primary-color); border-radius: var(--radius-md); font-weight: 600; transition: all var(--transition-speed);
}
.btn-outline:hover { background: var(--primary-color); color: white; }

.tm-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.tm-feature-block {
    background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); transition: transform 0.3s;
}
.tm-feature-block:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }
.tm-feature-img { width: 100%; height: 220px; object-fit: cover; }
.tm-feature-block h3 { padding: 30px 30px 10px; font-size: 1.5rem; color: var(--text-main); }
.tm-feature-block p { padding: 0 30px 30px; color: var(--text-muted); }

/* Floating Contact Bar */
.floating-contact-bar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    background-color: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    border-radius: 12px 0 0 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-right: none;
}

.contact-icon {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}
.contact-icon:last-child { border-bottom: none; }

.contact-icon svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.contact-icon:hover {
    background-color: var(--bg-main);
}
.contact-icon:hover svg {
    transform: scale(1.2);
}

.whatsapp:hover, .whatsapp { color: #25D366; }
.dingtalk:hover, .dingtalk { color: #008CEE; }
.line:hover, .line { color: #00C300; }

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Shared Content */
.section-content { max-width: 800px; margin: 0 auto 50px; text-align: center; color: var(--text-muted); font-size: 1.1rem; }

/* Responsive */
@media (max-width: 768px) {
    .floating-contact-bar { 
        right: auto;
        left: 50%;
        bottom: 20px; 
        top: auto; 
        transform: translateX(-50%); 
        flex-direction: row; 
        border-radius: 30px;
        border: 1px solid var(--border-color);
    }
    .contact-icon { width: 50px; height: 50px; border-bottom: none; border-right: 1px solid var(--border-color); }
    .contact-icon:last-child { border-right: none; }
    .contact-icon svg { width: 24px; height: 24px; }
    .tm-split { grid-template-columns: 1fr; }
    .tm-hero { padding: 100px 0; }
    .tm-hero .hero-title { font-size: 3rem; }
    .hero-title { font-size: 2.5rem; }
    .nav-list { display: none; /* In a real app we'd add a hamburger menu */ }
    .btn-large { padding: 12px 24px; }
}
