/**
 * DoliSMS Notifications - Styles CSS
 * Topbar badge + dropdown styling
 * Compatible with Dolibarr themes (Eldy, MD)
 */

/* ==========================================================================
   Badge & Icon Styles
   ========================================================================== */

.dolisms-notification-icon {
    font-size: 16px;
    transition: color 0.3s ease;
}

.dolisms-notification-icon.text-success {
    color: #4CAF50 !important;
}

#dolisms-notification-badge {
    background-color: var(--colortextbackvmenu, #4CAF50);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
    min-width: 18px;
    text-align: center;
    display: inline-block;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* ==========================================================================
   Dropdown Menu Styles
   ========================================================================== */

#dolisms-menu-dropdown .dropdown-menu {
    min-width: 350px;
    max-width: 400px;
    border: 1px solid var(--colortopbordertitle1, #ddd);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-radius: 4px;
    overflow: hidden;
}

.dolisms-dropdown-header {
    padding: 12px 15px;
    background: var(--colorbackhmenu1, #3498db);
    color: var(--colortextbackhmenu, white);
    text-align: center;
    border-bottom: 1px solid var(--colortopbordertitle1, #2980b9);
}

.dolisms-dropdown-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--colortextbackhmenu, white);
}

.dolisms-dropdown-header i {
    margin-right: 5px;
}

#dolisms-dropdown-body {
    background: var(--colorbackbody, white);
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

#dolisms-dropdown-body::-webkit-scrollbar {
    width: 8px;
}

#dolisms-dropdown-body::-webkit-scrollbar-track {
    background: var(--colorbacklineimpair2, #f1f1f1);
}

#dolisms-dropdown-body::-webkit-scrollbar-thumb {
    background: var(--colortexttitlenotab, #888);
    border-radius: 4px;
}

#dolisms-dropdown-body::-webkit-scrollbar-thumb:hover {
    background: var(--colortexttitle, #555);
}

/* ==========================================================================
   Notification Item Styles
   ========================================================================== */

.dolisms-notif-item {
    padding: 10px;
    border-bottom: 1px solid var(--colortopbordertitle1, #eee);
    cursor: pointer;
    transition: background-color 0.2s ease;
    background: var(--colorbackbody, white);
}

.dolisms-notif-item:hover {
    background-color: var(--colorbacklinepairhover, #f8f9fa);
}

.dolisms-notif-item:last-child {
    border-bottom: none;
}

.dolisms-notif-item > div:first-child {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--colortexttitlenotab, #333);
}

.dolisms-notif-item > div:nth-child(2) {
    font-size: 12px;
    color: var(--colortext, #666);
    margin-bottom: 5px;
    line-height: 1.4;
}

.dolisms-notif-item > div:last-child {
    font-size: 11px;
    color: var(--colortextbackhmenu, #999);
}

.dolisms-notif-item small {
    font-weight: normal;
    color: var(--colortextbackhmenu, #888);
}

/* Empty state */
#dolisms-dropdown-body > div {
    text-align: center;
    color: var(--colortextbackhmenu, #999);
    padding: 20px;
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */

.dolisms-dropdown-footer {
    background: var(--colorbacklineimpair2, #f8f9fa);
    padding: 10px 15px;
    border-top: 1px solid var(--colortopbordertitle1, #eee);
    text-align: center;
}

.dolisms-dropdown-footer .button-top-menu-dropdown {
    background-color: var(--butactionbg, #3498db);
    color: var(--colortextbackhmenu, white);
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    border: 1px solid var(--butactionbg, #3498db);
}

.dolisms-dropdown-footer .button-top-menu-dropdown:hover {
    background-color: var(--colorbackhmenu1, #2980b9);
    text-decoration: none;
    border-color: var(--colorbackhmenu1, #2980b9);
}

.dolisms-dropdown-footer .button-top-menu-dropdown i {
    margin-right: 5px;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.dolisms-loading {
    text-align: center;
    padding: 20px;
    color: var(--colortextbackhmenu, #999);
}

.dolisms-loading i {
    font-size: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    #dolisms-menu-dropdown .dropdown-menu {
        min-width: 300px;
        max-width: calc(100vw - 40px);
    }
    
    #dolisms-dropdown-body {
        max-height: 300px;
    }
}

/* ==========================================================================
   Theme Compatibility (Eldy vs MD)
   ========================================================================== */

/* Eldy theme adjustments */
body.eldy #dolisms-menu-dropdown .dropdown-menu {
    border-color: var(--colortopbordertitle1, #ccc);
}

body.eldy .dolisms-dropdown-header {
    background: #4d90fe;
}

/* MD theme adjustments */
body.md #dolisms-menu-dropdown .dropdown-menu {
    border-radius: 8px;
}

body.md .dolisms-dropdown-header {
    border-radius: 8px 8px 0 0;
}

/* ==========================================================================
   Print Styles (hide notifications when printing)
   ========================================================================== */

@media print {
    #dolisms-menu-dropdown {
        display: none !important;
    }
}