/*
 * creditbank.css
 * Custom CSS for Northern College Credit Bank Project
 *
 * This file contains styles for:
 * - Basic HTML elements (body, container)
 * - Header (site logo, title, contact info, buttons)
 * - Desktop Navigation Bar (main menu, dropdowns, social/language icons)
 * - Mobile Navigation (hamburger menu, off-canvas overlay)
 * - Responsive adjustments for various screen sizes
 */

/* --- General Body and Layout --- */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 20px auto;

    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.hero-section {
    background-color: #007bff7f;
    background-image: url(../images/topbodybg.jpg);
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 15px 10px;
    text-align: center;
    border-radius: 8px 8px 0 0;
    margin-bottom: 20px;
}

.hero-section h1 {
    margin: 0;
    font-size: 2.5em;
    text-shadow: rgba(0, 0, 0, 0.6) 0px 1.5px 11.25px;
}

.content-section {
    padding: 20px 0;
}

.content-section h2 {
    color: #070a10;
    text-align: center;
    margin-bottom: 20px;
}

.credit-bank-definition {
    background-color: rgba(255, 255, 255, 0.8);
    /* Slight opacity as in design */
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.credit-bank-definition p {
    color: #070a10;
    font-size: 1.1em;
    line-height: 1.8;
}

.credit-bank-definition img {
    max-width: 70%;
    /* สำคัญที่สุด: ทำให้รูปภาพไม่เกินความกว้างของ parent */
    height: auto;
    /* รักษาอัตราส่วนของรูปภาพ */
    display: block;
    /* ลบช่องว่างด้านล่างรูปภาพที่เกิดจาก inline-block */
    margin: 0 auto;
    border-radius: 8px;
    /* ถ้าต้องการให้มีมุมมนๆ */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* เพิ่มเงาเล็กน้อยเพื่อความสวยงาม */
}

.body-section {
    background-image: linear-gradient(rgba(34, 105, 167, 0.471), rgba(53, 146, 228, 0.7)),
        /* Overlay Color (โปร่งใส 70%) */
        url(../images/cbody1.jpg);
    background-size: cover;
    background-position: center;
    padding: 20px 0;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    margin-top: 10px;

}

.body-section a {
    text-decoration: none;
    color: #545454;
    font-weight: bold;
    text-decoration: none;
    font-size: 0.95em;
}

.ministerial-regulations {
    display: grid;
    padding: 20px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.regulation-item {
    background-color: rgba(255, 255, 255, 0.8);
    /* Slight opacity as in design */
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.regulation-item a {
    color: #545454;
    font-weight: bold;
    text-decoration: none;
    font-size: 0.95em;
}

.regulation-item a:hover {
    text-decoration: underline;
}

.icon {
    width: 40px;
    height: 30px;
    /* You might use an SVG icon here, or a small image.
           For now, a simple placeholder. */

    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: #87b6e0;
}

.icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Ensure no scroll on body when mobile menu is active - handled by JS */
body.no-scroll {
    overflow: hidden;
}

/* --- Header Styling --- */
.container-header {
    max-width: 1000px;
    margin: 0 auto;
}

.site-header {
    background: #FFFFFF;
    /* สีขาวทึบ */
    display: flex;
    justify-content: space-between;
    /* กระจายองค์ประกอบ */
    align-items: center;

    padding: 20px 30px;
    /* เพิ่ม padding */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    /* ให้องค์ประกอบห่อบรรทัดเมื่อหน้าจอเล็กลง */
    position: relative;
    z-index: 900;
}

.header-left {
    display: flex;
    align-items: center;
}

.site-logo {
    margin-right: 20px;
    /* ระยะห่างระหว่างโลโก้กับข้อความ */
}

.site-logo img {
    width: 100px;
    /* ขนาดโลโก้ตามภาพ */
    height: 100px;
    /* ขนาดโลโก้ตามภาพ */
    object-fit: contain;
    /* ให้ภาพปรับขนาดไม่เสียสัดส่วน */
}

.site-title {
    line-height: 1.2;
}

.site-title h2 {
    margin: 0;
    font-size: 1.7em;
    /* ขนาดชื่อมหาวิทยาลัยไทย */
    color: #0d47a1;
    /* สีน้ำเงินเข้มตามโลโก้ */
    white-space: nowrap;
    /* ป้องกันไม่ให้ชื่อห่อบรรทัด */
}

.site-title h3 {
    margin: 0;
    font-size: 1.2em;
    /* ขนาดชื่อมหาวิทยาลัยอังกฤษ */
    color: #616161;
    /* สีเทาเข้มขึ้น */
    font-weight: normal;
    white-space: nowrap;
}

.header-center {
    /* จัดกลุ่มเบอร์โทรและปุ่ม */
    display: flex;
    align-items: center;
    gap: 30px;
    /* ระยะห่างระหว่างเบอร์โทรกับปุ่ม */
}

.header-right {
    /* จัดกลุ่มเบอร์โทรและปุ่ม */
    display: flex;
    align-items: center;
    gap: 30px;
    /* ระยะห่างระหว่างเบอร์โทรกับปุ่ม */
}

/* New: Container for phone icon + numbers */
.header-contact-group {
    display: flex;
    /* ใช้ Flexbox เพื่อจัดเรียงไอคอนและเบอร์โทร */
    align-items: center;
    /* จัดให้ไอคอนและข้อความอยู่กึ่งกลางแนวตั้ง */
    gap: 15px;
    /* ระยะห่างระหว่างไอคอนกับกลุ่มเบอร์โทร */
}

.header-contact-info {
    /* นี่คือ div ที่เก็บเฉพาะเบอร์โทรศัพท์ */
    text-align: left;
    /* จัดชิดซ้ายภายในกลุ่มเบอร์โทร */
}

.header-contact-info p {
    margin: 0;
    /* ลบ margin ระหว่างบรรทัด */
    font-size: 1.1em;
    /* ขนาดตัวเลขเบอร์โทร */
    color: #0d47a1;
    /* สีน้ำเงินเข้ม */
    line-height: 1.3;
}

.phone-icon {
    font-size: 1.8em;
    /* ขนาดไอคอนโทรศัพท์ */
    color: #0d47a1;
    /* สีน้ำเงินเข้ม */
}

.header-buttons {
    display: flex;
    gap: 15px;
    /* ระยะห่างระหว่างปุ่ม */
}

.header-buttons .btn {
    display: inline-block;
    padding: 12px 25px;
    /* เพิ่มขนาด padding ปุ่ม */
    text-decoration: none;
    border-radius: 30px;
    /* ขอบมน */
    font-size: 1.1em;
    /* ขนาดตัวอักษรในปุ่ม */
    font-weight: bold;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    white-space: nowrap;
    /* Prevent buttons text from wrapping */
}

.header-buttons .btn.btn-apply {
    background-color: #ffde59;
    /* สีเหลืองทอง */
    color: #333;
    border: 1px solid #ffde59;
    /* ขอบสีเหลืองเดียวกับพื้นหลัง */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /* เพิ่มเงาเล็กน้อย */
}

.header-buttons .btn.btn-apply:hover {
    background-color: #ffc107;
    /* สีเข้มขึ้นเมื่อ hover */
    border-color: #ffc107;
}

.header-buttons .btn.btn-download {
    background-color: #FFFFFF;
    /* พื้นหลังสีขาว */
    color: #d63384;
    /* ตัวอักษรสีชมพู */
    border: 2px solid #d63384;
    /* ขอบสีชมพูหนา 2px */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /* เพิ่มเงาเล็กน้อย */
}

.header-buttons .btn.btn-download:hover {
    background-color: #d63384;
    /* พื้นหลังชมพูเมื่อ hover */
    color: white;
    /* ตัวอักษรขาวเมื่อ hover */
}


/* --- Desktop Navigation Bar Styling --- */
.main-nav {
    background-color: #f7f7f7;
    /* Background color for the navbar */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    min-height: 50px;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    /* Make it sticky */
    top: 0px;
    /* Stick to the top */
    z-index: 1000;
    /* Ensure it's on top of other content */
    border-bottom: 1px solid #e0e0e0;
    border-top: 5px solid #d63384;
    /* ขอบด้านบนสีชมพู */
}

.main-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    /* Flexbox for horizontal menu items */
    justify-content: center;
}

.main-menu ul li {
    position: relative;
    /* For dropdown positioning */
}

.main-menu ul li a {
    display: block;
    padding: 3px 3px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    font-size: 0.86em;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap;
    /* Prevent menu items from wrapping */
}

.main-menu ul li a i {
    margin-right: 8px;
    /* Space for icons */
}

.main-menu ul li a:hover,
.main-menu ul li.current-menu-item>a {
    /* Highlight for current page */
    background-color: #e9e9e9;
    color: #007bff;
}

/* Dropdown menu styling */
.main-menu ul li ul {
    display: none;
    /* Hidden by default */
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    min-width: 220px;
    z-index: 1001;
    border-top: 3px solid #007bff;
    padding: 5px 0;
}

.main-menu ul li ul li {
    width: 100%;
    /* Full width for dropdown items */
}

.main-menu ul li ul li a {
    padding: 12px 20px;
    font-weight: normal;
    font-size: 0.9em;
    color: #555;
}

.main-menu ul li ul li a:hover {
    background-color: #f2f2f2;
    color: #007bff;
}

/* Show dropdown on hover */
.main-menu ul li:hover>ul {
    display: block;
}

/* Third-level dropdowns (e.g., "สำหรับนักศึกษา" under "ระบบสารสนเทศ") */
.main-menu ul li ul li ul {
    left: 100%;
    /* Position to the right of parent */
    top: 0;
}

.main-menu ul li ul li:hover>ul {
    display: block;
}

/* Social Icons and Language Flags (Desktop) */
.social-language-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Space between icons */
}

.social-language-icons .icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    /* Circular background for social icons */
    background-color: #e9e9e9;
    color: #555;
    text-decoration: none;
    font-size: 1.1em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.social-language-icons .icon-link:hover {
    background-color: #007bff;
    color: white;
}

.social-language-icons .icon-link img.flag-icon {
    width: 24px;
    /* Adjust flag size */
    height: 24px;
    border-radius: 3px;
    /* Slightly rounded corners for flags */
}


/* --- Mobile Navigation Styles --- */

/* Hide desktop nav on mobile/tablet, show mobile nav */
@media (max-width: 1024px) {
    .main-nav {
        /* This is your desktop nav */
        display: none;
    }

    .mobile-nav-container {
        /* Show mobile nav container */
        display: flex;
    }
}

/* Hide mobile nav on desktop */
@media (min-width: 1025px) {
    .mobile-nav-container {
        display: none;
    }

    .ministerial-regulations {
        grid-template-columns: repeat(4, 1fr);
    }
}

.mobile-nav-container {
    background-color: #f7f7f7;
    /* Same as desktop nav background */
    padding: 10px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 999;
    /* Below desktop nav if it somehow shows */

    justify-content: space-between;
    align-items: center;

}

.mobile-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.mobile-logo-link .mobile-logo {
    height: 60px;
    /* Adjust mobile logo size */
    width: auto;
    object-fit: contain;
}

.hamburger-menu {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* Space between hamburger lines */
}

.hamburger-icon {
    display: block;
    width: 28px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Off-canvas Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    /* Dark overlay */
    z-index: 2000;
    /* Ensure it's on top of everything */
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    /* Start off-screen to the right */
    transition: transform 0.3s ease-out;
}

.mobile-menu-overlay.is-active {
    transform: translateX(0);
    /* Slide in */
}

.mobile-menu-header {
    padding: 15px 20px;
    text-align: right;
}

.close-menu {
    background: none;
    border: none;
    color: white;
    font-size: 2.5em;
    cursor: pointer;
    padding: 0 10px;
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    /* Allow menu list to take available space */
    overflow-y: auto;
    /* Enable scrolling for long menus */
}

.mobile-menu-list li a {
    display: block;
    padding: 15px 25px;
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.mobile-menu-list li a i {
    margin-right: 15px;
    width: 20px;
    /* Align icons */
    text-align: center;
}

.mobile-menu-list li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-social-icons {
    display: flex;
    justify-content: center;
    padding: 20px;
    gap: 20px;
}

.mobile-social-icons .icon-link {
    width: 45px;
    height: 45px;
    font-size: 1.5em;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.mobile-social-icons .icon-link:hover {
    background-color: #007bff;
    /* Use main blue for hover */
}


/* --- Responsive Adjustments --- */
/* For screens smaller than 1200px (e.g., larger tablets, small desktops) */
@media (max-width: 1200px) {
    .site-header {
        padding: 15px 20px;
        gap: 20px;
    }

    .site-logo img {
        width: 80px;
        height: 80px;
    }

    .site-title h2 {
        font-size: 1.5em;
    }

    .site-title h3 {
        font-size: 1em;
    }

    .header-center-right {
        gap: 20px;
    }

    .header-buttons .btn {
        padding: 10px 20px;
        font-size: 1em;
    }
}

/* For Tablet screens (and below) */
@media (max-width: 1024px) {

    /* Header adjustments for tablet */
    .site-header {
        flex-direction: column;
        /* จัดองค์ประกอบแนวตั้งบน Tablet */
        align-items: center;
        padding: 15px 15px;
        gap: 15px;
    }

    .header-left {
        flex-direction: column;
        text-align: center;
        margin-bottom: 10px;
    }

    .site-logo {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .site-title h2 {
        font-size: 1.4em;
    }

    .site-title h3 {
        font-size: 0.9em;
    }

    .header-center-right {
        flex-direction: column;
        /* เบอร์โทรและปุ่มแยกบรรทัดกัน */
        gap: 15px;
    }

    .header-contact-group {
        flex-direction: row;
        /* กลับเป็น row สำหรับ icon กับ text */
        justify-content: center;
        /* จัดกึ่งกลางบน tablet/mobile */
        width: 100%;
        /* ให้เต็มความกว้าง */
    }

    .header-contact-info {
        text-align: center;
        /* จัดกลางข้อความบน tablet/mobile */
    }

    .header-buttons {
        flex-direction: row;
        /* ปุ่มยังอยู่แถวเดียวกัน */
        justify-content: center;
        width: 100%;
        /* ให้ปุ่มกระจายเต็มความกว้าง (ถ้าจำเป็น) */
    }

    .header-buttons .btn {
        flex: 1;
        /* ให้ปุ่มมีขนาดเท่ากัน */
        text-align: center;
    }
}

/* For Mobile screens (and below) */
@media (max-width: 767px) {
    .site-header {
        padding: 10px 10px;
    }

    .site-logo img {
        width: 80px;
        /* ปรับขนาดโลโก้สำหรับมือถือ */
        height: 80px;
    }

    .site-title h2 {
        font-size: 1.2em;
    }

    .site-title h3 {
        font-size: 0.8em;
    }

    .header-center {
        display: none;
        ;
    }

    .header-buttons {
        display: none;
    }
}

/* Custom PDF Download Button */
/* Custom PDF Download Button - Flexbox Style */
.manual-download-container {
    display: flex;
    /* จัดเรียงแบบ Flex */
    justify-content: center;
    /* จัดกึ่งกลางแนวนอน */
    align-items: center;
    /* จัดกึ่งกลางแนวตั้ง */
    flex-wrap: wrap;
    /* ถ้าที่รไม่พอ ให้ปัดลงบรรทัดใหม่ */
    gap: 15px;
    /* ระยะห่างระหว่างปุ่ม (สำคัญมาก) */
    margin-bottom: 30px;
    padding: 0 15px;
}

.btn-manual-download {
    /* display: inline-block;  <-- ลบอันนี้ออก หรือทิ้งไว้ก็ได้ไม่มีผลเมื่ออยู่ใน flex item */
    background-color: #1e3165ff;
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);

    /* เพิ่มเติมเพื่อให้ข้อความดูดีขึ้น */
    text-align: center;
    white-space: nowrap;
    /* บังคับไม่ให้ตัดคำ (ถ้าต้องการ) */
}

/* Responsive: ถ้าหน้าจอเล็ก ให้ปุ่มเต็มความกว้าง */
@media (max-width: 768px) {
    .btn-manual-download {
        width: 100%;
        /* ปุ่มเต็มจอในมือถือ */
        white-space: normal;
        /* ยอมให้ตัดคำได้ในมือถือ */
    }
}

/* Registration Page Styles */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.tab-link {
    background-color: #f1f1f1;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 20px;
    transition: 0.3s;
    font-size: 1.1em;
    flex-grow: 1;
    max-width: 250px;
    border-radius: 5px 5px 0 0;
    margin: 0 5px;
    color: #555;
    font-weight: bold;
}

.tab-link:hover {
    background-color: #ddd;
}

.tab-link.active {
    background-color: #0d47a1;
    color: white;
}

.tab-content {
    animation: fadeEffect 0.5s;
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

@keyframes fadeEffect {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.form-title {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.registration-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #444;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #0d47a1;
    outline: none;
    box-shadow: 0 0 5px rgba(13, 71, 161, 0.2);
}

.radio-group label {
    display: block;
    font-weight: normal;
    margin-bottom: 10px;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.btn-submit {
    background-color: #28a745;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    width: 100%;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.btn-submit:hover {
    background-color: #218838;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}



.btn-manual-download i {
    margin-right: 8px;
    font-size: 1.1em;
}