/* Memorial Theme CSS */
/* โทนสีอาลัย สีอ่อนๆ เหมาะสำหรับไว้อาลัย */

.memorial-theme {
    /* พื้นหลังหลัก - โทนสีอ่อน */
    background-color: #fafafa !important;
    color: #4a4a4a !important;
}

.memorial-theme .header,
.memorial-theme .top-nav,
.memorial-theme .main-nav {
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%) !important;
    color: #555555 !important;
    border-bottom: 1px solid #e0e0e0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.memorial-theme .navbar,
.memorial-theme .menu {
    background-color: #f8f8f8 !important;
    border: 1px solid #e8e8e8 !important;
}

.memorial-theme .nav-link,
.memorial-theme .menu-item,
.memorial-theme a {
    color: #666666 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

.memorial-theme .nav-link:hover,
.memorial-theme .menu-item:hover,
.memorial-theme a:hover {
    color: #888888 !important;
    background-color: #f0f0f0 !important;
}

/* เนื้อหาหลัก */
.memorial-theme .content,
.memorial-theme .main-content,
.memorial-theme .body {
    background-color: #ffffff !important;
    color: #555555 !important;
    border: 1px solid #f0f0f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
    margin: 10px !important;
    padding: 20px !important;
    border-radius: 3px !important;
}

/* หัวข้อและข้อความสำคัญ */
.memorial-theme h1,
.memorial-theme h2,
.memorial-theme h3,
.memorial-theme h4,
.memorial-theme h5,
.memorial-theme h6 {
    color: #444444 !important;
    font-weight: 400 !important;
    margin-bottom: 15px !important;
}

.memorial-theme h1 {
    border-bottom: 1px solid #e8e8e8 !important;
    padding-bottom: 10px !important;
}

/* ปุ่มและลิงก์ */
.memorial-theme .btn,
.memorial-theme button,
.memorial-theme input[type="submit"],
.memorial-theme input[type="button"] {
    background: linear-gradient(135deg, #f8f8f8 0%, #eeeeee 100%) !important;
    color: #666666 !important;
    border: 1px solid #dddddd !important;
    padding: 8px 16px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.memorial-theme .btn:hover,
.memorial-theme button:hover,
.memorial-theme input[type="submit"]:hover,
.memorial-theme input[type="button"]:hover {
    background: linear-gradient(135deg, #eeeeee 0%, #e0e0e0 100%) !important;
    color: #555555 !important;
    border-color: #cccccc !important;
}

/* ฟอร์มและ input */
.memorial-theme input,
.memorial-theme textarea,
.memorial-theme select {
    background-color: #ffffff !important;
    color: #555555 !important;
    border: 1px solid #e0e0e0 !important;
    padding: 8px 12px !important;
    border-radius: 3px !important;
}

.memorial-theme input:focus,
.memorial-theme textarea:focus,
.memorial-theme select:focus {
    border-color: #cccccc !important;
    outline: none !important;
    box-shadow: 0 0 5px rgba(0,0,0,0.1) !important;
}

/* ตาราง */
.memorial-theme table {
    background-color: #ffffff !important;
    border: 1px solid #f0f0f0 !important;
    border-collapse: collapse !important;
    width: 100% !important;
}

.memorial-theme th,
.memorial-theme td {
    border: 1px solid #f5f5f5 !important;
    padding: 10px !important;
    color: #555555 !important;
}

.memorial-theme th {
    background-color: #f8f8f8 !important;
    font-weight: 500 !important;
}

.memorial-theme tr:nth-child(even) {
    background-color: #fafafa !important;
}

/* Sidebar และ widgets */
.memorial-theme .sidebar,
.memorial-theme .widget {
    background-color: #ffffff !important;
    border: 1px solid #f0f0f0 !important;
    margin-bottom: 15px !important;
    border-radius: 3px !important;
}

.memorial-theme .widget-title {
    background-color: #f8f8f8 !important;
    color: #555555 !important;
    padding: 12px 15px !important;
    margin: 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.memorial-theme .widget-content {
    padding: 15px !important;
    color: #666666 !important;
}

/* Footer */
.memorial-theme .footer {
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%) !important;
    color: #666666 !important;
    border-top: 1px solid #e0e0e0 !important;
    padding: 20px !important;
    margin-top: 30px !important;
    text-align: center !important;
}

/* Counter และสถิติ */
.memorial-theme .counter,
.memorial-theme .stats {
    background-color: #ffffff !important;
    border: 1px solid #f0f0f0 !important;
    padding: 15px !important;
    margin: 10px 0 !important;
    border-radius: 3px !important;
}

.memorial-theme .counter-title {
    color: #555555 !important;
    font-weight: 500 !important;
    margin-bottom: 8px !important;
}

.memorial-theme .counter-number {
    color: #666666 !important;
    font-size: 18px !important;
    font-weight: 400 !important;
}

/* แถบข้อความแจ้งเตือน */
.memorial-theme .alert,
.memorial-theme .notice {
    background-color: #f9f9f9 !important;
    border: 1px solid #e8e8e8 !important;
    color: #666666 !important;
    padding: 12px 15px !important;
    margin: 10px 0 !important;
    border-radius: 3px !important;
}

/* ปุ่มสลับธีม */
.theme-toggle {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #f8f8f8 0%, #eeeeee 100%) !important;
    color: #666666 !important;
    border: 1px solid #dddddd !important;
    padding: 10px 15px !important;
    border-radius: 25px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    z-index: 1000 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    transition: all 0.3s ease !important;
}

.theme-toggle:hover {
    background: linear-gradient(135deg, #eeeeee 0%, #e0e0e0 100%) !important;
    color: #555555 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

/* Responsive สำหรับมือถือ */
@media (max-width: 768px) {
    .theme-toggle {
        right: 10px;
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .memorial-theme .content,
    .memorial-theme .main-content {
        margin: 5px !important;
        padding: 15px !important;
    }
}

/* รูปภาพและเอฟเฟกต์ - ขาว-ดำตลอดเวลา */
.memorial-theme img {
    filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
    transition: all 0.3s ease !important;
    border-radius: 3px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.memorial-theme img:hover {
    filter: grayscale(100%) brightness(1) contrast(1.4) !important;
    transform: scale(1.02) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
}

/* เอฟเฟกต์พิเศษสำหรับรูปหลัก - ขาว-ดำเสมอ */
.memorial-theme .content img,
.memorial-theme .article img {
    filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
    border: 2px solid #f0f0f0 !important;
    padding: 3px !important;
    background-color: #ffffff !important;
}

.memorial-theme .content img:hover,
.memorial-theme .article img:hover {
    filter: grayscale(100%) brightness(1) contrast(1.4) !important;
    border-color: #ddd !important;
    transform: scale(1.03) !important;
}

/* เอฟเฟกต์สำหรับโลโก้ - ขาว-ดำเสมอ */
.memorial-theme #logo img {
    filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
    transition: all 0.3s ease !important;
}

.memorial-theme #logo:hover img {
    filter: grayscale(100%) brightness(1) contrast(1.4) !important;
}

/* เอฟเฟกต์สำหรับรูปประจำตัว */
.memorial-theme .profile-image,
.memorial-theme .user-image {
    filter: grayscale(100%) brightness(0.8) contrast(1.4) !important;
    border: 3px solid #f5f5f5 !important;
    border-radius: 5px !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15) !important;
}

.memorial-theme .profile-image:hover,
.memorial-theme .user-image:hover {
    filter: grayscale(100%) brightness(0.95) contrast(1.5) !important;
    border-color: #e0e0e0 !important;
    transform: translateY(-2px) !important;
}

/* เอฟเฟกต์สำหรับรูปในแกลลอรี่ */
.memorial-theme .gallery img,
.memorial-theme .thumbnail img {
    filter: grayscale(100%) brightness(0.75) contrast(1.5) !important;
    transition: all 0.4s ease !important;
    cursor: pointer !important;
}

.memorial-theme .gallery img:hover,
.memorial-theme .thumbnail img:hover {
    filter: grayscale(100%) brightness(0.9) contrast(1.6) !important;
    transform: scale(1.05) !important;
    z-index: 2 !important;
    position: relative !important;
}

/* เอฟเฟกต์การเฟด */
.memorial-theme .fade-effect {
    opacity: 0.8 !important;
    transition: opacity 0.3s ease !important;
}

.memorial-theme .fade-effect:hover {
    opacity: 1 !important;
}

/* เอฟเฟกต์ Overlay สำหรับรูปภาพ */
.memorial-theme .image-overlay {
    position: relative !important;
    overflow: hidden !important;
}

.memorial-theme .image-overlay::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(255,255,255,0.1) !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

.memorial-theme .image-overlay:hover::before {
    opacity: 1 !important;
}

/* เอฟเฟกต์ Blur สำหรับพื้นหลัง */
.memorial-theme .background-image {
    filter: grayscale(50%) blur(1px) brightness(0.7) !important;
    transition: all 0.5s ease !important;
}

.memorial-theme .background-image:hover {
    filter: grayscale(20%) blur(0px) brightness(0.9) !important;
}

/* เอฟเฟกต์สำหรับไอคอน */
.memorial-theme .icon,
.memorial-theme .social-icon {
    filter: grayscale(30%) brightness(0.9) !important;
    transition: all 0.3s ease !important;
    opacity: 0.8 !important;
}

.memorial-theme .icon:hover,
.memorial-theme .social-icon:hover {
    filter: grayscale(0%) brightness(1) !important;
    opacity: 1 !important;
    transform: scale(1.1) !important;
}

/* เอฟเฟกต์พิเศษเพิ่มเติม */

/* เอฟเฟกต์ Sepia สำหรับรูปเก่า */
.memorial-theme .vintage-effect,
.memorial-theme .old-photo {
    filter: grayscale(50%) sepia(30%) brightness(0.9) contrast(1.1) !important;
    border: 4px solid #f8f8f8 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
}

.memorial-theme .vintage-effect:hover,
.memorial-theme .old-photo:hover {
    filter: grayscale(20%) sepia(10%) brightness(1) contrast(1) !important;
    transform: scale(1.02) rotate(0.5deg) !important;
}

/* เอฟเฟกต์สำหรับรูปในข่าว/บทความ */
.memorial-theme .news-image,
.memorial-theme .article-image {
    filter: grayscale(35%) brightness(0.88) contrast(0.9) !important;
    border-left: 4px solid #e8e8e8 !important;
    padding-left: 10px !important;
    margin: 10px 0 !important;
}

/* เอฟเฟกต์การสั่น (subtle) */
.memorial-theme .gentle-shake:hover {
    animation: gentleShake 0.5s ease-in-out !important;
}

@keyframes gentleShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-1px); }
    75% { transform: translateX(1px); }
}

/* เอฟเฟกต์การปรากฏ */
.memorial-theme .fade-in {
    animation: fadeIn 1s ease-in !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* เอฟเฟกต์การเรืองแสงอ่อนๆ */
.memorial-theme .soft-glow:hover {
    box-shadow: 0 0 20px rgba(200,200,200,0.5) !important;
    filter: brightness(1.05) !important;
}

/* เอฟเฟกต์การซูมแบบนุ่มนวล */
.memorial-theme .smooth-zoom {
    transition: transform 0.6s ease, filter 0.6s ease !important;
}

.memorial-theme .smooth-zoom:hover {
    transform: scale(1.08) !important;
    filter: brightness(1.1) contrast(1.1) !important;
}

/* เอฟเฟกต์สำหรับรูปหน้าปก */
.memorial-theme .cover-image,
.memorial-theme .header-image {
    filter: grayscale(60%) brightness(0.8) contrast(0.7) !important;
    position: relative !important;
}

.memorial-theme .cover-image::after,
.memorial-theme .header-image::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(rgba(255,255,255,0.1), rgba(255,255,255,0.3)) !important;
    pointer-events: none !important;
}

/* เอฟเฟกต์การเบลอขอบ */
.memorial-theme .soft-border {
    filter: blur(0.5px) brightness(0.95) !important;
    transition: filter 0.4s ease !important;
}

.memorial-theme .soft-border:hover {
    filter: blur(0px) brightness(1) !important;
}

/* เอฟเฟกต์พิเศษสำหรับรูปสำคัญ */
.memorial-theme .important-image {
    filter: grayscale(20%) brightness(0.92) contrast(1.05) !important;
    border: 2px solid #f0f0f0 !important;
    border-radius: 8px !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12) !important;
    position: relative !important;
    overflow: hidden !important;
}

.memorial-theme .important-image::before {
    content: '' !important;
    position: absolute !important;
    top: -50% !important;
    left: -50% !important;
    width: 200% !important;
    height: 200% !important;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent) !important;
    transform: rotate(45deg) !important;
    transition: transform 0.6s ease !important;
    opacity: 0 !important;
}

.memorial-theme .important-image:hover::before {
    transform: rotate(45deg) translate(100%, 100%) !important;
    opacity: 1 !important;
}

.memorial-theme .important-image:hover {
    filter: grayscale(5%) brightness(1) contrast(1.1) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.18) !important;
}

/* Animation สำหรับการเปลี่ยนธีม */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* โหมดขาว-ดำสมบูรณ์ */
.memorial-theme.full-grayscale img {
    filter: grayscale(100%) brightness(0.85) contrast(1.4) !important;
}

.memorial-theme.full-grayscale img:hover {
    filter: grayscale(100%) brightness(1) contrast(1.5) !important;
}

/* เอฟเฟกต์พิเศษสำหรับรูปขาว-ดำ */
.memorial-theme .black-white-effect {
    filter: grayscale(100%) brightness(0.8) contrast(1.5) !important;
    border: 2px solid #f0f0f0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.memorial-theme .black-white-effect:hover {
    filter: grayscale(100%) brightness(1) contrast(1.7) !important;
    transform: scale(1.03) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25) !important;
}

/* บังคับทุกรูปให้เป็นขาว-ดำ */
.memorial-theme img[src] {
    filter: grayscale(100%) brightness(0.8) contrast(1.4) !important;
}

.memorial-theme img[src]:hover {
    filter: grayscale(100%) brightness(0.95) contrast(1.5) !important;
}

/* รูปภาพในแต่ละ element */
.memorial-theme div img,
.memorial-theme span img,
.memorial-theme a img,
.memorial-theme p img {
    filter: grayscale(100%) brightness(0.8) contrast(1.4) !important;
}

/* รูปภาพทั้งหมดแบบเฉพาะเจาะจง */
.memorial-theme img,
.memorial-theme img[src*=".jpg"],
.memorial-theme img[src*=".jpeg"],
.memorial-theme img[src*=".png"],
.memorial-theme img[src*=".gif"],
.memorial-theme img[src*=".webp"] {
    filter: grayscale(100%) brightness(0.8) contrast(1.4) !important;
    -webkit-filter: grayscale(100%) brightness(0.8) contrast(1.4) !important;
    -moz-filter: grayscale(100%) brightness(0.8) contrast(1.4) !important;
    -o-filter: grayscale(100%) brightness(0.8) contrast(1.4) !important;
    -ms-filter: grayscale(100%) brightness(0.8) contrast(1.4) !important;
}

.memorial-theme img:hover,
.memorial-theme img[src*=".jpg"]:hover,
.memorial-theme img[src*=".jpeg"]:hover,
.memorial-theme img[src*=".png"]:hover,
.memorial-theme img[src*=".gif"]:hover,
.memorial-theme img[src*=".webp"]:hover {
    filter: grayscale(100%) brightness(0.95) contrast(1.5) !important;
    -webkit-filter: grayscale(100%) brightness(0.95) contrast(1.5) !important;
    -moz-filter: grayscale(100%) brightness(0.95) contrast(1.5) !important;
    -o-filter: grayscale(100%) brightness(0.95) contrast(1.5) !important;
    -ms-filter: grayscale(100%) brightness(0.95) contrast(1.5) !important;
}

/* รูปภาพแบบ inline style ให้ override */
.memorial-theme img[style] {
    filter: grayscale(100%) brightness(0.8) contrast(1.4) !important;
}