/* ==============================
   สไตล์หลักสำหรับ news-editor.php
   ============================== */

/* พื้นหลังและฟอนต์ */
body {
    font-family: "Segoe UI", Tahoma, sans-serif;
    background-color: #f7f9fc;
    margin: 0;
    padding: 0;
    color: #333;
}

/* กล่องเนื้อหา */
.container {
    max-width: 860px;        /* กว้างพอดี ไม่ล้น */
    margin: 30px auto;
    background: #fff;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

/* หัวข้อ */
h1, h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

/* ป้ายกำกับ */
label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    color: #34495e;
}

/* ช่องกรอกข้อมูล */
input[type="text"],
input[type="url"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    transition: border 0.2s ease-in-out;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #3498db;
    outline: none;
}

/* ปุ่ม */
button {
    background-color: #3498db;
    color: #fff;
    border: none;
    padding: 10px 16px;
    margin-top: 15px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

button:hover {
    background-color: #2980b9;
}

/* ปุ่มออกจากระบบ */
.logout-button {
    display: inline-block;
    margin-top: 15px;
    background: #e74c3c;
    color: #fff;
    padding: 8px 14px;
    text-decoration: none;
    border-radius: 6px;
}

.logout-button:hover {
    background: #c0392b;
}

/* กล่องอัปโหลดภาพ */
.image-upload {
    margin-top: 15px;
    padding: 10px;
    background: #f4f6f8;
    border: 1px dashed #bbb;
    border-radius: 6px;
}

/* แกลเลอรี่ภาพ */
#imageGallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

#imageGallery img {
    width: 120px;
    height: auto;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

#imageGallery img:hover {
    transform: scale(1.05);
}

/* รายการข่าวเก่า */
#newsIndex {
    list-style: none;
    padding: 0;
}

#newsIndex li {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

#newsIndex li a {
    color: #2980b9;
    text-decoration: none;
}

#newsIndex li a:hover {
    text-decoration: underline;
}

/* กล่องแจ้งสถานะ */
#status {
    margin-top: 10px;
    padding: 8px;
    border-radius: 6px;
}

#status.success {
    background: #2ecc71;
    color: #fff;
}

#status.error {
    background: #e74c3c;
    color: #fff;
}

/* สำหรับมือถือ */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    button {
        width: 100%;
    }
}
