.CTC{
    margin-right: 50px;
}
    body {
    font-family: "Cloudsoft", sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}
        header{
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 30px 10%;
    text-decoration: none;
    background-color: #0056b3;
}
    li, a, button {
    font-family: "Cloudsoft", sans-serif;
    text-decoration: none;
    color: #f9f9f9;
    }
    header{
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding: 30px 10%;
        text-decoration: none;
        width: 100%; 
        margin: 0;
    }
.slogo{
    cursor: pointer;
    height: 90px;
    margin-left: 40px;
}
.nav_links{
    list-style: none;
}
.nav_links li {
    display: inline-block;
    padding: 0px 10px;
}

.nav_links li a{
    transition: all 0.3s ease 0s;
}
.nav_links li a :hover{
 color: #007bff;
}
button {
    padding: 9px 25px;
    background-color: #007bff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease 0s;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--card-background-color);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin: 20px auto 25px 5px;
    font-family: "Cloudsoft", sans-serif;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); 

}
button:hover{
    background-color: #0056b3;
}
.searcher{
    display:flex;

}
#search_button {
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--card-background-color);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin: 20px auto 25px 5px;
    font-family: "Cloudsoft", sans-serif;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); 
    transition: all 0.3s ease; 
}
#search_button:hover {
    /* ---- 2. HOVER STYLE (สไตล์เมื่อเมาส์ชี้) ---- */
    background-color: var(--primary-hover); /* เปลี่ยนสีให้เข้มขึ้นเล็กน้อย */
    
    /* ยกปุ่มขึ้นเล็กน้อย */
    transform: translateY(-2px); /* ปรับจาก -4px เป็น -2px เพื่อให้ดูนุ่มนวลขึ้น */
    
    /* เพิ่มความเข้มของเงา */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); /* ปรับค่าเงาให้สวยงาม */
}
#search_button:active {
    /* ---- 3. ACTIVE STYLE (สไตล์เมื่อกดปุ่ม) ---- */
    /* กดปุ่มให้กลับสู่ตำแหน่งเดิม (ดูเหมือนถูกกดลงไป) */
    transform: translateY(0); 
    
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); 
}
        #Oreo{
    display: flex;
    align-items: center;
    gap: 10px; 
    width: 100%;
    max-width: 500px;
    margin: 20px 5px 25px auto;
    padding: 15px 25px;
    background-color: var(--card-background-color);
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow-light);
    transition: box-shadow 0.3s ease;
}

        .hide-completely {
            display: none;
        }
        .item_box .img {
            border-radius: 5px;
            max-width: 150px;
            max-height: 150px;
            align-self: center;
        }
        @font-face {
            font-family: "Cloudsoft";
            src: url("Cloud Soft-Bold.otf");
            font-weight: normal;
            font-style: normal;
        }
        :root {
            --primary-color: #007bff;
            --primary-hover: #0056b3;
            --text-color: #333333;
            --light-text-color: #6c757d;
            --background-color: #f0f2f5;
            --card-background-color: #ffffff;
            --border-color: #e0e0e0;
            --box-shadow-light: 0 4px 12px rgba(0, 0, 0, 0.1);
            --box-shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.25);
            --card-border-radius: 12px;
            --status-found-color: #28a745;
            --status-lost-color: #dc3545;
        }

        body {
            font-family: "Cloudsoft", sans-serif;
            background-color: var(--background-color);
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding-bottom: 50px;
                overflow-x: hidden;
        }

        .header-section {
            width: 100%;
            padding: 20px 20px 60px;
            text-align: center;
            background-color: var(--card-background-color);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
            border-bottom: 2px solid var(--border-color);
            margin-bottom: 50px;
        }

        .header-section h2 {
            font-size: 80px;
            font-weight: bold;
            color: var(--text-color);
            text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.21);
            letter-spacing: 5px;
            background: linear-gradient(45deg, #ffffff, #21ff2cec);
            -webkit-text-fill-color: transparent;
        }

.item_box {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 25px;
  margin-bottom: 75px;
  background-color: var(--card-background-color);
  border-radius: var(--card-border-radius);
  box-shadow: var(--box-shadow-light);
  transition: transform 0.3s ease, box-shadow 0.5s ease;
  width: 90%;               /* ✅ เปลี่ยนจาก fix 600px เป็น responsive */
  max-width: 600px;         /* ✅ จำกัดขนาดสูงสุดแทน */
  margin: 20px auto;
}

.image-section {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
  border-radius: var(--card-border-radius);
  background-color: var(--background-color);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border: 5px solid var(--border-color);
}

.image-section img {
  width: 100%;              /* ✅ ให้ภาพย่อขนาดพอดีกล่อง */
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.header-section h2 {
    font-size: 80px;
    font-weight: bold;
    margin: 0;
    margin-top: 50px;
    letter-spacing: 5px;
    background: linear-gradient(45deg, #727272, #000000);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.header-section .subhead {
  font-size: 30px;
  color: var(--light-text-color);
  margin: 0 auto 10px auto;   /* ✅ จากเดิม margin-left: 200px */
  text-align: center;
  font-weight: normal;
  letter-spacing: 1px;
}
/* ✅ Tablet: 768px ถึง 1024px */
@media (max-width: 1024px) {
  .header-section h2 {
    font-size: 56px;
  }

  .slogo {
    height: 65px;
    margin-left: 0px;
  }

  #Oreo {
    padding: 12px 20px;
  }

  .item_box {
    width: 95%;
    gap: 25px;
    margin-bottom: 90px;
  }
}

/* ✅ มือถือแนวตั้ง: ≤768px */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: center;
    padding: 15px 5%;
  }

  .nav_links {
    display: none;
  }

  .CTC,
  .CTT {
    width: 100%;
    margin: 5px 0 !important;
    text-align: center;
  }

  .header-section h2 {
    font-size: 42px;
  }

  .searcher {
    flex-direction: column;
    width: 90%;
    margin: 0 auto;
  }

  #Oreo,
  #search_button {
    width: 100%;
    margin: 5px 0;
  }

  .item_box {
    flex-direction: column;   /* ✅ วางแนวตั้งแทนแนวนอน */
    align-items: center;
    width: 95%;
    gap: 15px;
    padding: 15px;
    margin: 20;
  }

  .image-section {
    width: 100%;
    height: auto;
    max-height: 200px;
  }

  .text-section {
    text-align: center;
  }
    .subhead {
    font-size: 22px;
    margin-left: 0;
  }
}

/* ✅ หน้าจอเล็กมาก: ≤425px */
@media (max-width: 425px) {
  .h2{
font-size: 32px;
  }

  .subhead {
    font-size: 18px;
    margin-left: 0;
  }

  .item_box {
    width: 100%;
    padding: 10px;
  }

  button {
    font-size: 16px;
    padding: 8px 16px;
  }
  .slogo{
    margin-left: 0px;
  }
}

        .item_box:hover {
            transform: translateY(-5px);
            box-shadow: var(--box-shadow-hover);
        }

        .image-section {
            flex-shrink: 0;
            width: 180px;
            height: 180px;
            border-radius: var(--card-border-radius);
            background-color: var(--background-color);
            display: flex;
            justify-content: center;
            align-items: center;
            overflow: hidden;
            border: 5px solid var(--border-color);
        }
.image-section img {
    transition: transform 0.3s ease;
}
.image-section:hover img {
    transform: scale(1.05);
}
        .item_box .img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            border-radius: var(--card-border-radius);
        }

        .text-section {
            display: flex;
            flex-direction: column;
            justify-content: center;
            flex-grow: 1;
        }

        .item_box .NAME {
            font-size: 30px;
            font-weight: bold;
            color: var(--text-color);
            margin-bottom: 10px;
            line-height: 1.2;
        }

        .item_box p {
            font-size: 18px;
            color: var(--light-text-color);
            margin: 5px 0;
            line-height: 1.5;
        }

        .item_box .F_DATE,
        .item_box .F_place {
            color: var(--light-text-color);
        }

        .item_box .found {
            font-weight: bold;
            margin-top: 15px;
            cursor: pointer;
            display: inline-block;
            padding: 8px 15px;
            border-radius: 50px;
            transition: all 0.3s ease;
            text-decoration: none;
            text-transform: uppercase;
            color: var(--status-found-color);
            border: 2px solid var(--status-found-color);
        }

        .item_box .found:hover {
            background-color: var(--status-found-color);
            color: var(--card-background-color);
            transform: scale(1.05);
        }

        .item_box .lost {
            font-weight: bold;
            margin-top: 15px;
            cursor: pointer;
            display: inline-block;
            padding: 8px 15px;
            border-radius: 50px;
            transition: all 0.3s ease;
            text-decoration: none;
            text-transform: uppercase;
            color: var(--status-lost-color);
            border: 2px solid var(--status-lost-color);
        }

        .item_box .lost:hover {
            background-color: var(--status-lost-color);
            color: var(--card-background-color);
            transform: scale(1.05);
        }
.item_box .found, 
.item_box .lost {
    transition: all 0.25s ease-in-out;
}

/* ✅ จอคอมพิวเตอร์: ยืดการ์ดให้กว้างขึ้น */
@media (min-width: 900px) {
  .item_box {
    max-width: 1150px;
    width: 92%;
    gap: 55px;
    padding: 30px 45px;
  }

  .image-section {
    width: 230px;
    height: 230px;
  }
}

/* ============================================================
   หน้าผู้ใช้เท่านั้น: เรียงการ์ดเป็นกริดหลายคอลัมน์
   (หน้าแอดมินไม่มี class user-view จึงไม่ได้รับผลกระทบ)
   ============================================================ */
.user-view #items_container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  width: 92%;
  max-width: 1700px;
  margin: 0 auto 60px;
}

.user-view .item_box {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 25px 28px;
  align-items: stretch;
}

.user-view .item_box .NAME {
  font-size: 26px;
  word-break: break-word;
}

.user-view .item_box p {
  font-size: 17px;
}

.user-view .item_box .found,
.user-view .item_box .lost {
  align-self: flex-start;
  font-size: 15px;
  padding: 7px 14px;
}

@media (min-width: 620px) {
  .user-view #items_container { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .user-view #items_container { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1200px) {
  .user-view #items_container { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1500px) {
  .user-view #items_container { grid-template-columns: repeat(5, 1fr); }
}