/* =========================================
   CTM Manage Inter - Master Stylesheet
   Theme: Modern Orange & White (Glassmorphism + Overlay Navbar)
   ========================================= */

/* 1. การตั้งค่าตัวแปรสีหลัก */
:root {
    --primary-orange: #FF6600; 
    --secondary-orange: #FF9933; 
    --light-orange-bg: #FFF7F0; 
    --dark-text: #333A45; 
    --white-text: #FFFFFF;
    --border-color: #F0A06E; 
    --shadow-color-light: rgba(255, 102, 0, 0.1); 
    --shadow-color-strong: rgba(255, 102, 0, 0.35); 
}

/* 2. Global Settings */
body {
    font-family: 'Kanit', sans-serif;
    color: var(--dark-text);
    background-color: #f9f9f9;
    background-image: repeating-linear-gradient(45deg, rgba(255, 153, 51, 0.03) 0px, rgba(255, 153, 51, 0.03) 1px, transparent 1px, transparent 10px);
    
    /* ดันเนื้อหาลงมาสำหรับหน้าอื่นๆ ที่ไม่ใช่หน้าแรก เพื่อไม่ให้ Navbar บัง */
    /* แต่เนื่องจากคุณอยากได้เมนูลอย เราต้องจัดการ padding-top ในแต่ละหน้า หรือใส่ bg-header */
}

a {
    color: var(--primary-orange);
    text-decoration: none;
    transition: all 0.3s ease;
}
a:hover { color: #CC5200; text-decoration: none; }

/* =========================================
   3. Navbar Styles (Overlay & Transparent & Glowing Text)
   ========================================= */

/* ใช้สไตล์นี้กับทุกหน้า (index/services/etc.) */
.navbar, .navbar-expand-lg {
    position: absolute; /* ลอยทับเนื้อหา */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    
    /* พื้นหลังโปร่งใส (Glassmorphism) */
    background-color: rgba(255, 255, 255, 0.1) !important; 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    /* เส้นขอบและเงา */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none !important;
    
    padding-top: 15px;
    padding-bottom: 15px;
    transition: all 0.3s ease;
}

/* โลโก้ */
.navbar-brand {
    color: #000000; /* สีเทาเข้ม (เกือบดำ) */
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 102, 0, 0.5); /* เรืองแสงส้ม */
}
.navbar-brand img {
    max-height: 40px;
    margin-right: 8px;
    filter: drop-shadow(0 0 5px rgba(255, 102, 0, 0.4)); /* โลโก้เรืองแสง */
}

/* เมนูหลัก (ตัวหนังสือสีส้มเรืองแสง) */
.navbar-nav .nav-link {
    color: #000000; /* สีเทาเข้ม (เกือบดำ) */
    font-weight: 500;
    font-size: 0.9rem; /* ลดขนาดฟอนต์ลงเล็กน้อยเพื่อให้พอดีบรรทัดเดียว */
    padding-left: 10px !important;  /* ลดระยะห่างด้านซ้าย */
    padding-right: 10px !important; /* ลดระยะห่างด้านขวา */
    white-space: nowrap; /* บังคับไม่ให้ตัดคำขึ้นบรรทัดใหม่ */
    transition: color 0.3s ease;
    
    /* Effect เรืองแสงและขอบขาวจางๆ เพื่อให้อ่านง่ายบนทุกพื้นหลัง */
    text-shadow: 
        0 0 5px rgba(255, 255, 255, 0.8), /* ขอบขาว */
        0 0 10px rgba(255, 102, 0, 0.3);   /* เรืองแสงส้ม */
}

/* Hover Effect */
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #CC5200 !important; /* ส้มเข้มเมื่อชี้ */
    background-color: rgba(255, 255, 255, 0.8); /* พื้นหลังขาวจางๆ รองรับ */
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.2);
}

/* ปรับระยะห่างของ Container ใน Navbar เพื่อให้มีพื้นที่มากขึ้น */
.navbar .container {
    max-width: 85%; /* หรือกำหนด px ที่กว้างขึ้น เช่น 1300px */
    padding-left: 20px;
    padding-right: 20px;
}

/* ปุ่ม Login/Register บน Navbar */
.btn-login, .register-btn, .login-btn, .navbar .btn-danger {
    background-color: var(--primary-orange) !important;
    border-color: var(--primary-orange) !important;
    color: var(--white-text) !important;
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.4); /* ปุ่มเรืองแสง */
}
.btn-login:hover, .register-btn:hover {
    background-color: #CC5200 !important;
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.6);
}

/* Weglot Space */
#weglot-switcher-place { margin-left: 5px; margin-right: 5px; }

/* =========================================
   4. Header Background (สำหรับหน้าอื่นๆ ที่ไม่ใช่วิดีโอ)
   ========================================= */
/* เพิ่มพื้นหลังส่วนหัวให้หน้าใน เพื่อให้เมนูลอยดูสวยงาม */
.page-header-bg {
    background: linear-gradient(135deg, #FFF7F0 0%, #FFFFFF 100%); /* พื้นส้มอ่อนไล่ขาว */
    padding-top: 120px; /* เผื่อที่ให้ Navbar ลอยทับ */
    padding-bottom: 40px;
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

/* =========================================
   5. Video Hero Section
   ========================================= */
.hero-video-section {
    position: relative;
    width: 100%;
    height: 85vh; 
    overflow: hidden;
    display: flex;
    align-items: center; 
    justify-content: center; 
    color: var(--white-text); 
    text-align: center;
    background-color: var(--primary-orange); 
    perspective: 1000px;
}

#hero-background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -1; 
    transform: translate(-50%, -50%); 
    background-size: cover;
    filter: brightness(1.0); 
    transition: transform 0.8s ease-out;
}

.hero-video-section:hover #hero-background-video {
    transform: translate(-50%, -50%) scale(1.02);
}

.hero-content {
    position: relative;
    z-index: 1; 
    padding: 20px;
    max-width: 1200px;
    width: 100%;
}

.hero-content h1 {
    font-size: clamp(1.8rem, 5vw, 3.5em); 
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.5em; 
    line-height: 1.6;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.video-control-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.2); 
    backdrop-filter: blur(5px);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 15px 10px;
    cursor: pointer;
    font-size: 1.5em;
    border-radius: 8px;
    opacity: 0.6;
    transition: all 0.3s ease;
}
.video-control-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}
.video-prev-btn { left: 20px; }
.video-next-btn { right: 20px; }

@media (max-width: 768px) {
    .hero-video-section { height: 60vh; }
    .hero-content h1 { font-size: 2.5em; }
    .hero-content p { font-size: 1.2em; }
    .video-control-btn { padding: 10px 5px; font-size: 1.2em; }
    
    .navbar-collapse {
        background-color: rgba(255, 255, 255, 0.95); /* เมนูมือถือพื้นขาว */
        padding: 15px;
        border-radius: 10px;
        margin-top: 10px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
}

/* =========================================
   6. Modern Cards
   ========================================= */
.service-card, .process-card, .feature-card, .card {
    background-color: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(4px); 
    border: 1px solid rgba(255, 255, 255, 0.7); 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05), 0 10px 30px var(--shadow-color-light); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}
.service-card:hover, .process-card:hover, .feature-card:hover, .card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1), 0 18px 40px var(--shadow-color-strong);
}

.section-title {
    margin-bottom: 40px;
    font-weight: 600;
    color: var(--primary-orange);
}

.icon-box {
    font-size: 3rem;
    color: var(--primary-orange);
    text-shadow: 0 0 5px rgba(255, 102, 0, 0.2); 
}

/* =========================================
   7. Buttons (Gradient & Glow)
   ========================================= */
.btn { transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; }
.btn:hover { transform: scale(1.03); }

.btn-primary {
    background-color: var(--primary-orange);
    border-color: var(--primary-orange);
    padding: 10px 25px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    background: linear-gradient(135deg, var(--primary-orange), #ff9933); 
    border: none;
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.3); 
}
.btn-primary:hover {
    background-color: #CC5200;
    border-color: #CC5200;
    background: linear-gradient(135deg, #ff9933, #CC5200);
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.6);
}

.btn-outline-primary {
    color: var(--primary-orange);
    border-color: var(--primary-orange);
}
.btn-outline-primary:hover {
    color: #FFFFFF;
    background-color: var(--primary-orange);
    border-color: var(--primary-orange);
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* =========================================
   8. Rate Card & Calculator
   ========================================= */
.rate-card { transition: transform 0.3s ease; }
.rate-card:hover { transform: translateY(-10px); }

.rate-circle {
    width: 200px; height: 200px; border-radius: 50%; margin: 0 auto;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 10px 30px var(--shadow-color-light);
    border: 5px solid white; position: relative; overflow: hidden;
}
.rate-circle::before {
    content: ''; position: absolute; width: 100%; height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)); 
    transform: rotate(45deg);
}
.rate-circle-yuan { background: linear-gradient(135deg, #FF9933, #FF6600); }
.rate-circle-proxy { background: linear-gradient(135deg, #FFB366, #FF6600); }
.rate-value { color: white; font-size: 3.5rem; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.rate-value .currency { font-size: 1.5rem; vertical-align: super; margin-right: 5px; }

/* Calculator */
.calculator-section { padding: 80px 0; background-color: var(--light-orange-bg); }
.calculator-card {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    border-radius: 20px; padding: 2rem;
    box-shadow: 0 15px 40px var(--shadow-color-strong);
    display: flex; gap: 2rem; align-items: center;
}
.calculator-result-box {
    background-color: var(--light-orange-bg);
    border-radius: 15px; padding: 2rem;
    text-align: center; flex-shrink: 0; width: 35%;
}
.calculator-result-box img { height: 120px; margin-bottom: 1rem; }
.calculator-result-box .price-label { margin-bottom: 0.5rem; color: #6c757d; }
.calculator-result-box .price-value { font-size: 3.5rem; font-weight: 700; color: var(--primary-orange); line-height: 1; }
.calculator-result-box .price-currency { font-size: 1.5rem; font-weight: 500; }
.calculator-form { width: 65%; }
.calc-option-group { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.calc-option-group .btn-option {
    flex: 1; border: 1px solid var(--border-color);
    background-color: #ffffff; color: var(--dark-text);
    transition: all 0.2s ease-in-out;
}
.calc-option-group .btn-option.active {
    background-color: var(--primary-orange); color: #ffffff;
    border-color: var(--primary-orange);
    box-shadow: 0 4px 10px rgba(255, 102, 0, 0.2);
}

/* =========================================
   9. Footer
   ========================================= */
.footer {
    background-color: var(--primary-orange);
    color: #FFFFFF;
}
.footer h5 { color: #FFFFFF; }
.footer p, .footer a { color: rgba(255, 255, 255, 0.9); text-decoration: none; transition: color 0.3s ease; }
.footer a:hover { color: #FFFFFF; }
.footer hr { border-top: 1px solid rgba(255, 255, 255, 0.3); }

.service-img { height: 200px; object-fit: cover; }
.map-container { height: 450px; }
.bg-light-blue { background-color: var(--light-orange-bg); }
.fade-in-section { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in-section.is-visible { opacity: 1; transform: translateY(0); }

/* Timeline Wrapper */
.timeline-wrapper { max-height: 450px; overflow-y: auto; padding-right: 5px; }
.timeline-wrapper::-webkit-scrollbar { width: 5px; }
.timeline-wrapper::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.timeline { border-left: 2px solid #dee2e6; margin-left: 10px; padding-left: 25px; position: relative; }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before { content: ''; position: absolute; left: -32px; top: 5px; width: 14px; height: 14px; background: #fff; border: 3px solid #FF6600; border-radius: 50%; }

/* ดันเนื้อหาลงมาสำหรับหน้า Admin โดยเฉพาะ */
body.admin-page {
    padding-top: 120px !important; /* เว้นที่ให้ Navbar */
}