@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #9b72aa; /* INSIDE Brand Purple */
    --footer-bg: #121212;
    --nav-height: 90px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- INTRO OVERLAY (Эхлэлийн хар дэлгэц) --- */
#intro-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background-color: #000; z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 2s ease-in-out, visibility 2s; 
}
#intro-overlay img { width: 150px; animation: zoomOut 3s ease forwards; }
#intro-overlay.fade-out { opacity: 0; visibility: hidden; }
@keyframes zoomOut { 0% { transform: scale(1.2); opacity: 0; } 20% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* --- NAVIGATION (Header) --- */
header {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--nav-height);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 50px; z-index: 1000; background: transparent; 
    transform: translateY(-100%); /* Анхнаасаа нуугдсан */
    transition: transform 0.5s ease, background 0.4s ease, box-shadow 0.4s ease;
}
header.visible { transform: translateY(0); } /* Scroll хийхэд гарч ирнэ */
header.scrolled { background: rgba(255, 255, 255, 0.98); box-shadow: 0 2px 15px rgba(0,0,0,0.05); height: 70px; }
header.scrolled .nav-links a, header.scrolled .logo-text, header.scrolled .hamburger { color: #333 !important; }
header.scrolled .logo-img { filter: none; } 

.logo { display: flex; align-items: center; gap: 12px; z-index: 1001; }
.logo img { height: 35px; transition: 0.3s; }
.logo-text { font-size: 1.5rem; font-weight: 700; letter-spacing: 2px; color: #fff; text-transform: uppercase; }
.logo-text span { color: var(--accent-color); }

/* Desktop Menu */
.nav-links { display: flex; gap: 40px; }
.nav-links a { font-size: 0.8rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: #fff; position: relative; padding-bottom: 5px; }
.nav-links a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--accent-color); transition: 0.3s; }
.nav-links a:hover::after { width: 100%; }

/* Hamburger Menu Button (Default Hidden) */
.hamburger { display: none; font-size: 1.5rem; color: #fff; cursor: pointer; z-index: 1001; }

/* --- HERO SLIDER --- */
.hero-slider { position: relative; height: 100vh; width: 100%; overflow: hidden; }
.slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.5s ease-in-out; transform: scale(1.1); z-index: 1; }
.slide.active { opacity: 1; transform: scale(1); transition: opacity 1.5s ease-in-out, transform 6s linear; }
.slide::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.35); z-index: 2; }
.hero-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: #fff; z-index: 10; width: 100%; padding: 0 20px; }
.hero-logo-large { height: 100px; margin: 0 auto 20px; filter: none; }
.hero-title { font-size: 3.5rem; font-weight: 1200; letter-spacing: 8px; text-transform: uppercase; margin-bottom: 10px; }
.hero-subtitle { font-size: 1rem; font-weight: 400; letter-spacing: 4px; text-transform: uppercase; opacity: 0.9; }
.scroll-down { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 2rem; animation: bounce 2s infinite; cursor: pointer; z-index: 10; }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);} 40% {transform: translateX(-50%) translateY(-10px);} 60% {transform: translateX(-50%) translateY(-5px);} }

/* --- GLOBAL SECTIONS --- */
.section-padding { padding: 100px 50px; }
.section-title { text-align: center; margin-bottom: 60px; }
.section-title h2 { font-size: 2rem; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 15px; color: #333; }
.line { width: 60px; height: 3px; background: var(--accent-color); margin: 0 auto; }
.page-header { padding-top: 150px; padding-bottom: 50px; text-align: center; background: #f9f9f9; margin-bottom: 50px; }

/* --- SERVICES & PORTFOLIO --- */
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }
.service-card { text-align: center; padding: 40px 30px; background: #fff; border: 1px solid #f0f0f0; border-radius: 5px; transition: 0.3s; }
.service-card:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(0,0,0,0.08); border-color: var(--accent-color); }
.icon-box { width: 70px; height: 70px; margin: 0 auto 25px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(155, 114, 170, 0.1); color: var(--accent-color); }
.service-card:hover .icon-box { background: var(--accent-color); color: #fff; }
.icon-box svg { width: 32px; height: 32px; stroke: currentColor; }
.service-card h3 { margin-bottom: 15px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; color: #333; }
.service-card p { font-size: 0.9rem; color: #666; line-height: 1.6; }
.portfolio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 0 50px; }
.portfolio-item { position: relative; display: block; overflow: hidden; height: 400px; border-radius: 4px; }
.portfolio-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.portfolio-item:hover img { transform: scale(1.05); }
.portfolio-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); display: flex; flex-direction: column; justify-content: flex-end; padding: 30px; opacity: 0; transition: 0.4s; }
.portfolio-item:hover .portfolio-overlay { opacity: 1; }
.portfolio-info h3 { color: #fff; font-size: 1.2rem; text-transform: uppercase; margin-bottom: 5px; transform: translateY(20px); transition: 0.4s; }
.portfolio-info p { color: var(--accent-color); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; transform: translateY(20px); transition: 0.4s 0.1s; }
.portfolio-item:hover h3, .portfolio-item:hover p { transform: translateY(0); }
.filter-container { text-align: center; margin-bottom: 40px; }
.filter-btn { background: transparent; border: 1px solid #444; color: #888; padding: 8px 25px; margin: 5px; border-radius: 30px; cursor: pointer; transition: 0.3s; font-family: 'Montserrat', sans-serif; font-weight: 600; }
.filter-btn:hover, .filter-btn.active { background: #9b72aa; border-color: #9b72aa; color: #fff; }

/* --- TEAM --- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; padding: 0 50px; }
.team-member { text-align: center; }
.team-member img { width: 180px; height: 180px; object-fit: cover; border-radius: 50%; margin: 0 auto 20px; border: 3px solid #eee; transition: 0.3s; }
.team-member:hover img { border-color: var(--accent-color); transform: scale(1.05); }
.team-member h4 { font-size: 1.1rem; text-transform: uppercase; color: #333; margin-bottom: 5px; }
.team-member p { font-size: 0.9rem; color: var(--accent-color); font-weight: 600; text-transform: uppercase; }

/* --- FOOTER & CHATBOT --- */
footer { background: var(--footer-bg); color: #bbb; padding: 40px 50px; margin-top: auto; border-top: 1px solid #222; }
.footer-container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; max-width: 1400px; margin: 0 auto; }
.footer-left h3 { color: #fff; letter-spacing: 2px; font-size: 1.2rem; margin-bottom: 5px; }
.footer-info { display: flex; gap: 30px; align-items: center; font-size: 0.85rem; }
.footer-info i { color: var(--accent-color); margin-right: 8px; font-size: 1rem; }
.footer-item { display: flex; align-items: center; }
.footer-divider { color: #333; height: 20px; border-left: 1px solid #333; }
.copyright { font-size: 0.75rem; color: #555; margin-top: 5px; }
.chatbot-btn { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background: #9b72aa; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 28px; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 9999; border: 2px solid rgba(255,255,255,0.2); transition: 0.3s; }
.chatbot-btn:hover { transform: scale(1.1) rotate(10deg); background: #fff; color: #9b72aa; }
.chat-window { position: fixed; bottom: 100px; right: 30px; width: 350px; height: 480px; background: #fff; border-radius: 15px; box-shadow: 0 5px 30px rgba(0,0,0,0.2); z-index: 9998; display: flex; flex-direction: column; overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.3s ease; font-family: 'Montserrat', sans-serif; }
.chat-window.active { opacity: 1; visibility: visible; transform: translateY(0); }
.chat-header { background: #9b72aa; color: #fff; padding: 15px; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.bot-avatar { width: 35px; height: 35px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #9b72aa; font-size: 18px; }
.close-chat { margin-left: auto; cursor: pointer; }
.chat-messages { flex: 1; padding: 15px; overflow-y: auto; background: #f9f9f9; display: flex; flex-direction: column; gap: 10px; color: #333; }
.message { max-width: 80%; padding: 10px 15px; border-radius: 15px; font-size: 0.9rem; position: relative; animation: fadeIn 0.3s ease; line-height: 1.4; }
.bot-msg { background: #e9ecef; color: #333; align-self: flex-start; border-bottom-left-radius: 2px; }
.user-msg { background: #9b72aa; color: #fff; align-self: flex-end; border-bottom-right-radius: 2px; }
.chat-options { padding: 10px; background: #fff; border-top: 1px solid #eee; display: flex; flex-wrap: wrap; gap: 5px; }
.option-btn { background: transparent; border: 1px solid #9b72aa; color: #9b72aa; padding: 8px 12px; border-radius: 20px; font-size: 0.8rem; cursor: pointer; flex: 1 1 auto; text-align: center; transition: 0.2s; }
.option-btn:hover { background: #9b72aa; color: #fff; }
.chat-form { display: none; padding: 15px; background: #fff; border-top: 1px solid #eee; flex-direction: column; gap: 10px; }
.chat-form.active { display: flex; }
.chat-input { padding: 10px; border: 1px solid #ddd; border-radius: 5px; outline: none; font-family: inherit; font-size: 0.85rem; background: #fff; color: #333; }
.send-btn { background: #9b72aa; color: #fff; border: none; padding: 10px; border-radius: 5px; cursor: pointer; font-weight: 600; }
.cancel-btn { background: #eee; color: #333; border: none; padding: 5px; border-radius: 5px; cursor: pointer; font-size: 0.8rem; text-align: center; }
.main-footer { background: #121212; padding: 70px 0 30px; color: #888; border-top: 1px solid #222; font-size: 0.9rem; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 50px; }
.footer-column h4 { color: #fff; margin-bottom: 25px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.footer-link { display: flex; align-items: center; gap: 12px; color: #888; text-decoration: none; margin-bottom: 15px; transition: 0.3s; }
.footer-link i { color: #9b72aa; width: 20px; text-align: center; }
.footer-link:hover { color: #fff; transform: translateX(5px); }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid #1f1f1f; font-size: 0.8rem; color: #555; }
.chat-link { color: #9b72aa; text-decoration: underline; font-weight: bold; }
.contact-link { text-decoration: none; color: inherit; transition: 0.3s; cursor: pointer; }
.contact-link:hover { color: #9b72aa; text-decoration: underline; }

/* --- RESPONSIVE & MOBILE MENU (Утасны тохиргоо) --- */
@media (max-width: 900px) {
    header, body.dark-header header, header.scrolled { height: 60px !important; padding: 0 20px !important; }
    .logo img { height: 25px !important; }
    .logo-text { font-size: 1.1rem !important; }
    .hero-title { font-size: 1.8rem !important; letter-spacing: 3px !important; }
    .hero-logo-large { height: 60px !important; }
    
    .hamburger { display: block; } /* Утсан дээр товч харагдана */
    
    .nav-links {
        position: fixed; top: 60px; right: -100%; width: 100%; height: calc(100vh - 60px);
        background: #1a1a1a; flex-direction: column; align-items: center; justify-content: center;
        transition: 0.4s ease-in-out; gap: 40px; box-shadow: none;
    }
    .nav-links.active { right: 0; }
    .nav-links a { font-size: 1.2rem; color: #fff !important; }
}

/* --- FIX: INNER PAGES HEADER --- */
body.dark-header header { background-color: #1a1a1a !important; box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important; height: 90px; transform: translateY(0) !important; }
body.dark-header header .nav-links a, body.dark-header header .logo-text, body.dark-header .hamburger { color: #ffffff !important; }
body.dark-header header .logo-img { filter: none !important; }