/** {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    color: white;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

header h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
    background-color: white;
    border-radius: 15px;
    margin-bottom: 3rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #182848;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #666;
}

.btn {
    display: inline-block;
    background: linear-gradient(to right, #4b6cb7, #182848);
    color: white;
    padding: 0.8rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(75, 108, 183, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(75, 108, 183, 0.4);
}

.features {
    padding: 3rem 0;
}

.features h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: #182848;
    font-size: 2.2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-10px);
}

.feature i {
    font-size: 3rem;
    color: #4b6cb7;
    margin-bottom: 1.5rem;
}

.feature h3 {
    margin-bottom: 1rem;
    color: #182848;
}

footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    color: #666;
    border-top: 1px solid #eaeaea;
}
*/
/* Popup Styles */
.popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.popup-content {
    background-color: white;
    width: 90%;
    max-width: 500px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.popup-header {
    background: linear-gradient(to right, #4b6cb7, #182848);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    margin: 0;
    font-weight: 500;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.popup-body {
    padding: 1.5rem;
}

.popup-image {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
}

.popup-image img {
    width: 100%;
    height: auto;
    display: block;
}

.popup-text {
    color: #555;
    line-height: 1.8;
}

.popup-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.dont-show {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 2rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .popup-content {
        width: 95%;
    }
    
    .popup-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .popup-footer .btn {
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* เพิ่มสไตล์สำหรับหลายป๊อปอัป */

/* ลบหรือปรับสไตล์ overlay background เดิม */

/* เพิ่มสไตล์สำหรับหลายป๊อปอัป (ไม่มี overlay) */

#popupContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.popup-modal {
    position: absolute;
    width: 500px;
    max-width: 90vw;
    pointer-events: auto;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
    /* ลบ background */
    background: none;
    /* ลบ backdrop-filter */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.popup-content {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid #e0e0e0;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: move;
}

.popup-content:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.popup-content.dragging {
    cursor: grabbing;
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.popup-header {
    background: linear-gradient(to right, #4b6cb7, #182848);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
    border-top-left-radius: 11px;
    border-top-right-radius: 11px;
}

.popup-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.popup-title h3 {
    margin: 0;
    font-weight: 500;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.popup-badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 24px;
    text-align: center;
}

.popup-actions {
    display: flex;
    gap: 0.5rem;
}

.popup-minimize, .popup-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1rem;
}

.popup-minimize:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.popup-close:hover {
    background-color: rgba(220, 53, 69, 0.8);
}

.popup-body {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.popup-text {
    color: #555;
    line-height: 1.8;
}

.popup-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.popup-footer-left, .popup-footer-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.dont-show-single {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
}

.popup-timer {
    font-size: 0.85rem;
    color: #888;
    background-color: #f8f9fa;
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    border: 1px solid #e9ecef;
}

.timer-count {
    font-weight: 600;
    color: #182848;
}

.popup-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, #4b6cb7 50%);
    border-bottom-right-radius: 12px;
}

.popup-controls {
    background-color: white;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.control-info {
    color: #666;
    font-size: 0.95rem;
}

.control-info #popupCount {
    font-weight: 600;
    color: #4b6cb7;
}

.global-popup-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9998;
}

.global-control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4b6cb7, #182848);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    position: relative;
}

.global-control-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.global-control-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-minimized .popup-body,
.popup-minimized .popup-footer {
    display: none;
}

.popup-minimized .popup-content {
    height: auto;
}

.popup-minimized .popup-header {
    padding: 0.75rem 1.5rem;
}

.popup-minimized .popup-title h3 {
    font-size: 1rem;
}

.popup-stack {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 9997;
    display: flex;
    flex-direction: column-reverse;
    gap: 5px;
}

.stack-item {
    width: 200px;
    background-color: white;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid #4b6cb7;
}

.stack-item:hover {
    transform: translateX(-10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.stack-item h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    color: #182848;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stack-item p {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Overlay Background (ถ้าต้องการให้เปิดใช้งานได้) */
.overlay-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9990;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.overlay-background.active {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .popup-modal {
        width: 90vw !important;
        left: 5vw !important;
        top: 20px !important;
    }
    
    .popup-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .popup-footer-left, .popup-footer-right {
        justify-content: center;
    }
    
    .global-popup-controls {
        bottom: 20px;
        right: 20px;
    }
    
    .global-control-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

/* Animation for popup entrance */
@keyframes popupEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-modal.showing {
    animation: popupEntrance 0.4s ease forwards;
}

/* Animation for popup without overlay */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}

/* เพิ่มสไตล์สำหรับป๊อปอัปแบบโปร่งใส */
.popup-transparent .popup-content {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* เพิ่มเงาให้ป๊อปอัปเด่นชัดขึ้น */
.popup-content {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 
                0 5px 15px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* เพิ่มเส้นขอบให้เด่นชัด */
.popup-content {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* เพิ่มสไตล์สำหรับปุ่มปิดให้เด่นชัด */
.popup-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
    font-weight: bold;
}

.popup-close:hover {
    background-color: rgba(220, 53, 69, 0.9);
    transform: scale(1.1);
}

.close-popup-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.close-popup-btn:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* ทำให้ปุ่ม responsive */
@media (max-width: 768px) {
    .popup-close {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
    }
    
    .close-popup-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* เพิ่มสไตล์เมื่อ hover บนป๊อปอัป */
.popup-content:hover .popup-close {
    opacity: 1;
}

/* ตรวจสอบให้แน่ใจว่าปุ่มสามารถคลิกได้ */
button, .btn {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* ป้องกันไม่ให้เนื้อหาป๊อปอัปบล็อกการคลิกปุ่ม */
.popup-header, .popup-footer {
    pointer-events: auto;
}

