/* ตัวแปรสีหลักสำหรับธีมมืดสีม่วงฟ้า */
:root {
    --primary-dark: #1a1a2e;
    --secondary-dark: #16213e;
    --accent-purple: #9d4edd;
    --accent-blue: #7b2cbf;
    --accent-light-purple: #c77dff;
    --text-light: #e2e2e2;
    --text-dim: #a0a0a0;
    --gradient-purple-blue: linear-gradient(135deg, #7b2cbf 0%, #3a0ca3 50%, #4361ee 100%);
    --card-bg: rgba(26, 26, 46, 0.7);
    --glass-effect: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 15px rgba(123, 44, 191, 0.5);
}

/* สไตล์สำหรับแกลเลอรี่รูปภาพ */
.gallery-header {
    text-align: center;
    margin-bottom: 2.5rem;
    background: var(--gradient-purple-blue);
    padding: 3rem 2rem;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 50px rgba(123, 44, 191, 0.5);
}

.gallery-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.gallery-header h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    position: relative;
}

.gallery-header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: white;
    border-radius: 2px;
}

.gallery-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* ปรับปรุงส่วน gallery controls */
.gallery-controls {
    margin-bottom: 2.5rem;
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 25px var(--shadow-color);
    transition: transform 0.3s ease;
}

.gallery-controls:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px var(--shadow-color), var(--shadow-glow);
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

/* ปุ่มฟิลเตอร์สวยงาม */
.filter-btn {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border: 1px solid var(--glass-border);
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    background-color: rgba(157, 78, 221, 0.3);
    border-color: var(--accent-purple);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(123, 44, 191, 0.3);
    color: white;
}

.filter-btn.active {
    background: var(--gradient-purple-blue);
    color: white;
    border: none;
    box-shadow: 0 5px 15px rgba(123, 44, 191, 0.5);
}

/* ตัวเลือกการเรียงลำดับ */
.sort-options {
    margin-left: auto;
    position: relative;
}

.sort-select {
    padding: 0.7rem 1.5rem 0.7rem 1rem;
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sort-options::after {
    content: '\f0d7';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--accent-purple);
    transition: transform 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px rgba(157, 78, 221, 0.3);
}

.sort-select:hover {
    background-color: rgba(157, 78, 221, 0.2);
    border-color: var(--accent-purple);
}

.sort-select option {
    background-color: var(--secondary-dark);
    color: var(--text-light);
}

/* กริดรูปภาพ */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 2rem;
}

/* การ์ดรูปภาพ */
.image-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;
    position: relative;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.image-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.7s ease;
    z-index: 1;
    pointer-events: none;
}

.image-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(123, 44, 191, 0.4);
}

.image-card:hover::before {
    left: 100%;
}

/* รูปภาพในการ์ด */
.gallery-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.5s ease;
    filter: brightness(0.9);
}

.image-card:hover .gallery-img {
    filter: brightness(1.1);
    transform: scale(1.05);
}

/* ข้อมูลรูปภาพ */
.image-info {
    padding: 20px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    background: linear-gradient(to top, var(--card-bg) 80%, transparent);
}

.image-info h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-light);
    position: relative;
    display: inline-block;
}

.image-info h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-purple);
    transition: width 0.3s ease;
}

.image-card:hover .image-info h3::after {
    width: 100%;
}

.image-info p {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ระบบ Masonry Grid */
.masonry-grid {
    column-count: 3;
    column-gap: 25px;
    margin-top: 2rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 25px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.masonry-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), var(--shadow-glow);
}

.masonry-item img {
    width: 100%;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.5s ease;
    filter: brightness(0.9);
}

.masonry-item:hover img {
    filter: brightness(1.1);
    transform: scale(1.05);
}

/* คำบรรยายในระบบ Masonry */
.masonry-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.masonry-item:hover .masonry-caption {
    opacity: 1;
    transform: translateY(0);
}

/* Modal สำหรับรูปภาพขนาดใหญ่ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 20, 0.95);
    overflow: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 30px;
    width: 80%;
    max-width: 1000px;
    animation: zoom 0.4s ease;
    background-color: rgba(26, 26, 46, 0.6);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(123, 44, 191, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

@keyframes zoom {
    from {transform: scale(0.9); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text-light);
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(26, 26, 46, 0.7);
}

.close-modal:hover {
    color: var(--accent-purple);
    transform: rotate(90deg);
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-caption {
    margin: 20px 0;
    color: var(--text-light);
    text-align: center;
    font-size: 1.1rem;
    opacity: 0.9;
}

#modalImage {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ระบบซูมรูปภาพ */
.zoom-container {
    overflow: hidden;
    position: relative;
    border-radius: 12px;
}

.zoomable {
    transition: transform 0.5s ease;
    cursor: zoom-in;
}

.zoomed {
    transform: scale(1.5);
    cursor: zoom-out;
}

/* ปุ่มกลับไปด้านบน */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-purple-blue);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    transform: translateY(20px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2), 0 0 10px rgba(123, 44, 191, 0.5);
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(123, 44, 191, 0.7);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* ระบบโหลดภาพแบบ Lazy Loading */
.lazy-load {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lazy-load.loaded {
    opacity: 1;
}

/* เอฟเฟกต์แสดงสถานะการโหลดภาพ */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-purple);
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ระบบภาพที่ยังไม่โหลด */
.image-placeholder {
    background: linear-gradient(45deg, 
        var(--secondary-dark) 25%, 
        var(--primary-dark) 25%, 
        var(--primary-dark) 50%, 
        var(--secondary-dark) 50%, 
        var(--secondary-dark) 75%, 
        var(--primary-dark) 75%);
    background-size: 20px 20px;
    animation: move-bg 2s linear infinite;
    width: 100%;
    height: 220px;
    border-radius: 12px 12px 0 0;
}

@keyframes move-bg {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* ระบบตัวกรองภาพ สำหรับการดูในโหมดต่างๆ */
.filter-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.filter-controls button {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-controls button:hover {
    background-color: rgba(157, 78, 221, 0.3);
    border-color: var(--accent-purple);
}

.filter-controls button.active {
    background: var(--gradient-purple-blue);
    color: white;
    border: none;
}

/* สถานะไม่มีรูปภาพที่ตรงกับฟิลเตอร์ */
.no-results {
    text-align: center;
    padding: 3rem;
    background-color: var(--card-bg);
    border-radius: 12px;
    margin-top: 2rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.no-results i {
    font-size: 3rem;
    color: var(--accent-purple);
    margin-bottom: 1rem;
}

.no-results h3 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-dim);
}

/* ไอคอนหมวดหมู่ในการ์ด */
.category-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: var(--gradient-purple-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.category-icon i {
    color: white;
    font-size: 18px;
}

/* วันที่ในการ์ด */
.image-date {
    font-size: 0.8rem;
    color: var(--accent-light-purple);
    margin-top: 10px;
    display: flex;
    align-items: center;
}

.image-date i {
    margin-right: 5px;
}

/* ปุ่มแชร์ในการ์ด */
.image-share {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.image-share:hover {
    background-color: var(--accent-purple);
    transform: translateY(-3px);
}

.image-share i {
    color: white;
    font-size: 16px;
}

/* ระบบการเปลี่ยนมุมมอง (Grid/List/Masonry) */
.view-controls {
    display: flex;
    gap: 10px;
    margin-right: 15px;
}

.view-btn {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background-color: rgba(157, 78, 221, 0.3);
    border-color: var(--accent-purple);
}

.view-btn.active {
    background: var(--gradient-purple-blue);
    color: white;
    border: none;
}

.view-btn i {
    color: var(--text-light);
    font-size: 18px;
}

.view-btn.active i {
    color: white;
}

/* ระบบแสดงรูปภาพแบบ List View */
.list-view .image-grid {
    display: block;
}

.list-view .image-card {
    display: flex;
    margin-bottom: 20px;
    max-height: 200px;
}

.list-view .gallery-img {
    width: 280px;
    height: 100%;
    border-radius: 12px 0 0 12px;
}

.list-view .image-info {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Hover Effects เสริม */
.hover-zoom-effect .gallery-img {
    transition: transform 0.5s ease, filter 0.3s ease;
}

.hover-zoom-effect:hover .gallery-img {
    transform: scale(1.08);
    filter: brightness(1.1) contrast(1.1);
}

.hover-glow-effect:hover {
    box-shadow: 0 0 25px var(--accent-purple);
}

.hover-rotate-effect:hover {
    transform: rotate(2deg) translateY(-5px);
}

.hover-tilt-effect {
    transition: transform 0.5s ease-out;
}

.hover-tilt-effect:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg) scale(1.05);
}

/* Responsive Adjustments */
@media screen and (max-width: 1200px) {
    .masonry-grid {
        column-count: 3;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media screen and (max-width: 992px) {
    .masonry-grid {
        column-count: 2;
    }
    
    .gallery-header h1 {
        font-size: 2rem;
    }
    
    .list-view .image-card {
        flex-direction: column;
        max-height: none;
    }
    
    .list-view .gallery-img {
        width: 100%;
        height: 220px;
        border-radius: 12px 12px 0 0;
    }
}

@media screen and (max-width: 768px) {
    .gallery-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sort-options, .view-controls {
        margin-left: 0;
        margin-top: 15px;
        align-self: flex-end;
    }
    
    .gallery-header h1 {
        font-size: 1.8rem;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media screen and (max-width: 576px) {
    .masonry-grid {
        column-count: 1;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .gallery-header {
        padding: 2rem 1rem;
    }
    
    .gallery-header h1 {
        font-size: 1.5rem;
    }
    
    .gallery-header p {
        font-size: 1rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        flex: 1;
        text-align: center;
    }
    
    .gallery-controls {
        padding: 1rem;
    }
}

/* Animation Effects */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.stagger-fade-in > * {
    opacity: 0;
}

.stagger-fade-in > *:nth-child(1) { animation: fadeIn 0.3s ease 0.1s forwards; }
.stagger-fade-in > *:nth-child(2) { animation: fadeIn 0.3s ease 0.2s forwards; }
.stagger-fade-in > *:nth-child(3) { animation: fadeIn 0.3s ease 0.3s forwards; }
.stagger-fade-in > *:nth-child(4) { animation: fadeIn 0.3s ease 0.4s forwards; }
.stagger-fade-in > *:nth-child(5) { animation: fadeIn 0.3s ease 0.5s forwards; }
.stagger-fade-in > *:nth-child(6) { animation: fadeIn 0.3s ease 0.6s forwards; }
.stagger-fade-in > *:nth-child(7) { animation: fadeIn 0.3s ease 0.7s forwards; }
.stagger-fade-in > *:nth-child(8) { animation: fadeIn 0.3s ease 0.8s forwards; }
.stagger-fade-in > *:nth-child(9) { animation: fadeIn 0.3s ease 0.9s forwards; }
.stagger-fade-in > *:nth-child(10) { animation: fadeIn 0.3s ease 1s forwards; }

/* เพิ่ม Badge สำหรับรูปภาพใหม่ */
.new-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #ff6a00, #ee0979);
    color: white;
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transform: rotate(-5deg);
}

/* เอฟเฟกต์เรืองแสงเมื่อโฮเวอร์ */
.glow-on-hover:hover {
    animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 10px rgba(123, 44, 191, 0.5); }
    to { box-shadow: 0 0 20px rgba(123, 44, 191, 0.8), 0 0 30px rgba(67, 97, 238, 0.6); }
}

/* เอฟเฟกต์ไอคอนเคลื่อนไหวเมื่อโฮเวอร์ */
.pulse-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* เอฟเฟกต์การ์ดกระดกเมื่อโฮเวอร์ */
.flip-card-container {
    perspective: 1000px;
}

.flip-card {
    position: relative;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card-container:hover .flip-card {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
    background: var(--gradient-purple-blue);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* เอฟเฟกต์ขยายการ์ด */
.expand-on-hover {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.expand-on-hover:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* คลาสสำหรับแสดงสถานะการโหลด */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 46, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.loading-content {
    text-align: center;
    color: var(--text-light);
}

.loading-spinner-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-purple);
    animation: spin 1s infinite linear;
    margin: 0 auto 20px;
}

/* เอฟเฟกต์ล้อมกรอบ */
.frame-effect {
    position: relative;
    padding: 8px;
}

.frame-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--accent-purple);
    border-radius: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    transform: scale(1.1);
}

.frame-effect:hover::before {
    opacity: 1;
    transform: scale(1);
}

/* เอฟเฟกต์ภาพแบบซ้อนทับ */
.overlay-effect {
    position: relative;
    overflow: hidden;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(26, 26, 46, 0.9), transparent);
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

.overlay-effect:hover .image-overlay {
    opacity: 1;
}

.overlay-title {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 8px;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
}

.overlay-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.2s;
}

.overlay-btn {
    margin-top: 15px;
    align-self: flex-start;
    padding: 8px 15px;
    background: var(--gradient-purple-blue);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease 0.3s;
}

.overlay-effect:hover .overlay-title,
.overlay-effect:hover .overlay-desc,
.overlay-effect:hover .overlay-btn {
    transform: translateY(0);
    opacity: 1;
}

/* เอฟเฟกต์รูปภาพซูมออก */
.zoom-out-effect {
    overflow: hidden;
}

.zoom-out-effect img {
    transform: scale(1.2);
    transition: transform 0.5s ease;
}

.zoom-out-effect:hover img {
    transform: scale(1);
}

/* เอฟเฟกต์เลื่อนขึ้นของข้อมูล */
.slide-up-info {
    position: relative;
    overflow: hidden;
}

.slide-up-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(26, 26, 46, 0.95), rgba(26, 26, 46, 0.8) 80%, transparent);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.slide-up-info:hover .slide-up-content {
    transform: translateY(0);
}

/* เอฟเฟกต์การเปลี่ยนสีพื้นหลังกล่องข้อมูล */
.color-shift-info {
    position: relative;
}

.color-shift-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-purple-blue);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: 0 0 12px 12px;
}

.color-shift-info:hover .color-shift-bg {
    opacity: 0.9;
}

.color-shift-info:hover h3,
.color-shift-info:hover p {
    color: white;
}

/* เอฟเฟกต์ไฮไลท์ขอบรูปภาพ */
.highlight-border {
    position: relative;
}

.highlight-border::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 12px;
    background: linear-gradient(45deg, var(--accent-purple), var(--accent-blue)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.highlight-border:hover::after {
    opacity: 1;
}

/* สถานะโหลดข้อมูลเพิ่มเติม */
.load-more-container {
    text-align: center;
    margin: 3rem 0;
}

.load-more-btn {
    background: var(--gradient-purple-blue);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2), 0 0 10px rgba(123, 44, 191, 0.3);
}

.load-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(123, 44, 191, 0.5);
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s ease;
}

.load-more-btn:hover::before {
    left: 100%;
}

.load-more-btn.loading {
    padding-left: 3rem;
    opacity: 0.8;
    pointer-events: none;
}

.loading-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    animation: spin 1s infinite linear;
}

/* ระบบแท็กในรูปภาพ */
.image-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.image-tag {
    background-color: rgba(157, 78, 221, 0.2);
    color: var(--accent-light-purple);
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.image-tag:hover {
    background-color: var(--accent-purple);
    color: white;
    transform: translateY(-2px);
}

/* ระบบแสดงจำนวนการดู/ถูกใจ */
.image-stats {
    display: flex;
    gap: 15px;
    margin-top: 12px;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.image-stat {
    display: flex;
    align-items: center;
}

.image-stat i {
    margin-right: 5px;
    font-size: 1rem;
}

/* เอฟเฟกต์ Border Gradient */
.gradient-border {
    position: relative;
    border-radius: 14px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-purple-blue);
    z-index: -1;
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-border:hover::before {
    opacity: 1;
}

/* เอฟเฟกต์เงาหลายชั้น */
.multi-shadow {
    transition: all 0.4s ease;
}

.multi-shadow:hover {
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.2),
        0 10px 30px rgba(157, 78, 221, 0.2),
        0 15px 40px rgba(67, 97, 238, 0.1);
}

/* เอฟเฟกต์ Neuomorphism */
.neuomorphic {
    background-color: var(--secondary-dark);
    border-radius: 16px;
    box-shadow: 
        8px 8px 16px rgba(0, 0, 0, 0.3),
        -8px -8px 16px rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.neuomorphic:hover {
    box-shadow: 
        12px 12px 24px rgba(0, 0, 0, 0.3),
        -12px -12px 24px rgba(255, 255, 255, 0.05),
        0 0 20px rgba(157, 78, 221, 0.4);
}

/* เอฟเฟกต์เรืองแสงขอบ */
.edge-glow {
    transition: all 0.3s ease;
}

.edge-glow:hover {
    box-shadow: 
        0 0 0 2px rgba(157, 78, 221, 0.3),
        0 0 20px rgba(157, 78, 221, 0.5);
}

/* เอฟเฟกต์ไอคอนปรากฏเมื่อโฮเวอร์ */
.hover-icon-container {
    position: relative;
}

.hover-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px;
    height: 60px;
    background-color: rgba(157, 78, 221, 0.9);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.hover-icon-container:hover .hover-icon {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.hover-icon-container:hover img {
    filter: brightness(0.7) blur(2px);
}

/* เอฟเฟกต์ Morph ระหว่างรูปทรง */
.shape-morph {
    transition: all 0.5s ease;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
}

.shape-morph:hover {
    clip-path: polygon(5% 5%, 95% 5%, 95% 95%, 5% 95%);
}

/* เอฟเฟกต์กรอบตกแต่ง */
.fancy-border {
    position: relative;
}

.fancy-border::before, 
.fancy-border::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--accent-purple);
    transition: all 0.3s ease;
    opacity: 0;
}

.fancy-border::before {
    top: 10px;
    left: 10px;
    border-top: 2px solid;
    border-left: 2px solid;
}

.fancy-border::after {
    bottom: 10px;
    right: 10px;
    border-bottom: 2px solid;
    border-right: 2px solid;
}

.fancy-border:hover::before, 
.fancy-border:hover::after {
    width: calc(50% - 20px);
    height: calc(50% - 20px);
    opacity: 1;
}

/* เอฟเฟกต์ภาพเคลื่อนไหว */
.ken-burns-effect {
    overflow: hidden;
}

.ken-burns-effect img {
    transition: transform 8s ease;
}

.ken-burns-effect:hover img {
    transform: scale(1.1) translateX(2%) translateY(-2%);
}

/* สถานะแสดงกำลังโหลด */
.skeleton-loader {
    background: linear-gradient(90deg, 
        var(--secondary-dark) 25%, 
        rgba(67, 97, 238, 0.15) 50%, 
        var(--secondary-dark) 75%);
    background-size: 200% 100%;
    animation: loading-skeleton 1.5s infinite;
    border-radius: 12px;
}

@keyframes loading-skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-image {
    width: 100%;
    height: 220px;
}

.skeleton-text {
    height: 20px;
    margin-bottom: 10px;
    width: 80%;
}

.skeleton-text:last-child {
    width: 60%;
}

/* เพิ่มเอฟเฟกต์ 3D */
.perspective-card {
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.perspective-card:hover {
    transform: rotateX(5deg) rotateY(5deg);
}

/* เอฟเฟกต์กระจกเงา */
.mirror-effect {
    position: relative;
}

.mirror-reflection {
    position: absolute;
    bottom: -50%;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), transparent);
    transform: scaleY(-1);
    opacity: 0;
    transition: all 0.5s ease;
    pointer-events: none;
    filter: blur(2px);
}

.mirror-effect:hover .mirror-reflection {
    opacity: 0.5;
    bottom: -30%;
}

/* เอฟเฟกต์เรืองแสงข้อความ */
.text-glow {
    transition: text-shadow 0.3s ease;
}

.image-card:hover .text-glow {
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.8);
}

/* เอฟเฟกต์คลิกได้ */
.clickable-effect {
    position: relative;
    transition: all 0.2s ease;
}

.clickable-effect:active {
    transform: scale(0.98);
}

.clickable-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.clickable-effect:active::after {
    opacity: 1;
}

/* ระบบแบ่งหน้า */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    gap: 8px;
}

.pagination-item {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--glass-border);
}

.pagination-item:hover {
    background-color: rgba(157, 78, 221, 0.3);
    transform: translateY(-3px);
}

.pagination-item.active {
    background: var(--gradient-purple-blue);
    color: white;
    box-shadow: 0 5px 15px rgba(123, 44, 191, 0.3);
}

.pagination-dots {
    display: flex;
    align-items: center;
    color: var(--text-dim);
    padding: 0 8px;
}

/* ลูกศรเลื่อนแกลเลอรี่ */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(26, 26, 46, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10;
    border: 1px solid var(--glass-border);
}

.gallery-arrow-left {
    left: 20px;
}

.gallery-arrow-right {
    right: 20px;
}

.gallery-arrow:hover {
    background-color: var(--accent-purple);
    transform: translateY(-50%) scale(1.1);
}

.gallery-arrow i {
    font-size: 20px;
}

/* สถานะว่างเปล่า */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-top: 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--accent-purple);
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.empty-state p {
    color: var(--text-dim);
    max-width: 500px;
    margin: 0 auto;
}

/* ฟิลเตอร์สีกลุ่มรูปภาพ */
.color-filter-blue img {
    filter: sepia(0.3) hue-rotate(200deg) saturate(1.5);
}

.color-filter-purple img {
    filter: sepia(0.3) hue-rotate(270deg) saturate(1.5);
}

.color-filter-pink img {
    filter: sepia(0.3) hue-rotate(300deg) saturate(1.5);
}

.color-filter-gold img {
    filter: sepia(0.8) hue-rotate(330deg) saturate(1.5);
}

.color-filter-vintage img {
    filter: sepia(0.4) saturate(0.8) contrast(1.2);
}

.color-filter-night img {
    filter: brightness(0.8) contrast(1.2) saturate(1.2) hue-rotate(180deg);
}

/* ปุ่มกรองแบบ Toggle สีสันสวยงาม */
.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--secondary-dark);
    border-radius: 30px;
    padding: 5px;
    margin-right: 15px;
}

.toggle-option {
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.toggle-option.active {
    background: var(--gradient-purple-blue);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ตัวกรองพิเศษเสริม */
.special-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.special-filter {
    padding: 8px 15px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
}

.special-filter:hover {
    background-color: rgba(157, 78, 221, 0.2);
    border-color: var(--accent-purple);
}

.special-filter.active {
    background: var(--gradient-purple-blue);
    color: white;
}

.special-filter i {
    font-size: 1rem;
}

/* แถบค้นหาในแกลเลอรี่ */
.gallery-search {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.gallery-search input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.gallery-search input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.2);
}

.gallery-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 1.1rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

.gallery-search input:focus + i {
    color: var(--accent-purple);
}

/* ปุ่มล้างฟิลเตอร์ */
.clear-filters {
    padding: 10px 20px;
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.clear-filters:hover {
    background-color: rgba(255, 82, 82, 0.2);
    border-color: #ff5252;
    color: #ff5252;
}

.clear-filters i {
    font-size: 1rem;
}

/* ระบบเตือนข้อความสถานะ */
.gallery-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--card-bg);
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(157, 78, 221, 0.4);
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-notification.active {
    transform: translateY(0);
    opacity: 1;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-purple-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 3px;
}

.notification-message {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.notification-close {
    color: var(--text-dim);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.notification-close:hover {
    color: var(--accent-purple);
}

/* ระบบแสดงรูปภาพแบบไทม์ไลน์ */
.timeline-gallery {
    position: relative;
    margin: 3rem 0;
    padding-left: 30px;
}

.timeline-line {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-purple-blue);
    background-size: 100% 400%;
    animation: gradient-flow 8s linear infinite;
}

@keyframes gradient-flow {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 400%; }
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    padding-left: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 15px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient-purple-blue);
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.5);
}

.timeline-date {
    color: var(--accent-light-purple);
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-date i {
    font-size: 1rem;
}

.timeline-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.timeline-card:hover {
    transform: translateY(-5px) translateX(5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(123, 44, 191, 0.4);
}

/* ระบบแสดงรูปภาพแบบกริดขนาดแตกต่างกัน */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    gap: 20px;
}

.gallery-grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.gallery-grid-item:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), 0 0 15px rgba(123, 44, 191, 0.4);
    z-index: 2;
}

.gallery-grid-item.wide {
    grid-column: span 2;
}

.gallery-grid-item.tall {
    grid-row: span 2;
}

.gallery-grid-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
    filter: brightness(0.9);
}

.gallery-grid-item:hover img {
    filter: brightness(1.1);
    transform: scale(1.1);
}

.grid-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.gallery-grid-item:hover .grid-item-info {
    opacity: 1;
    transform: translateY(0);
}

/* ปุ่มปรับขนาดการแสดงผล */
.size-controls {
    display: flex;
    gap: 10px;
    margin-left: 15px;
}

.size-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.size-btn:hover {
    background-color: rgba(157, 78, 221, 0.2);
    color: var(--accent-purple);
}

.size-btn.active {
    background: var(--gradient-purple-blue);
    color: white;
}

/* สถานะกำลังโหลดรูปภาพ */
.photo-loading {
    position: relative;
    overflow: hidden;
}

.photo-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: loading-shimmer 1.5s infinite;
    z-index: 1;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* เอฟเฟกต์พล็อตเซอร์ (Polaroid) */
.polaroid-effect {
    background-color: white;
    padding: 15px 15px 40px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transform: rotate(-2deg);
    transition: all 0.4s ease;
}

.polaroid-effect:hover {
    transform: rotate(0deg) translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(123, 44, 191, 0.5);
}

.polaroid-effect img {
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.polaroid-caption {
    text-align: center;
    color: #333;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* ปุ่มเลือกหมวดหมู่แบบ Pill */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.category-pill {
    padding: 8px 16px;
    border-radius: 50px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.category-pill:hover {
    background-color: rgba(157, 78, 221, 0.2);
    transform: translateY(-2px);
}

.category-pill.active {
    background: var(--gradient-purple-blue);
    color: white;
    box-shadow: 0 5px 15px rgba(123, 44, 191, 0.3);
}

/* Chips เตือนการ์ดที่ยังไม่ได้อ่าน */
.new-chip {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6a00, #ee0979);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Badges แสดงสถานะของรูปภาพ */
.image-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(26, 26, 46, 0.8);
    color: var(--text-light);
    font-size: 0.7rem;
    padding: 5px 10px;
    border-radius: 20px;
    z-index: 2;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    gap: 5px;
}

.image-badge i {
    font-size: 0.8rem;
}

.badge-featured {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

.badge-new {
    background: linear-gradient(135deg, #00C9FF, #92FE9D);
    color: #000;
}

.badge-popular {
    background: linear-gradient(135deg, #FF416C, #FF4B2B);
    color: white;
}

/* ระบบโหลดเพิ่มเติมเมื่อเลื่อนลงมาสุด (Infinite Scroll) */
.loading-more {
    text-align: center;
    padding: 30px 0;
    color: var(--text-dim);
}

.loading-more-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid rgba(157, 78, 221, 0.1);
    border-top-color: var(--accent-purple);
    animation: spin 1s infinite linear;
    margin-right: 10px;
}

.loading-more-text {
    display: inline-block;
    vertical-align: middle;
}

/* ปรับปุ่มแบบเรียบสวยงาม */
.minimal-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.minimal-btn::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-purple-blue);
    transition: width 0.3s ease;
}

.minimal-btn:hover {
    color: var(--text-light);
}

.minimal-btn:hover::after {
    width: 100%;
}

/* ระบบเรียงแกลเลอรี่แบบไดนามิก */
.dynamic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 10px;
    grid-gap: 20px;
}

.dynamic-grid-item {
    grid-row-end: span 22; /* ค่าเริ่มต้น, จะถูกปรับโดย JavaScript */
    transition: all 0.3s ease;
}

.dynamic-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(123, 44, 191, 0.4);
    z-index: 2;
}

/* แสดงสถานะภาพยังไม่พร้อม */
.image-placeholder-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-dim);
    text-align: center;
    width: 80%;
}

.image-placeholder-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* เมนูท็อปบาร์แกลเลอรี่ที่เลื่อนตามและเป็นกระจกใส */
.gallery-topbar {
    position: sticky;
    top: 70px;
    z-index: 90;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(26, 26, 46, 0.8);
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.gallery-topbar.scrolled {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(123, 44, 191, 0.3);
    padding: 10px 20px;
}

/* ระบบป๊อปอัพดูรูปแบบ full */
.image-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 20, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.image-popup.open {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.image-popup.open .popup-content {
    transform: scale(1);
}

.popup-image {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.popup-caption {
    color: white;
    text-align: center;
    margin-top: 20px;
    font-size: 1.1rem;
}

.popup-close {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 40px;
    height: 40px;
    background-color: rgba(26, 26, 46, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    border: 1px solid var(--glass-border);
}

.popup-close:hover {
    background-color: var(--accent-purple);
    transform: rotate(90deg);
}

.popup-navigation {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.popup-nav-btn {
    width: 50px;
    height: 50px;
    background-color: rgba(26, 26, 46, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    font-size: 1.5rem;
    border: 1px solid var(--glass-border);
}

.popup-nav-btn:hover {
    background-color: var(--accent-purple);
    transform: scale(1.1);
}

/* Lightbox Controls */
.lightbox-tools {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background-color: rgba(26, 26, 46, 0.8);
    padding: 10px;
    border-radius: 30px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.lightbox-tool-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-tool-btn:hover {
    background-color: var(--accent-purple);
}

/* เอฟเฟกต์ Parallax */
.parallax-gallery {
    position: relative;
    height: 400px;
    overflow: hidden;
    border-radius: 16px;
    margin: 3rem 0;
}

.parallax-background {
    position: absolute;
    top: -50px;
    left: -50px;
    width: calc(100% + 100px);
    height: calc(100% + 100px);
    background-image: var(--gradient-purple-blue);
    background-size: cover;
    background-position: center;
    transform: translateZ(-10px) scale(2);
    z-index: -1;
}

.parallax-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    z-index: 1;
    transform: translateZ(0);
}

.parallax-title {
    color: white;
    font-size: 3rem;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

/* ไทม์ไลน์ แสดงวันที่เวลา */
.gallery-timeline {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 15px 0;
    margin-bottom: 25px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-purple) var(--secondary-dark);
}

.gallery-timeline::-webkit-scrollbar {
    height: 6px;
}

.gallery-timeline::-webkit-scrollbar-track {
    background-color: var(--secondary-dark);
    border-radius: 3px;
}

.gallery-timeline::-webkit-scrollbar-thumb {
    background-color: var(--accent-purple);
    border-radius: 3px;
}

.timeline-point {
    flex: 0 0 auto;
    padding: 8px 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
    white-space: nowrap;
}

.timeline-point:hover {
    background-color: rgba(157, 78, 221, 0.2);
    transform: translateY(-3px);
}

.timeline-point.active {
    background: var(--gradient-purple-blue);
    color: white;
    box-shadow: 0 5px 15px rgba(123, 44, 191, 0.3);
}

/* ตัวแจ้งเตือนเมื่อเลือกรูปภาพ */
.selection-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--card-bg);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(123, 44, 191, 0.5);
    display: flex;
    align-items: center;
    gap: 20px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 99;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.selection-indicator.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.selection-count {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-light);
}

.selection-count span {
    color: var(--accent-purple);
    margin-right: 5px;
}

.selection-actions {
    display: flex;
    gap: 10px;
}

.selection-btn {
    padding: 8px 15px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border: 1px solid var(--glass-border);
}

.selection-btn:hover {
    background-color: rgba(157, 78, 221, 0.2);
    color: var(--accent-purple);
}

.selection-btn.primary {
    background: var(--gradient-purple-blue);
    color: white;
    border: none;
}

.selection-btn.primary:hover {
    box-shadow: 0 5px 15px rgba(123, 44, 191, 0.3);
    transform: translateY(-2px);
}

.selection-clear {
    margin-left: 15px;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.3s ease;
}

.selection-clear:hover {
    color: #ff5252;
}

/* แสดงจำนวนรูปภาพ */
.image-counter {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 8px 15px;
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--glass-border);
}

.image-counter i {
    color: var(--accent-purple);
}

/* ปรับแต่งสีปุ่มขยายเต็มจอ */
#fullscreen-toggle {
    position: relative;
    overflow: hidden;
}

#fullscreen-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.7s ease;
    z-index: -1;
}

#fullscreen-toggle:hover::before {
    left: 100%;
}

.fullscreen-active {
    background: var(--gradient-purple-blue);
    color: white;
}

.fullscreen-active i {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ปรับแต่งการแสดงผลรูปภาพแบบต่างๆ */
.fade-gallery img {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.fade-gallery img.visible {
    opacity: 1;
}

.blur-in img {
    filter: blur(10px);
    transition: filter 0.5s ease;
}

.blur-in img.loaded {
    filter: blur(0);
}

/* เพิ่มเอฟเฟกต์ดีเลย์แอนิเมชั่น */
.delay-1 { animation-delay: 0.1s !important; }
.delay-2 { animation-delay: 0.2s !important; }
.delay-3 { animation-delay: 0.3s !important; }
.delay-4 { animation-delay: 0.4s !important; }
.delay-5 { animation-delay: 0.5s !important; }
.delay-6 { animation-delay: 0.6s !important; }
.delay-7 { animation-delay: 0.7s !important; }
.delay-8 { animation-delay: 0.8s !important; }
.delay-9 { animation-delay: 0.9s !important; }
.delay-10 { animation-delay: 1s !important; }

/* เพิ่มคลาส Utility สำหรับจัดการระยะห่าง */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 2rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 2rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 2rem !important; }

/* เพิ่มคลาสสำหรับความโปร่งใส */
.opacity-0 { opacity: 0 !important; }
.opacity-25 { opacity: 0.25 !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }
.opacity-100 { opacity: 1 !important; }

/* เพิ่มคลาสสำหรับ Background Blur */
.blur-xs { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.blur-sm { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.blur-md { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.blur-lg { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.blur-xl { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

/* สถานะโหลดเว็บไซต์ */
.site-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-dark);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.site-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(157, 78, 221, 0.2);
    border-top-color: var(--accent-purple);
    animation: spin 1s infinite linear;
    margin-bottom: 20px;
}

.loader-text {
    color: var(--text-light);
    font-size: 1.2rem;
    letter-spacing: 2px;
    animation: fade-pulse 1.5s infinite alternate;
}

@keyframes fade-pulse {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

/* คลาสสำหรับปรับแต่งตัวอักษร */
.text-gradient {
    background: var(--gradient-purple-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.text-shadow {
    text-shadow: 0 2px 10px rgba(123, 44, 191, 0.5);
}

.text-glow {
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.8);
}

.text-uppercase {
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* คลาสเพิ่มเติมสำหรับเอฟเฟกต์พื้นหลัง */
.bg-glass {
    background-color: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.bg-gradient {
    background: var(--gradient-purple-blue);
}

.bg-shimmer {
    background: linear-gradient(90deg, 
        var(--secondary-dark), 
        rgba(67, 97, 238, 0.3),
        var(--secondary-dark));
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -100% 0; }
    100% { background-position: 100% 0; }
}

/* การเรียงการ์ดรูปภาพแบบลูกเต๋า (เพิ่มมิติ) */
.cube-gallery {
    perspective: 1000px;
}

.cube-item {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.cube-item:hover {
    transform: rotateY(15deg) rotateX(5deg);
}

.cube-shadow {
    position: absolute;
    bottom: -20px;
    left: 5%;
    width: 90%;
    height: 20px;
    background: rgba(0, 0, 0, 0.2);
    filter: blur(10px);
    border-radius: 50%;
    transform: rotateX(80deg);
    opacity: 0.7;
    transition: all 0.5s ease;
}

.cube-item:hover .cube-shadow {
    opacity: 0.9;
    bottom: -25px;
}

/* เอฟเฟกต์ภาพ 3 มิติแบบต่างๆ */
.tilt-card {
    transform: perspective(1000px);
    transition: transform 0.5s ease;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg) scale(1.05);
}

.flip-card-container {
    perspective: 1000px;
    height: 300px;
}

.flip-card {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card-container:hover .flip-card {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
    background: var(--gradient-purple-blue);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* เพิ่มปุ่มสวิตช์โหมดมืด/สว่าง */
.theme-switch {
    position: relative;
    width: 60px;
    height: 30px;
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 0 5px;
    border: 1px solid var(--glass-border);
}

.theme-switch-inner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--accent-purple);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.theme-switch.light .theme-switch-inner {
    transform: translateX(28px);
    background-color: #ffc107;
}

/* ประสิทธิภาพเพิ่มเติมสำหรับมือถือ */
@media (hover: none) {
    .hover-effect {
        display: none;
    }
    
    .menu a::after {
        display: none;
    }
    
    .image-caption {
        transform: translateY(0);
        opacity: 1;
    }
    
    .btn::before {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* สำหรับมือถือและแท็บเล็ตในแนวตั้ง */
@media screen and (max-width: 768px) and (orientation: portrait) {
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .gallery-filters {
        overflow-x: auto;
        padding-bottom: 15px;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }
    
    .filter-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    
    .sort-options {
        flex: 1;
        margin-top: 15px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid-item.wide,
    .gallery-grid-item.large {
        grid-column: span 2;
    }
    
    .gallery-grid-item.tall {
        grid-row: span 1;
    }
}

/* สำหรับโทรศัพท์มือถือขนาดเล็ก */
@media screen and (max-width: 576px) {
    .gallery-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn {
        text-align: center;
    }
    
    .sort-options {
        width: 100%;
        margin-top: 15px;
    }
    
    .sort-select {
        width: 100%;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid-item.wide,
    .gallery-grid-item.tall,
    .gallery-grid-item.large {
        grid-column: auto;
        grid-row: auto;
    }
    
    .masonry-grid {
        column-count: 1;
    }
    
    .gallery-header h1 {
        font-size: 1.8rem;
    }
    
    .timeline-gallery {
        padding-left: 20px;
    }
    
    .timeline-item::before {
        left: -10px;
        width: 16px;
        height: 16px;
    }
    
    .modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .popup-close {
        top: -30px;
        right: 0;
    }
    
    .popup-navigation {
        padding: 0 10px;
    }
    
    .popup-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .selection-indicator {
        width: 90%;
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }
    
    .selection-actions {
        flex-wrap: wrap;
    }
    
    .selection-btn {
        flex: 1;
        text-align: center;
    }
}

/* สำหรับจอที่มีความละเอียดสูง */
@media screen and (min-width: 1440px) {
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    
    .masonry-grid {
        column-count: 4;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .gallery-header {
        padding: 4rem 3rem;
    }
    
    .gallery-header h1 {
        font-size: 3rem;
    }
    
    .gallery-controls {
        padding: 2rem;
    }
}

/* สำหรับการพิมพ์ */
@media print {
    header, footer, .gallery-controls, .back-to-top, 
    .modal, .selection-indicator, .lightbox-tools,
    .popup-close, .popup-navigation, .pagination {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .image-card {
        box-shadow: none;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }
    
    .gallery-img {
        max-width: 100%;
        height: auto;
    }
    
    .image-info h3 {
        color: black;
    }
    
    .image-info p {
        color: #333;
    }
    
    main {
        max-width: 100%;
    }
    
    .gallery-header {
        background: none;
        color: black;
        padding: 0;
        margin-bottom: 2rem;
    }
    
    .gallery-header h1 {
        color: black;
    }
    
    .gallery-header p {
        color: #333;
    }
}

/* เพิ่มเอฟเฟกต์เบลอพื้นหลังเมื่อโฟกัสที่การ์ดรูปภาพ */
.focus-highlight {
    transition: all 0.3s ease;
}

.gallery-container:hover .focus-highlight:not(:hover) {
    filter: blur(3px) brightness(0.7);
    transform: scale(0.95);
}

/* เอฟเฟกต์ตัวอักษรเสริม */
.char-animation {
    display: inline-block;
}

.char-animation span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: char-appear 0.5s forwards;
}

.char-animation:hover span {
    animation: char-bounce 0.3s forwards;
}

@keyframes char-appear {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes char-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ระบบลำดับการแสดงผลแกลเลอรี่ */
.stagger-appear {
    opacity: 0;
    transform: translateY(30px);
    animation: appear 0.5s ease forwards;
}

@keyframes appear {
    to { opacity: 1; transform: translateY(0); }
}

/* พื้นหลังลาย Grid */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 50px 50px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    z-index: -1;
    pointer-events: none;
}

/* เพิ่มเอฟเฟกต์พาร์ติเคิล */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(157, 78, 221, 0.5);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.8);
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(50px, 50px); }
    50% { transform: translate(0, 100px); }
    75% { transform: translate(-50px, 50px); }
}

/* เพิ่มเอฟเฟกต์แสงกระพริบ */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shine 4s infinite;
}

@keyframes shine {
    0% { transform: rotate(30deg) translateX(-100%); }
    100% { transform: rotate(30deg) translateX(100%); }
}

/* ตกแต่ง Placeholder */
::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}

/* ปรับแต่งการเลือกข้อความ */
::selection {
    background-color: rgba(157, 78, 221, 0.3);
    color: white;
}

/* ปรับแต่งเพิ่มเติมสำหรับ iOS Safari */
@supports (-webkit-touch-callout: none) {
    .gallery-img {
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    input, button, select {
        -webkit-appearance: none;
        border-radius: 12px;
    }
}

/* ป้องกันการหน่วงในการคลิกบนมือถือ */
html {
    touch-action: manipulation;
}

/* เอฟเฟกต์มัลติมีเดียพิเศษ */
.hover-audio {
    position: relative;
}

.hover-audio:hover .audio-indicator {
    opacity: 1;
    transform: translateY(0);
}

.audio-indicator {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-purple-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* เอฟเฟกต์ลูกคลื่นเวลาคลิก */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to { transform: scale(2.5); opacity: 0; }
}

/* เพิ่มประสิทธิภาพการโหลดหน้าเว็บ */
.lazy-section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s ease;
}

.lazy-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* เอฟเฟกต์ไลท์บอกซ์ */
.lightbox-effect {
    position: relative;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-effect:hover .lightbox-overlay {
    opacity: 1;
}

.lightbox-icon {
    color: white;
    font-size: 2rem;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.lightbox-effect:hover .lightbox-icon {
    transform: scale(1);
}

/* เพิ่มเอฟเฟกต์โหลดข้อมูลรูปภาพแบบพิเศษ */
.image-loader-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.image-loader-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(110deg, 
        var(--secondary-dark) 8%, 
        rgba(67, 97, 238, 0.15) 18%, 
        var(--secondary-dark) 33%);
    background-size: 200% 100%;
    animation: shimmer-loading 1.5s infinite;
}

@keyframes shimmer-loading {
    0% { background-position: -100% 0; }
    100% { background-position: 100% 0; }
}

.image-loader-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-purple-blue);
    transition: width 0.3s ease;
}

/* เพิ่มเอฟเฟกต์ Gallery Header */
.gallery-header-parallax {
    position: relative;
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.1s ease-out;
}

.parallax-layer-1 {
    background-image: url('/path/to/layer1.png');
    z-index: 1;
}

.parallax-layer-2 {
    background-image: url('/path/to/layer2.png');
    z-index: 2;
}

.parallax-content {
    position: relative;
    z-index: 3;
    color: white;
    text-align: center;
}

/* เพิ่มเอฟเฟกต์ Neumorphism */
.neumorphic-card {
    background-color: var(--secondary-dark);
    border-radius: 16px;
    box-shadow: 
        8px 8px 16px rgba(0, 0, 0, 0.3),
        -8px -8px 16px rgba(255, 255, 255, 0.03);
    padding: 20px;
    transition: all 0.3s ease;
}

.neumorphic-card:hover {
    box-shadow: 
        12px 12px 24px rgba(0, 0, 0, 0.3),
        -12px -12px 24px rgba(255, 255, 255, 0.05),
        0 0 20px rgba(157, 78, 221, 0.4);
}

.neumorphic-button {
    background-color: var(--secondary-dark);
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 
        5px 5px 10px rgba(0, 0, 0, 0.3),
        -5px -5px 10px rgba(255, 255, 255, 0.03);
    color: var(--text-light);
    font-weight: 500;
    transition: all 0.2s ease;
}

.neumorphic-button:active {
    box-shadow: 
        inset 5px 5px 10px rgba(0, 0, 0, 0.3),
        inset -5px -5px 10px rgba(255, 255, 255, 0.03);
}

/* สรุปกลุ่มศิลปะ CSS */
.art-deco-border {
    position: relative;
    padding: 30px;
}

.art-deco-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border-top: 3px solid var(--accent-purple);
    border-left: 3px solid var(--accent-purple);
}

.art-deco-border::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border-bottom: 3px solid var(--accent-purple);
    border-right: 3px solid var(--accent-purple);
}

/* ปิดท้ายด้วยการเพิ่มเอฟเฟกต์ลูกเล่นปิ๊งๆ */
.sparkle-effect {
    position: relative;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: white;
    opacity: 0;
    pointer-events: none;
}

.sparkle-1 { animation: sparkle-animation 2s infinite 0.1s; }
.sparkle-2 { animation: sparkle-animation 2s infinite 0.4s; }
.sparkle-3 { animation: sparkle-animation 2s infinite 0.7s; }
.sparkle-4 { animation: sparkle-animation 2s infinite 1s; }

@keyframes sparkle-animation {
    0% { opacity: 0; transform: scale(0) translate(0, 0); }
    20% { opacity: 1; transform: scale(1) translate(5px, -5px); }
    40% { opacity: 0; transform: scale(0) translate(10px, -10px); }
    100% { opacity: 0; }
}



/* เสร็จสมบูรณ์ */