/* ===================================================
   STYLE.CSS (REFACTORED & UPGRADED)
   Theme: Atsoftmaker (Luxury Black/Gold)
   =================================================== */

/* --- 1. การตั้งค่าพื้นฐานและสีหลัก (Root & Fonts) --- */
:root {
    --primary-color: #FFD700;    /* เหลืองทอง (Gold) */
    --secondary-color: #1a1a1a;  /* ดำ (นุ่มกว่าเดิม) */
    --text-color: #333;          /* สีข้อความหลัก */
    --text-light: #555;          /* สีข้อความรอง */
    --light-bg-color: #f5f5f7;   /* สีเทาอ่อน (สไตล์ Apple) */
    --white-color: #FFFFFF;      /* สีขาว */
    --border-color: #e5e5e5;     /* สีเส้นขอบ */
    --global-radius: 0.75rem;    /* 12px */
    --global-transition: all 0.3s ease-in-out;
}

/* --- Background ทั้งเว็บไซต์ --- */
html, body {
    height: 100%;
    font-family: 'Kanit', sans-serif;
    color: var(--text-color);
    background-image: url("image/hero.png");  /* << ใส่ BG ของทั้งเว็บไซต์ */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.40); /* 40% มืด */
    z-index: -1;
}

#about,
#portfolio {
    scroll-margin-top: 80px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--secondary-color);
    font-weight: 700;
}

section {
    padding-top: 5rem;
    padding-bottom: 5rem;
}


/* --- 2. Navbar --- */
.navbar {
    background-color: var(--secondary-color) !important;
    padding-top: 1rem;
    padding-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    color: var(--white-color) !important;
    font-weight: 400;
    transition: var(--global-transition);
    margin-left: 0.5rem;
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}


/* --- 3. Hero Section --- */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 90vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    display: flex;
    align-items: center;
    justify-content: center;

    padding-top: 6rem;
    padding-bottom: 6rem;

    color: white;
    overflow: hidden;
}

/* Overlay (กรองสีดำโปร่งแสง) */
.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.40); /* 40% มืด */
    z-index: 1;
}

/* Content อยู่บน Overlay */
.hero-content {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-weight: 700;
    color: var(--primary-color);
}

.hero-section p.lead {
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
}


/* --- 4. Section Title --- */
.section-title {
    color: var(--secondary-color);
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 70px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}




/* --- 5. Service Cards --- */
.service-card {
    border: 1px solid rgba(255, 255, 255, 0.18); /* เส้นโปร่งแสง */
    background: rgba(255, 255, 255, 0.08);       /* โปร่งใส 8% */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: var(--global-transition);
    border-radius: var(--global-radius);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.4);
}

.service-card .card-body {
    padding: 2rem;
}

.service-card .card-title {
    color: var(--secondary-color);
    font-weight: 600;
}

/* Glass effect สำหรับการ์ดใน Hero */
.hero-section .service-card {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hero-section .service-card .card-text {
    color: rgba(255, 255, 255, 0.85);
}

.hero-section .service-card .card-title {
    color: var(--primary-color);
}

.hero-section .service-card:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-8px);
}


/* --- 6. About Section (Hybrid Solution - Fixed) --- */

#about {
    /* (วิธีไฮบริด)
       1. ใช้ background-gradient 3 อันสำหรับวงกลม "กลางๆ"
    */
    background:
        /* 1. (อันใหม่ 1) กลางๆ ค่อนไปทางซ้าย */
        radial-gradient(200px circle at 20% 30%, rgba(255, 215, 0, 0.4), transparent 80%),
        
        /* 2. (อันใหม่ 2) กลางๆ ค่อนไปทางขวา */
        radial-gradient(350px circle at 80% 60%, rgba(255, 215, 0, 0.9), transparent 80%),
        
        /* 3. (อันใหม่ 3) กลางๆ ค่อนไปทางล่าง */
        radial-gradient(150px circle at 45% 75%, rgba(255, 215, 0, 0.4), transparent 80%),
    
        /* 4. (สำคัญ) สีพื้นหลังหลัก */
        var(--light-bg-color); /* #f5f5f7 */
    
    background-repeat: no-repeat; 
    position: relative; 
    overflow: hidden;   
}

/* 2. (เอาอันเดิมกลับมา) ใช้วงกลมหลัก (บนขวา) 
      เพราะวิธีนี้ทำงานได้ผลสำหรับคุณ */
#about::before {
    content: '';
    position: absolute;
    top: -300px;
    right: -300px;
    width: 800px;
    height: 800px;
    background-color: rgba(255, 215, 0, 0.1); /* 10% */
    border-radius: 50%;
    z-index: 0;
}

/* 3. (เอาอันเดิมกลับมา) ใช้วงกลมรอง (ล่างซ้าย) */
#about::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -100px;
    width: 300px;
    height: 300px;
    background-color: rgba(255, 215, 0, 0.2); /* 5% */
    border-radius: 50%;
    z-index: 0;
}

/* (เหมือนเดิม) ทำให้เนื้อหาลอยอยู่ด้านบน */
#about .container {
    position: relative;
    z-index: 1; 
}

/* (เหมือนเดิม) ทำให้การ์ดโปร่งใส */
.about-card {
    background-color: transparent;
    box-shadow: none;
}

/* (เหมือนเดิม) สไตล์โลโก้ (ลบตัวซ้ำแล้ว) */
.about-logo {
    max-width: 75%;
    border-radius: 1rem;
    /* box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 0 20px rgba(255, 215, 0, 0.25); */
    transition: all 0.3s ease;
}

.about-logo:hover {
    transform: translateY(-6px) scale(1.04);
    /* box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.25),
        0 0 35px rgba(255, 215, 0, 0.4); */
}

/* (คงไว้) สไตล์อื่นๆ ที่เกี่ยวกับ #about */
#about .img-fluid.rounded.shadow {
    border: 4px solid var(--primary-color);
    border-radius: 1.5rem;
    box-shadow: 0 0 20px 5px rgba(255, 215, 0, 0.4),
                0 0 30px 10px rgba(255, 215, 0, 0.15);
    transition: var(--global-transition);
}

#about .img-fluid.rounded.shadow:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 10px 30px 10px rgba(255, 215, 0, 0.6),
                0 0 50px 20px rgba(255, 215, 0, 0.3);
}

#about .section-title::after {
    left: 0;
    transform: none;
}

/* (คงไว้) Animation นุ่มๆ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}


/* --- 7. Portfolio --- */
#portfolio {
    background: transparent !important; 
}

#portfolio .article-row {
    padding: 2.5rem;
    border-radius: var(--global-radius) 20px;;
    transition: var(--global-transition);
    margin-bottom: 2rem !important;
}

#portfolio .article-row h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

#portfolio .img-fluid {
    border-radius: var(--global-radius);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: var(--global-transition);
    max-width: 85%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#portfolio .article-row:hover .img-fluid {
    transform: scale(1.03);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.service-card h3,
.service-card p {
    color: #fff;   /* ขาว */
}

.service-card .text-muted {
    color: rgba(255,255,255,0.6) !important;
}


/* --- 8. Buttons --- */
.btn-outline-light {
    border-width: 2px;
    font-weight: 600;
    margin-top: 1rem;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    transition: var(--global-transition);
}

.btn-outline-light:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}


/* --- 9. Footer --- */
footer {
    background-color: var(--secondary-color);
    color: rgba(255, 255, 255, 0.7);
    padding: 3rem 0;
}


/* --- 10. Modal Styles --- */
.modal-body img {
    max-width: 70%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
    border-radius: var(--global-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .modal-body img {
        max-width: 95%;
    }
}

.img-carousel-modal {
    border-radius: var(--global-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.carousel-control-prev-icon {
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    padding: 1.25rem;
}

.carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    padding: 1.25rem;
}

.carousel-control-prev,
.carousel-control-next {
    width: 8%;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}
