/* สไตล์สำหรับดรอปดาวน์ผู้ใช้ */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 8px;
    padding: 10px 0;
    margin-top: 10px;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    right: 10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid white;
}

.dropdown-menu a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background 0.3s;
    text-align: left;
    margin-left: 0;
}

.dropdown-menu a:hover {
    background-color: #f1f1f1;
    color: #FF8C00;
}

.dropdown-menu a i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}
/* เพิ่ม CSS สำหรับการแสดงชื่อผู้ใช้ */
.user-greeting {
    padding: 12px 16px;
    background-color: #f8f8f8;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.user-name {
    font-weight: 600;
    color: #FF8C00;
    font-size: 14px;
}

.dropdown-divider {
    height: 1px;
    margin: 0;
    background-color: #eee;
}
/* สไตล์สำหรับการแจ้งเตือน */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    min-width: 280px;
    background-color: white;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-20px);
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 16px;
}

.notification-icon {
    margin-right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon i {
    color: white;
    font-size: 14px;
}

.notification-message {
    flex-grow: 1;
    font-size: 14px;
}

.notification-message strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.notification-message span {
    color: #666;
}

.notification-success {
    border-left: 4px solid #4CAF50;
}

.notification-error {
    border-left: 4px solid #f44336;
}

.notification-info {
    border-left: 4px solid #2196F3;
}

.notification-warning {
    border-left: 4px solid #FF9800;
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background-color: #eee;
}

.notification-progress-bar {
    height: 100%;
    background-color: #4CAF50;
    width: 100%;
}
/* เพิ่มโค้ดนี้ต่อท้ายไฟล์ user-dropdown.css */

/* สำหรับอุปกรณ์มือถือ - ปรับตำแหน่ง dropdown ให้แสดงด้านบน */
@media (max-width: 768px) {
    .user-dropdown {
        position: relative;
    }
    
    .dropdown-menu {
        /* เปลี่ยนตำแหน่งจากด้านล่างเป็นด้านบน */
        bottom: 100%;
        top: auto;
        right: 0;
        margin-top: 0;
        margin-bottom: 10px; /* ระยะห่างจากปุ่ม */
    }
    
    /* เปลี่ยนลูกศรชี้ให้ชี้ลงแทน */
    .dropdown-menu::before {
        content: '';
        position: absolute;
        top: auto;
        bottom: -10px;
        right: 10px;
        width: 0;
        height: 0;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid white; /* เปลี่ยนเป็น border-top จาก border-bottom */
        border-bottom: none;
    }
    
    /* เพิ่มขนาดปุ่มในโหมดมือถือให้กดง่ายขึ้น */
    .dropdown-menu a {
        padding: 15px 16px;
        font-size: 16px;
    }
    
    /* ปรับขนาดไอคอนให้ใหญ่ขึ้นเพื่อง่ายต่อการกด */
    .dropdown-menu a i {
        font-size: 18px;
        width: 20px;
    }
    
    /* เพิ่มความกว้างของเมนูในโหมดมือถือ */
    .dropdown-menu {
        min-width: 200px;
    }
}

/* เพิ่มการตรวจสอบตำแหน่งเพื่อปรับเปลี่ยนโดยอัตโนมัติ */
@media (max-width: 768px) {
    /* เพิ่ม JavaScript เพื่อตรวจสอบตำแหน่งและปรับเปลี่ยนคลาส */
    /* (จะถูกใช้โดย JavaScript ที่เราจะเพิ่ม) */
    .dropdown-menu.top-position {
        bottom: 100%;
        top: auto;
        margin-top: 0;
        margin-bottom: 10px;
    }
    
    .dropdown-menu.bottom-position {
        top: 100%;
        bottom: auto;
        margin-bottom: 0;
        margin-top: 10px;
    }
}