/* ==========================================================================
   ENHANCED ALERTS & PM NOTIFICATION SYSTEM - DUAL THEME
   Notifications: Dark Red Theme
   PMs: Blue Theme (original)
   ========================================================================== */

/* Base Alert Styling - Dark Red Theme */
.alert, 
.alert-row__no-alerts td,
#myalerts_alerts_modal .modal-body {
    background: linear-gradient(135deg, #1e1e2f, #2a1e1e) !important;
    color: #ff8a8a !important;
    border: 1px solid #5a3a3a !important;
    border-left: 6px solid #ff6b6b !important;
    border-bottom: 3px solid #d33 !important; /* Dark red accent */
    border-radius: 10px !important;
    padding: 14px 24px !important;
    margin: 10px 0 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.3) !important;
    animation: fadeInUp 0.5s ease forwards !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    transition: all 0.3s ease !important;
}

/* Alert Counter/Link - Dark Red Theme */
.myalerts_counter, 
.myalerts_counter a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 50px;
    padding: 6px 12px;
    min-width: 32px;
    text-align: center;
}

.myalerts_counter a {
    color: #ff8a8a !important;
    background: rgba(255, 107, 107, 0.1) !important;
    border: 1px solid rgba(255, 107, 107, 0.3) !important;
}

.myalerts_counter a.has-alerts {
    color: #ff6b6b !important;
    background: rgba(255, 107, 107, 0.2) !important;
    border: 1px solid rgba(255, 107, 107, 0.5) !important;
    animation: pulseGlow 2s infinite;
}

.myalerts_counter .alert-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ff6b6b, #d33);
    color: white !important;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(255, 107, 107, 0.3);
    border: 2px solid #1e1e2f;
}

/* New Alerts Styling - Dark Red Theme */
.alerts--new, 
.newAlerts > a {
    color: #ff6b6b !important;
    font-weight: 600;
    text-shadow: 0 0 3px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
    position: relative;
    background: rgba(255, 107, 107, 0.1) !important;
    border-left: 3px solid #d33 !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
	margin-bottom: 15px;
	text-align: center;
}

.alerts--new a, 
.newAlerts > a {
    color: #ff6b6b !important;
    text-decoration: none !important;
}

.alerts--new a:hover, 
.newAlerts > a:hover {
    background: rgba(255, 107, 107, 0.2) !important;
    transform: translateY(-1px);
}

.newAlerts > a::after {
    content: "";
    position: absolute;
    top: -2px;
    right: -8px;
    width: 6px;
    height: 6px;
    background: #d33;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* Panel Links Alert Icon - Dark Red Theme */
ul.panel_links a.myalerts {
    background: linear-gradient(135deg, #ff6b6b, #d33);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

ul.panel_links a.myalerts::before {
    content: "\f0f3";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    background: linear-gradient(135deg, #ff6b6b, #d33);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-right: 5px;
}

/* No Alerts Styling - Dark Red Theme */
.alert-row__no-alerts td {
    color: #ff8a8a !important;
    border-left: 6px solid #ff6b6b !important;
    border-bottom: 3px solid #d33 !important;
}

.alert-row__no-alerts td::before {
    content: "\f06a";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 24px;
    color: #ff6b6b;
    display: block;
    margin-bottom: 10px;
    opacity: 0.8;
}

/* Read Alert Styling - Dark Red Theme */
.alert--read.alert {
    opacity: 0.7;
    border-left: 6px solid #5a3a3a !important;
    border-bottom: 3px solid #5a3a3a !important;
}

.alert--read.alert::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    pointer-events: none;
    border-radius: var(--radius-sm);
}

/* Modal Styling - Dark Red Theme */
#myalerts_alerts_modal {
    background: linear-gradient(135deg, #1e1e2f, #2a1e1e) !important;
    border: 1px solid #5a3a3a !important;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5) !important;
}

#myalerts_alerts_modal .modal-header {
    background: linear-gradient(135deg, #1e1e2f, #2a1e1e) !important;
    color: #ff8a8a !important;
    border-bottom: 1px solid #5a3a3a !important;
}

/* Button Styling - Dark Red Theme */
.usercp_nav_myalerts,
.usercp_nav_myalerts_delete_all,
.usercp_nav_myalerts_delete_read {
    border-radius: 10px !important;
    padding: 12px 24px 12px 45px !important;
    margin: 10px 0 !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    border: 1px solid !important;
    border-bottom: 3px solid !important;
}

.usercp_nav_myalerts {
    background: linear-gradient(135deg, #1e1e2f, #2a1e1e) !important;
    color: #ff8a8a !important;
    border-color: #5a3a3a #5a3a3a #d33 !important;
    border-left: 6px solid #ff6b6b !important;
}

.usercp_nav_myalerts_delete_all {
    background: linear-gradient(135deg, #2a1e1e, #3a1e1e) !important;
    color: #ff8a8a !important;
    border-color: #5a3a3a #5a3a3a #d33 !important;
    border-left: 6px solid #ff6b6b !important;
}

.usercp_nav_myalerts_delete_read {
    background: linear-gradient(135deg, #2a1e1e, #3a2a1e) !important;
    color: #f6ad55 !important;
    border-color: #5a3a3a #5a3a3a #d33 !important;
    border-left: 6px solid #f6ad55 !important;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(255, 107, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .myalerts_counter a {
        padding: 5px 8px;
        min-width: 28px;
    }
    .myalerts_counter a::before {
        margin-right: 0;
    }
    .myalerts_counter .alert-text {
        display: none;
    }
}

/* ==========================================================================
   ALERTS CONTAINER WIDTH ADJUSTMENT
   ========================================================================== */

/* Main Alerts Modal Container */
#myalerts_alerts_modal {
    width: 550px !important;
    max-width: 95vw !important;
    min-width: 300px !important; /* Minimum width for mobile */
}

/* Alerts List Container */
#myalerts_alerts_modal .modal-body {
    width: 100% !important;
    padding: 20px !important;
    max-height: 60vh !important; /* Responsive height */
    overflow-y: auto !important;
}

/* Individual Alert Items */
#myalerts_alerts_modal .alert {
    width: calc(100% - 48px) !important; /* Account for padding */
    min-width: 0 !important; /* Reset minimum width */
    white-space: normal !important; /* Allow text wrapping */
    word-wrap: break-word !important; /* Break long words */
    overflow-wrap: break-word !important; /* Modern alternative */
    margin: 10px auto !important; /* Center alerts */
}

/* Alert Content */
#myalerts_alerts_modal .alert .alert_content {
    width: 100% !important;
    display: inline-block !important;
}

/* Alert Date/Time */
#myalerts_alerts_modal .alert .alert_date {
    white-space: nowrap !important; /* Keep date on one line */
    display: inline-block !important;
    margin-left: 10px !important;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    #myalerts_alerts_modal {
        width: 95vw !important;
        margin: 10px auto !important;
    }
    
    #myalerts_alerts_modal .alert {
        width: calc(100% - 20px) !important;
        padding: 12px 10px !important;
    }
}

/* Prevent text wrapping in important elements */
#myalerts_alerts_modal .alert_subject,
#myalerts_alerts_modal .alert_from {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    max-width: 100% !important;
}
/* Center the alerts--new link with 300px width */
.alerts--new {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 10px auto !important; /* Centers horizontally */
    width: 300px !important; /* Fixed width */
    max-width: 100%; /* Ensures responsiveness */
    text-align: center !important;
    padding: 8px 0 !important; /* Adjust padding as needed */
    background: rgba(255, 107, 107, 0.1) !important; /* Your red theme */
    border-left: 3px solid #d33 !important;
    border-radius: 6px !important;
    box-sizing: border-box !important; /* Ensures padding doesn't affect width */
}

/* Style the link inside */
.alerts--new a {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important; /* Takes full width of parent */
    color: #ff6b6b !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    gap: 8px !important; /* Space between icon & text */
}

/* Mobile responsiveness */
@media (max-width: 400px) {
    .alerts--new {
        width: 280px !important; /* Slightly smaller on mobile */
    }
}

/* COMPLETELY HIDE ALERTS LINK IF USER HAS NO ALERTS */
.myalerts_counter:not(.has-alerts) {
    display: none !important;
}

/* Style only when alerts exist (keeps your red theme) */
.myalerts_counter.has-alerts {
    display: flex !important;
    justify-content: center !important;
    width: 300px !important;
    margin: 0 auto !important;
    padding: 8px 0 !important;
    background: rgba(255, 107, 107, 0.1) !important;
    border-left: 3px solid #d33 !important;
    border-radius: 6px !important;
    animation: pulseGlow 2s infinite !important;
}

/* Alert link styling */
.myalerts_counter.has-alerts a {
    display: inline-flex !important;
    align-items: center !important;
    color: #ff6b6b !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    gap: 8px !important;
}