/* assets/css/style.css */
:root {
    --primary-color: #000;
    --secondary-color: #f4f4f4;
    --text-color: #333;
    --link-color: #1a73e8;
    --success-color: #198754;
    --danger-color: #dc3545;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: #fff; /* เปลี่ยนพื้นหลังหลักเป็นสีขาว */
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    display: flex; /* <-- เพิ่มเข้ามาสำหรับ Sticky Footer */
    flex-direction: column; /* <-- เพิ่มเข้ามาสำหรับ Sticky Footer */
    min-height: 100vh; /* <-- เพิ่มเข้ามาสำหรับ Sticky Footer */
    font-size: 19px;
    padding-top: 70px; /* NEW: เพิ่ม padding-top เพื่อหลีกเลี่ยง Header ที่ติดอยู่ด้านบน (ประมาณความสูงของ header) */
}

.main-container {
    padding: 2rem 5%;
    flex: 1; /* <-- เพิ่มเข้ามาสำหรับ Sticky Footer */
}

/* Navbar */
.navbar { /* This is a generic .navbar, not necessarily your .header */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: 400;
    font-size: 1rem;
    transition: color 0.3s ease;
}

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

.nav-links a.nav-admin {
    color: var(--danger-color);
    font-weight: 700;
}

/* Buttons (Legacy) */
.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff !important;
    padding: 0.6rem 1.5rem;
    border-radius: 5px;
    border: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #333;
}

/* Homepage */
.hero-section {
    text-align: center;
    padding: 4rem 1rem;
}

/* Admin Table */
.admin-table {
    width: 100%;
    margin-top: 2rem;
    border-collapse: collapse;
}
.admin-table th, .admin-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}
.admin-table th {
    background-color: #f2f2f2;
}


/* === สไตล์หน้า Login/Register === */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem;
    background-color: #fff; 
    min-height: 80vh;
}

.auth-box {
    width: 100%;
    max-width: 450px;
    background-color: #fff;
}
.auth-tabs { display: flex; border-bottom: 1px solid #e0e0e0; }
.auth-tab-link { flex: 1; padding: 1rem; text-align: center; background: none; border: none; border-bottom: 3px solid transparent; cursor: pointer; font-size: 1rem; font-family: 'Kanit', sans-serif; color: #888; transition: all 0.2s ease-in-out; }
.auth-tab-link.active { color: #000; border-bottom-color: #000; }
.auth-form-content { display: none; padding: 2rem 0; }
.auth-form-content.active { display: block; }
.auth-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.auth-subtitle { color: #666; margin-bottom: 1.5rem; }
.form-group-auth { margin-bottom: 1.5rem; }
.form-group-auth label { display: block; font-weight: 500; margin-bottom: 0.5rem; }
.form-group-auth input { width: 100%; padding: 0.8rem 1rem; border: 1px solid #ccc; border-radius: 8px; font-size: 1rem; font-family: 'Kanit', sans-serif; }
.btn-auth-submit { width: 100%; padding: 0.9rem; border: none; border-radius: 8px; background-color: #000; color: #fff; font-size: 1rem; font-weight: 500; cursor: pointer; font-family: 'Kanit', sans-serif; transition: background-color 0.2s; }
.btn-auth-submit:hover { background-color: #333; }
.social-auth-divider { display: flex; align-items: center; text-align: center; color: #aaa; margin: 1.5rem 0; }
.social-auth-divider::before, .social-auth-divider::after { content: ''; flex: 1; border-bottom: 1px solid #e0e0e0; }
.social-auth-divider:not(:empty)::before { margin-right: .5em; }
.social-auth-divider:not(:empty)::after { margin-left: .5em; }
.social-auth-buttons button { width: 100%; padding: 0.8rem; margin-top: 1rem; border-radius: 8px; font-size: 1rem; font-family: 'Kanit', sans-serif; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: all 0.2s; }
.social-auth-buttons button img { width: 20px; height: 20px; margin-right: 10px; }
.btn-social-google { background-color: #fff; color: #333; border: 1px solid #ccc; }
.btn-social-google:hover { background-color: #f5f5f5; }
.btn-social-discord { background-color: #000; color: #fff; border: 1px solid #000; }
.btn-social-discord:hover { background-color: #333; }


/* === สไตล์หน้า Profile === */
.profile-page-container {
    padding: 2rem 5%;
}

.profile-title-section h2 {
    font-size: 2rem;
    font-weight: 700;
}

.profile-title-section p {
    color: #6c757d;
}

.profile-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
}

.profile-card-body {
    padding: 2rem;
    text-align: center;
}

.profile-avatar {
    margin-bottom: 1.5rem;
}

.profile-info {
    margin-bottom: 1.5rem;
}

.profile-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.profile-handle, .profile-email {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.btn-edit-profile {
    background-color: #fff;
    border: 1px solid #ccc;
    color: #333;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-family: 'Kanit', sans-serif;
    transition: all 0.2s;
}

.btn-edit-profile:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.profile-card-footer {
    padding: 1rem 2rem;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.profile-card-footer a, .profile-card-footer .btn-link {
    color: #dc3545;
    text-decoration: none;
    font-size: 0.9rem;
}

.profile-card-footer a:hover, .profile-card-footer .btn-link:hover {
    text-decoration: underline;
}


/* === สไตล์สำหรับสไลด์รูปภาพ (Carousel) === */
#heroCarousel {
    height: 450px; 
    overflow: hidden;
    border-radius: 12px;
    background-color: #f0f0f0;
}

#heroCarousel .carousel-inner,
#heroCarousel .carousel-item {
    height: 100%; 
}

#heroCarousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 992px) {
    #heroCarousel {
        height: 400px; 
    }
}

@media (max-width: 768px) {
    #heroCarousel {
        height: 300px;
    }
}

@media (max-width: 576px) {
    #heroCarousel {
        height: 250px;
    }
}

/* === สไตล์ส่วน Footer === */
.site-footer {
    padding: 2.5rem 0;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    background-color: #ffffff;
}

.footer-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
}

.footer-copyright {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0;
}
.header {
    background-color: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed; /* NEW: ทำให้ Header ติดอยู่ด้านบนเมื่อเลื่อน */
    top: 0; /* NEW: ติดขอบบน */
    width: 100%; /* NEW: ขยายเต็มความกว้าง */
    z-index: 1020; /* NEW: ให้ Header อยู่เหนือองค์ประกอบอื่น */
    border-bottom: 2px solid #ccc;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    height: 40px;
}

.header .logo img {
    height: 40px;
}

.header .logo .logo-text {
    font-size: 1.8em;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    letter-spacing: 1px;
}

.header .desktop-menu {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: auto;
}

.header .desktop-menu a {
    text-decoration: none;
    color: #333;
    margin-left: 20px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.header .desktop-menu a:hover {
    color: #007bff;
}

.hamburger-menu {
    cursor: pointer;
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    position: relative;
    z-index: 1001;
    margin-left: auto;
}

.hamburger-menu .bar {
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}
.hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
}
.hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

.header .mobile-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    min-height: 200px;
    z-index: 999;
    border-top: 2px solid #ccc;
    border-bottom: 2px solid #ccc;
}

.header .mobile-menu.active {
    display: flex;
}

.header .mobile-menu a {
    margin: 5px 0;
    padding: 10px 20px;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid #eee;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.header .mobile-menu a:last-child {
    border-bottom: none;
}


@media (max-width: 768px) {
    .header {
        padding: 10px 20px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
    }

    .header .logo {
        text-align: left;
        margin-bottom: 0;
        margin-right: 0;
    }

    .header .logo img {
        height: 35px;
    }

    .header .desktop-menu {
        display: none;
    }

    .hamburger-menu {
        display: flex;
    }
}

/* VVVVVV  โค้ดสำหรับ Product Card Hover Effect VVVVVV */
.product-card {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
}