/* --- รีเซ็ตค่าเริ่มต้น --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', 'Sarabun', sans-serif;
    background-image: url('img/bg.jpg'); 
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
}

/* --- ส่วนหัว --- */
.transparent-header { padding: 40px 20px; color: white; }
.header-container { display: flex; justify-content: center; align-items: center; gap: 40px; }
.side-icon { width: 130px; height: auto; filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.4)); }
.title-group { text-align: center; }
.title-group h1 { font-size: 3.5rem; letter-spacing: 2px; font-weight: bold; text-transform: uppercase; }
.title-group p { font-size: 1.2rem; margin-top: 5px; opacity: 0.9; color: #00d4ff; font-weight: 600; }

/* --- กล่องสีขาวตรงกลาง --- */
.white-box {
    background-color: white;
    width: 90%;
    max-width: 1100px;
    margin: 0 auto 50px auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    min-height: 800px; 
    border-radius: 8px;
    overflow: hidden;
}

/* --- แถบเมนู --- */
.menu {
    display: flex;
    justify-content: center;
    gap: 35px;
    padding: 25px 0;
    border-bottom: 2px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 100;
}
.menu a {
    text-decoration: none;
    color: #444;
    font-weight: 600;
    font-size: 1.1rem;
    transition: 0.3s;
    text-transform: uppercase;
}
.menu a:hover, .menu a.active {
    color: #00d4ff; 
    border-bottom: 2px solid #00d4ff;
    padding-bottom: 5px;
}

/* --- ระบบเปลี่ยนหน้า --- */
.content { padding: 50px; color: #333; }
.page-section { display: none; animation: fadeIn 0.4s; }
.page-section.active { display: block; }
.page-section h2 { text-align: center; font-size: 2rem; margin-bottom: 30px; color: #222; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- เลย์เอาต์หน้า Reels --- */
.reels-grid.single-reel { display: flex; justify-content: center; }
.reels-grid.single-reel .reel-item { max-width: 850px; width: 100%; text-align: center; }
.reels-grid.single-reel .reel-item h2 { border-bottom: 2px solid #333; display: inline-block; margin-bottom: 10px; padding-bottom: 5px; }
.sub-text { font-size: 1rem; margin-bottom: 20px; color: #555; }
.video-placeholder { background: #111; height: 480px; color: white; display: flex; align-items: center; justify-content: center; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); }

/* --- เลย์เอาต์หน้า Portfolio (ตารางรูป) --- */
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 30px; }
.port-item { position: relative; background: #000; height: 250px; border-radius: 8px; overflow: hidden; cursor: pointer; transition: transform 0.3s, box-shadow 0.3s; display: block; }
.port-thumb { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: 0.3s; }
.port-item:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,0,0,0.2); }
.port-item:hover .port-thumb { opacity: 0.4; }

.play-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-size: 3rem; opacity: 0; transition: 0.3s; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.port-item:hover .play-overlay { opacity: 1; }

/* --- เลย์เอาต์หน้า About Me --- */
.about-container { display: flex; gap: 50px; align-items: center; margin-bottom: 40px; }
.profile-pic { width: 250px; height: 250px; border-radius: 50%; object-fit: cover; border: 4px solid #eee; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.about-text { flex: 1; text-align: left; font-size: 1.1rem; line-height: 1.8; color: #444; }
.about-text h2 { font-size: 2.5rem; margin-bottom: 15px; text-align: left; }

.action-buttons { display: flex; justify-content: center; gap: 20px; border-top: 1px solid #eee; padding-top: 40px; }
.btn-green { background-color: #27ae60; color: white; padding: 12px 35px; border-radius: 30px; text-decoration: none; font-weight: bold; font-size: 1.1rem; transition: background 0.3s, transform 0.2s; }
.btn-green:hover { background-color: #2ecc71; transform: scale(1.05); }

/* --- Modal (Lightbox) สำหรับเล่นวิดีโอ --- */
.modal {
    display: none; /* ซ่อนไว้เป็นค่าเริ่มต้น */
    position: fixed;
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* พื้นหลังสีดำโปร่งแสง */
    align-items: center;
    justify-content: center;
    animation: fadeInModal 0.3s ease;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1100px; /* ขนาดความกว้างสูงสุดของวิดีโอ */
    aspect-ratio: 16 / 9; /* รักษาอัตราส่วนวิดีโอให้เป็นแนวนอนเสมอ */
    background: #000;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.modal-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 2001;
}

.close-btn:hover {
    color: #00d4ff;
    transform: scale(1.1);
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- สำหรับจอมือถือ --- */
@media (max-width: 768px) {
    .header-container { flex-direction: column; gap: 20px; }
    .side-icon { height: 80px; }
    .title-group h1 { font-size: 2.2rem; }
    .menu { flex-wrap: wrap; gap: 15px; }
    .video-placeholder { height: 250px; }
    .about-container { flex-direction: column; text-align: center; }
    .about-text { text-align: center; }
    .about-text h2 { text-align: center; }
    .action-buttons { flex-wrap: wrap; }
    
    /* ปรับขนาด Modal บนมือถือ */
    .close-btn { top: 10px; right: 20px; font-size: 40px; }
    .modal-content { width: 95%; }
}