.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"),
                 url("Cloud%20Soft-Bold.otf");
            font-weight: normal;
            font-style: normal;
            font-display: swap;
        }
        :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%;
    max-width: none;   /* ✅ ยกเลิกการจำกัดความกว้าง ให้ยืดเต็มจอเหมือนปุ่มค้นหา */
    margin: 5px 0;
  }

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

  .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); }
}

/* ============================================================
   ✅ ช่องค้นหา: ให้ยืดหดพร้อมกับปุ่มค้นหาในทุกขนาดจอ
   (แก้ปัญหาเดิมที่ #Oreo ถูกล็อก max-width: 500px ไว้ ทำให้
    ยืดไม่เท่าปุ่ม และล้นขอบในจอขนาดกลาง)
   ============================================================ */
.searcher {
  width: 90%;
  max-width: 640px;
  margin: 0 auto;
  box-sizing: border-box;
  align-items: stretch;
}

.searcher #Oreo {
  flex: 1 1 auto;
  min-width: 0;          /* ให้ย่อได้จริงเมื่อจอแคบ */
  max-width: none;       /* ยกเลิกการล็อกความกว้างเดิม */
  box-sizing: border-box; /* ✅ ให้ padding นับรวมในความกว้าง จะได้ไม่ล้นขอบ */
  margin: 20px 0 25px;
}

.searcher #search_button {
  flex: 0 0 auto;
  box-sizing: border-box;
  margin: 20px 0 25px 10px;
}

/* จอมือถือ: วางช่องค้นหาและปุ่มเรียงลงมาแนวตั้ง เต็มความกว้างทั้งคู่ */
@media (max-width: 768px) {
  .searcher #Oreo,
  .searcher #search_button {
    width: 100%;
    margin: 5px 0;
  }
}

/* ============================================================
   ✅ ป้ายสถานะในจอมือถือ: จัดกึ่งกลางให้ตรงกับข้อความบรรทัดอื่น
   (ต้องเขียนไว้ท้ายไฟล์ เพราะกฎ align-self: flex-start ด้านบน
    อยู่หลังกว่ากฎเดิม จึงต้องประกาศทีหลังเพื่อให้มีผลจริง)
   ============================================================ */
@media (max-width: 768px) {
  .user-view .item_box .found,
  .user-view .item_box .lost {
    align-self: center;
  }
}


/* ============================================================
   ✅ แถบหัวเรื่องเต็มขอบจอ (ทุกขนาดจอ)
   - แถบสีน้ำเงิน: ชิดขอบบน ซ้าย ขวา
   - แถบสีขาว: ชิดแถบน้ำเงินด้านบน และชิดขอบซ้าย-ขวา
   หมายเหตุ: ต้องใช้ align-self: stretch เพราะ body ตั้ง
   display:flex + align-items:center ซึ่งจะบีบลูกให้แคบลง
   ============================================================ */
header {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  margin: 0;
  padding: 30px 2%;   /* ✅ โลโก้มี margin-left: 40px ของตัวเองอยู่แล้ว จึงไม่ต้องเยื้องซ้ำ */
  box-sizing: border-box;
  border-radius: 0;
}

.header-section {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  margin: 0 0 40px;
  box-sizing: border-box;
  border-radius: 0;
}

@media (max-width: 768px) {
  header { padding: 15px 5%; }

  .header-section {
    margin: 0 0 25px;
    padding: 20px 15px 30px;
  }
}

/* ============================================================
   ส่วนที่ใช้ร่วมกันระหว่างหน้าแอดมินและฟอร์ม "แจ้งของหาย" ของ user
   (FAB ปุ่ม +, popup, ช่องกรอกฟอร์ม, การอัปโหลด/ถ่ายรูป)
   ============================================================ */
        /* ---------- ปุ่ม + วงกลม มุมขวาบน ---------- */
        .fab {
            position: fixed;
            top: 25px;
            right: 30px;
            z-index: 900;
            width: 62px;
            height: 62px;
            border-radius: 50%;
            padding: 0;
            margin: 0;
            font-size: 34px;
            line-height: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: var(--card-background-color);
            color: var(--primary-color);
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
            transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
        }

        .fab:hover {
            background-color: var(--card-background-color);
            transform: scale(1.08) rotate(90deg);
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
        }

        .fab:active { transform: scale(0.96) rotate(90deg); }

        /* ---------- Pop-up ---------- */
        .overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.55);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.28s ease, visibility 0.28s ease;
        }

        .overlay.show { opacity: 1; visibility: visible; }

        .dialog {
            background-color: var(--card-background-color);
            border-radius: var(--card-border-radius);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
            width: 100%;
            max-width: 520px;
            max-height: 88vh;
            overflow-y: auto;
            padding: 30px 32px;
            transform: translateY(28px) scale(0.94);
            opacity: 0;
            transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.28s ease;
        }

        .overlay.show .dialog { transform: translateY(0) scale(1); opacity: 1; }

        .dialog h3 {
            font-family: "Cloudsoft", sans-serif;
            font-size: 28px;
            color: var(--text-color);
            margin: 0 0 20px;
            text-align: center;
        }

        .dialog label {
            display: block;
            font-size: 16px;
            color: var(--light-text-color);
            margin-bottom: 6px;
            font-family: "Cloudsoft", sans-serif;
        }

        .dialog input,
        .dialog select,
        .dialog textarea {
            width: 100%;
            box-sizing: border-box;
            padding: 12px 15px;
            margin-bottom: 16px;
            border: 2px solid var(--border-color);
            border-radius: 8px;
            font-size: 16px;
            font-family: "Cloudsoft", sans-serif;
            background-color: var(--card-background-color);
            color: var(--text-color);
            transition: border-color 0.25s ease;
        }

        .dialog input:focus,
        .dialog select:focus,
        .dialog textarea:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        .dialog textarea { resize: vertical; min-height: 90px; }

        .admin-only-note {
            font-size: 14px;
            color: var(--status-lost-color);
            margin: -10px 0 16px;
        }

        /* ---------- ส่วนรูปภาพ ---------- */
        .photo-actions { display: flex; gap: 10px; margin-bottom: 16px; }

        .photo-actions button {
            flex: 1;
            margin: 0;
            font-size: 16px;
            padding: 12px 10px;
        }

        .photo-preview-wrap {
            position: relative;
            display: none;
            margin-bottom: 16px;
        }

        .photo-preview-wrap.has-photo { display: block; }

        .photo-preview {
            width: 100%;
            max-height: 240px;
            object-fit: contain;
            border-radius: var(--card-border-radius);
            border: 2px solid var(--border-color);
            display: block;
            background-color: var(--background-color);
            margin-bottom: 0;
        }

        #remove_photo_btn {
            position: absolute;
            top: -10px;
            right: -10px;
            width: 32px;
            height: 32px;
            padding: 0;
            margin: 0;
            border-radius: 50%;
            background-color: var(--status-lost-color);
            color: #fff;
            font-size: 16px;
            font-weight: bold;
            line-height: 1;
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #remove_photo_btn:hover { background-color: #a71d2a; transform: scale(1.08); }

        .paste-hint {
            font-size: 13px;
            color: var(--light-text-color);
            text-align: center;
            margin: -8px 0 16px;
        }

        .photo-preview.paste-flash {
            animation: flashBorder 0.6s ease;
        }

        @keyframes flashBorder {
            0% { border-color: var(--status-found-color); box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.25); }
            100% { border-color: var(--border-color); box-shadow: none; }
        }

        #camera_panel { display: none; margin-bottom: 16px; }

        #camera_video {
            width: 100%;
            border-radius: var(--card-border-radius);
            background: #000;
            margin-bottom: 10px;
        }

        .dialog-buttons { display: flex; gap: 10px; }
        .dialog-buttons button { flex: 1; margin: 0; }

        .btn-grey { background-color: var(--light-text-color); }
        .btn-grey:hover { background-color: #55595d; }

        .error-msg {
            color: var(--status-lost-color);
            font-size: 16px;
            margin-bottom: 14px;
            display: none;
            text-align: center;
        }


/* ============================================================
   ฟอร์ม "แจ้งของหาย" เฉพาะหน้าผู้ใช้ (index.html)
   ============================================================ */
.report-fab {
    background-color: var(--primary-color);
    color: #fff;
}

.login-gate {
    text-align: center;
    padding: 10px 0 5px;
}

.login-gate p {
    font-size: 16px;
    color: var(--light-text-color);
    margin: 0 0 20px;
    line-height: 1.6;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background-color: #fff;
    color: #3c4043;
    border: 2px solid var(--border-color);
    font-family: "Cloudsoft", sans-serif;
    font-size: 16px;
    font-weight: bold;
    padding: 12px 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.google-signin-btn:hover {
    background-color: #f7f7f7;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.google-signin-btn img { width: 20px; height: 20px; }

.report-user-info {
    font-size: 14px;
    color: var(--light-text-color);
    text-align: center;
    margin: -5px 0 18px;
}

.report-success {
    text-align: center;
    padding: 20px 0;
}

.report-success .big-check {
    font-size: 56px;
    color: var(--status-found-color);
    margin-bottom: 10px;
}

.report-success p {
    font-size: 17px;
    color: var(--text-color);
    line-height: 1.7;
    margin: 0 0 24px;
}

@media (max-width: 768px) {
    .report-fab { bottom: 22px; right: 18px; width: 56px; height: 56px; font-size: 30px; }
}

/* ============================================================
   แถบแสดงสถานะล็อกอิน (สำหรับฟอร์มแจ้งของหาย) บนแถบสีน้ำเงิน
   ============================================================ */
.auth-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    margin-right: 90px; /* ✅ เว้นที่ให้ปุ่ม + ลอยอยู่มุมขวาบน ไม่ให้ทับกัน */
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 50px;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
}

.auth-status #report_auth_email {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-status button {
    background-color: #fff;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: bold;
    padding: 6px 14px;
    margin: 0;
    box-shadow: none;
}

.auth-status button:hover {
    background-color: #f0f0f0;
}

@media (max-width: 768px) {
    .auth-status {
        margin: 10px auto 0;
        justify-content: center;
    }
}

/* กล่องแสดงแทนรูป เมื่อรูปถูกล้างออกไปแล้ว (เช่น ทำความสะอาดคลังประจำปี) */
.image-section.no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-text-color);
    font-size: 15px;
    text-align: center;
    padding: 10px;
}