/* styles.css */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
}

header {
    background-color: #0d00ff;
    
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-size: 30px;
    font-weight: bold;

}

header .logo a{

    text-decoration: none;
    color: #fff;
}
header .search-bar input {
    padding-left: 20px;
    padding-right: 20px;
    width: 200px;
    padding: 5px;
    margin-right: 5px;
    border-radius: 3px;
    border: 1px solid #ccc;
    border-radius: 25px;
    background-color: #ddd;
    transition: background-color 0.3s ease; /* เพิ่ม transition ให้การเปลี่ยนแปลงพื้นหลังค่อยๆ เกิดขึ้น */
}
header .search-bar input:hover {

    background-color: #fff;
}


header .search-bar button {
    width: 70px;
    font-size: 18px;
    background-color: rgb(255, 255, 255);
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    color: #0d00ff;
    transition: background-color 0.3s ease;
}
.btn:hover{
    background-color: #fbebeb;
}
header .user button {
    padding: 6px 12px;
    margin-left: 10px;
    border: none;
    border-radius: 3px;
    background-color: white;
    cursor: pointer;
    
}

.main-content {
    display: flex;
    padding: 20px;
}

.sidebar {
    width: 250px;
    background-color: #fff;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
}

.sidebar ul li {
    padding: 10px 0;
    cursor: pointer;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-left: 20px;
    height: 540px;
}

iframe {
    width: 250px;
    height: 160px;
    border-radius: 20px;
    box-shadow: 5px 5px 5px #ccc;
    transition: transform 0.3s ease;
}

iframe:hover {
    transform: scale(1.05);
}

.video img {
    width: 100%;
    height: 40vh;
    border-radius: 5px;
}

.video h3 {
    font-size: 16px;
    margin: 10px 0 5px 0;
}

.video p {
    color: #555;
}

.sidebar a {
    text-decoration: none;
}

.sidebar a:hover {
    text-decoration: underline;
}

/* Media Queries for Mobile Devices */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column; /* ปรับการจัดวางให้อยู่ในแนวตั้ง */
    }

    .sidebar {
        width: 100%; /* ขยาย sidebar ให้เต็มหน้าจอ */
        margin-bottom: 20px; /* เพิ่มระยะห่างระหว่าง sidebar และ video-grid */
    }

    .video-grid {
        grid-template-columns: 1fr 1fr; /* เปลี่ยนจำนวนคอลัมน์ให้เป็น 2 */
        margin-left: 0; /* เอาค่ามาร์จิ้นออก */
    }

    iframe {
        width: 100%; /* ให้ iframe กว้างเต็ม 100% */
        height: 200px; /* เพิ่มความสูงให้ iframe ใหญ่ขึ้นบนมือถือ */
    }
}

/* Media Queries for Small Devices (e.g., mobile phones in portrait mode) */
@media (max-width: 480px) {
    header {
        flex-direction: column; /* ทำให้ header แสดงผลในแนวตั้ง */
        padding: 15px 10px; /* ปรับ padding ให้เหมาะสม */
    }

    header .logo {
        font-size: 20px; /* ลดขนาดฟอนต์ลง */
    }

    .video-grid {
        grid-template-columns: 1fr; /* เปลี่ยนให้แสดงผลเป็นคอลัมน์เดียว */
        margin-left: 0;
    }

    iframe {
        width: 100%; /* ทำให้ iframe กว้างเต็มหน้าจอ */
        height: 180px; /* ปรับความสูง iframe สำหรับหน้าจอเล็ก */
    }
}

/* สไตล์สำหรับ Sidebar */
.sidebar {
    width: 250px;
    background-color: #fff;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease; /* เพิ่ม transition ให้การซ่อน/แสดง */
}

/* สำหรับมือถือหรือหน้าจอที่เล็กกว่า 768px */
@media (max-width: 768px) {
    .sidebar {
        width: 100%; /* ทำให้ sidebar กว้างเต็มหน้าจอ */
        position: absolute;
        top: 0;
        left: -100%; /* เริ่มต้นให้ซ่อนไว้ */
        z-index: 1000;
        background-color: #f1f1f1;
    }

    .sidebar.show {
        left: 0; /* แสดง sidebar เมื่อมีการคลิก */
    }

    .sidebar ul {
        list-style-type: none;
        padding: 0;
    }

    .sidebar ul li {
        padding: 10px;
        text-align: center;
    }

    .sidebar a {
        text-decoration: none;
        display: block;
        padding: 10px;
        color: #333;
    }

    .sidebar a:hover {
        background-color: #ddd;
    }
}

/* ปุ่มสำหรับแสดงและซ่อน sidebar */
.sidebar-toggle {
    display: none; /* ซ่อนปุ่มนี้บนหน้าจอที่กว้าง */
}

/* สำหรับมือถือ ให้แสดงปุ่ม toggle */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
        background-color: #FF0000;
        color: white;
        padding: 10px;
        cursor: pointer;
        text-align: center;
    }
}
.pagination{
    color: blue;
    font-size: 20px;
    cursor: pointer;
    
}
.pagination a {
    text-decoration: none;
}

.pagination a:hover {
    text-decoration: underline;
    color: rgb(220, 22, 75);
    width: 100px;
    height: 100px;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 10px;
    padding-right: 10px;
   
    border-radius: 50%;
    background: aqua;
}

.pagination .active {
    /*background-color: #FF0000; /* สีสำหรับหน้าปัจจุบัน */
    background-image: linear-gradient(to top ,#ff0000 60%,#ffffff);
    color: white;
    font-weight: bold;
    width: 100px;
    height: 100px;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 10px;
    padding-right: 10px;
    box-shadow: 3px 3px 3px #3a3a3a;
    border-radius: 50%;
}