* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --accent: #4895ef;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --success: #4cc9f0;
    --border: #e0e0e0;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: var(--dark);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

/* Overlay ครอบทั้งหน้า */
    #spinnerOverlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.95); /* สีดำโปร่ง */
      display: none; /* ซ่อนตอนไม่โหลด */
      justify-content: center;
      align-items: center;
      flex-direction: column; /* ให้ข้อความอยู่ใต้ spinner */
      z-index: 9999;
      color: #fff;
      font-size: 18px;
      font-weight: bold;
    }

    /* Spinner */
    .spinner {
      border: 8px solid #f3f3f3;
      border-top: 8px solid #3498db;
      border-radius: 50%;
      width: 60px;
      height: 60px;
      animation: spin 1s linear infinite;
      margin-bottom: 15px;
    }

    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

.container {
    max-width: 800px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: 24px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    padding: 40px;
    text-align: center;
}

.card-header h1 {
    margin-top: 0px;
}

.profile-section {
    text-align: center;
    padding: 30px 20px 20px;
    border-bottom: 1px solid var(--border);
}

.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin: -70px auto 10px;
    background: linear-gradient(45deg, var(--accent), var(--success));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}
.profile-pic img {
    width: 100px;          /* กำหนดขนาดของรูป */
    height: 100px;         /* กำหนดขนาดของรูป */
    border-radius: 50%;    /* ทำให้รูปเป็นวงกลม */
    object-fit: cover;     /* ให้รูปเต็มพื้นที่โดยไม่เสียสัดส่วน */
    border: 3px solid white; /* เพิ่มขอบสีขาวรอบๆ ภาพ */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); /* เพิ่มเงาเบาๆ เพื่อให้ดูน่าสนใจ */
}



.profile-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--dark);
}

.profile-line {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 5px;
}

.profile-nickname {
    background: var(--light);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    color: var(--gray);
    font-size: 0.95rem;
}

.member-details {
    padding: 2px 25px 2px 25px;
}

.member-details h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.member-details h2 i {
    margin-right: 10px;
}

.detail-item {
    display: flex;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--border);
}

.detail-label {
    font-weight: 600;
    width: 30%;
    color: var(--gray);
    text-align: end;
    padding-right: 5px;
}

.detail-value {
    width: 70%;
    color: var(--dark);
}

.form-section {
    padding: 2px 25px 30px 25px;
}

.section-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    margin-top: 20px;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 10px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 5px;
    margin-bottom: 25px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    background: #eee;
    padding: 1px 1px;
    border-radius: 5px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 12px;
}

.checkbox-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.checkbox-item input {
    margin-right: 10px;
    margin-left: 10px;
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

.form-group label {
    font-weight: 600;
    font-size: 1.3em;
    margin-bottom: 8px;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.form-group label i {
    font-size: 1.3em;
    margin-right: 8px;
    color: var(--accent);
}

.form-group input {
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.upload-area {
    border: 1px solid var(--primary);
    border-radius: 10px;
    padding: 5px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--accent);
    background: rgba(72, 149, 239, 0.05);
}

.upload-icon {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 5px;
}

.upload-text {
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--dark);
}

.upload-hint {
    color: var(--gray);
    font-size: 13px;
    margin-left: 15px;
    align-content: center;
}

.save-btn {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 18px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.save-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}
.line-img{
    border-bottom: 2px dashed var(--gray);
    margin-bottom: 10px;
    padding: 1px;
}

.save-btn:active {
    transform: translateY(-1px);
}
.serial-input{
    width: 100%; 
    height: 50px; 
    border: 1px solid var(--primary); 
    font-size: 12px; 
    padding-left: 10px; 
    border-radius: 10px;
}
.scan-btn1{
    font-size: 14px; 
    align-items: center; 
    justify-content: center; 
    padding: 3px;
    text-align: center; 
    justify-content: center;
}
.footer {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-size: 0.9rem;
}

.container2 {
    padding: 1px;
}
.column2{
    display: grid;
    grid-template-columns: 65% 35%;
}
.row2 {
    padding: 2px;
    margin: 2px;
    align-content: center;
    text-align: center;
    align-items: center;
    overflow: hidden;
    /* ซ่อนข้อความที่เกิน */
    word-wrap: break-word;
    /* ตัดคำเมื่อข้อความเกิน */
}

.upload-icon {
    font-size: 40px;
    color: #3498db;
}

.upload-area {
    display: flex;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    padding-left: 25px;
}

.upload-area:hover {
    background-color: #f4f7fb;
}

.upload-icon {
    font-size: 20px;
    color: #3498db;
}



input[type="file"] {
    display: none;
}

button {
    background-color: #3498db;
    color: #fff;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    /* กำหนดความกว้างของปุ่ม */
    height: 50px;
    /* กำหนดความสูงของปุ่ม */
}
.detail-row1 {
  display: flex;         /* ให้อยู่บรรทัดเดียว */
  gap: 30px;             /* เว้นระยะระหว่างคู่ item */
  align-items: center;   /* จัดแนวตั้งกลาง */
  justify-content: start;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 15px;
  padding-left: 15%;
}

.detail-label1 {
  margin-right: 5px;     /* เว้นระยะ label กับ value */
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 14px;
}

.detail-value1 {
  color: red;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 14px;
}



/* Responsive adjustments */
@media (max-width: 600px) {
    .profile-pic {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }

    .profile-name {
        font-size: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .detail-item {
        flex-direction: column;
    }

    .detail-label,
    .detail-value {
        width: 100%;
    }

    .detail-label {
        margin-bottom: 5px;
    }
    .detail-row1 {
  display: flex;         /* ให้อยู่บรรทัดเดียว */
  gap: 30px;             /* เว้นระยะระหว่างคู่ item */
  align-items: center;   /* จัดแนวตั้งกลาง */
  justify-content: start;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 15px;
  padding-left: 15%;
}

.detail-label1 {
  margin-right: 5px;     /* เว้นระยะ label กับ value */
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 14px;
}

.detail-value1 {
  color: red;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 14px;
}
}

@media (max-width: 600px) {
    .checkbox-group {
        display: grid;
        grid-template-columns: 25% 25% 25% 25%;
        gap: 2px;
        font-size: 14px;
    }

    .checkbox-item {
        margin-bottom: 5px;
        
    }
    .detail-item{
        display: grid;
        grid-template-columns: 40% 60%;
        font-size: 13px;
    }
    .detail-label{
        font-size: 13px;
    }
    .save-btn{
        margin: 30px 0px 20px 0px;
        padding: 35px 30px 35px 30px;
    }
    .checkbox-item input {
    margin-right: 3px;
    margin-left: 5px;
    accent-color: var(--primary);
    width: 14px;
    height: 14px;
    cursor: pointer;
}
    
    
}