/**
 * WHMCS ClientArea Notification - Lagom 2 Style CSS
 * Version: 1.0.2
 */

:root {
    --can-primary: #2563eb;
    --can-primary-hover: #1d4ed8;
    --can-header-bg: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    --can-badge-bg: #ef4444;
    --can-bell-color: #2563eb;
    --can-bell-bottom: 95px;
    --can-bell-side: 28px;
    --can-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --can-card-bg: #ffffff;
    --can-card-border: #e2e8f0;
    --can-text-main: #1e293b;
    --can-text-muted: #64748b;
    --can-radius: 16px;
    --can-btn-radius: 8px;
    --can-btn-bg: #2563eb;
    --can-btn-color: #ffffff;
    --can-font-size-title: 15px;
    --can-font-size-body: 13.5px;
}

/* ==========================================================================
   1. Floating Bell Widget
   ========================================================================== */
.can-bell-wrapper {
    position: fixed;
    z-index: 99998;
    font-family: var(--can-font-family);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.can-bell-wrapper.pos-bottom-right {
    bottom: var(--can-bell-bottom, 95px);
    right: var(--can-bell-side, 28px);
}

.can-bell-wrapper.pos-bottom-left {
    bottom: var(--can-bell-bottom, 95px);
    left: var(--can-bell-side, 28px);
}

.can-bell-wrapper.pos-top-right {
    top: 90px;
    right: var(--can-bell-side, 28px);
}

.can-bell-btn {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--can-bell-color);
    border: none;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    transition: all 0.3s ease;
}

.can-bell-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 20px 30px -10px rgba(37, 99, 235, 0.3);
}

.can-bell-btn svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.can-bell-btn:hover svg {
    transform: rotate(15deg);
}

/* Bell Badge */
.can-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--can-badge-bg);
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 0 0 3px #ffffff, 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: canPulse 2s infinite;
}

@keyframes canPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7), 0 0 0 3px #ffffff;
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0), 0 0 0 3px #ffffff;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 0 0 3px #ffffff;
    }
}

.can-bell-btn.can-has-unread svg {
    animation: canSwing 2.5s ease-in-out infinite;
    transform-origin: top center;
}

@keyframes canSwing {
    0%, 50%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(14deg); }
    20%, 40% { transform: rotate(-14deg); }
}

/* ==========================================================================
   2. Modal / Slideout Drawer (Matches Reference UI)
   ========================================================================== */
.can-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.can-backdrop.can-show {
    opacity: 1;
    visibility: visible;
}

.can-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -46%) scale(0.96);
    width: 92%;
    max-width: 520px;
    max-height: 88vh;
    background: #ffffff;
    border-radius: var(--can-radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    font-family: var(--can-font-family);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.can-modal.can-show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal Header - Blue Gradient Banner */
.can-modal-header {
    position: relative;
    padding: 24px 26px;
    background: var(--can-header-bg);
    color: #ffffff;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.can-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

.can-modal-subtitle {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: #dbeafe;
    line-height: 1.45;
}

/* Circular Close Button */
.can-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.can-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.08);
}

/* Modal Body / Notification List */
.can-modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    max-height: 58vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f8fafc;
}

.can-modal-body::-webkit-scrollbar {
    width: 6px;
}

.can-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* ==========================================================================
   3. Notification Cards & Pills
   ========================================================================== */
.can-card {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 18px;
    background: #ffffff;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.can-card:hover {
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.can-card-tags-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.can-tag-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 10px !important;
    border-radius: 20px !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
}

.can-tag-pill svg {
    width: 13px !important;
    height: 13px !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
}

.can-tag-pill.pill-blue {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #dbeafe !important;
}

.can-tag-pill.pill-service {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #e2e8f0 !important;
}

.can-pill {
    display: inline-flex !important;
    align-items: center !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-left: auto !important;
}

.can-pill.pill-critical {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.can-pill.pill-danger {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

.can-pill.pill-warning {
    background: #fef3c7 !important;
    color: #92400e !important;
}

.can-pill.pill-info {
    background: #dbeafe !important;
    color: #1e40af !important;
}

.can-card-title {
    font-size: var(--can-font-size-title);
    font-weight: 700;
    color: var(--can-text-main);
    line-height: 1.35;
    margin: 0;
}

.can-card-message {
    font-size: var(--can-font-size-body);
    color: #334155;
    line-height: 1.55;
    margin: 0;
}

.can-card-message strong,
.can-card-message b {
    font-weight: 700;
    color: #0f172a;
}

.can-card-title strong,
.can-card-title b {
    font-weight: 800;
    color: #0f172a;
}

.can-card-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-top: 4px !important;
    padding-top: 12px !important;
    border-top: 1px dashed #e2e8f0 !important;
    gap: 12px !important;
}

.can-card-meta {
    font-size: 12px;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.can-card-meta svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Card Action Button - Ultra Resilient Styling */
div.can-card a.can-card-btn,
a.can-card-btn,
button.can-card-btn,
.can-card-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--can-btn-bg, #2563eb) !important;
    background-color: var(--can-btn-bg, #2563eb) !important;
    color: var(--can-btn-color, #ffffff) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    border-radius: var(--can-btn-radius, 8px) !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
    line-height: 1.3 !important;
    box-sizing: border-box !important;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25) !important;
    outline: none !important;
    text-align: center !important;
    height: auto !important;
    min-height: 36px !important;
    padding: 8px 18px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
}

div.can-card a.can-card-btn.btn-sm,
a.can-card-btn.btn-sm,
.can-card-btn.btn-sm {
    padding: 6px 14px !important;
    font-size: 12px !important;
    min-height: 30px !important;
}

div.can-card a.can-card-btn.btn-md,
a.can-card-btn.btn-md,
.can-card-btn.btn-md {
    padding: 8px 18px !important;
    font-size: 13px !important;
    min-height: 36px !important;
}

div.can-card a.can-card-btn.btn-lg,
a.can-card-btn.btn-lg,
.can-card-btn.btn-lg {
    padding: 10px 22px !important;
    font-size: 14px !important;
    min-height: 42px !important;
}

div.can-card a.can-card-btn:hover,
a.can-card-btn:hover,
.can-card-btn:hover {
    filter: brightness(1.1) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
    color: var(--can-btn-color, #ffffff) !important;
    background-color: var(--can-btn-bg, #2563eb) !important;
}

div.can-card a.can-card-btn:active,
a.can-card-btn:active,
.can-card-btn:active {
    transform: translateY(0) !important;
}

div.can-card a.can-card-btn > span,
a.can-card-btn > span,
.can-card-btn > span {
    color: inherit !important;
    background: transparent !important;
    display: inline !important;
    line-height: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

/* Secondary Button (for High Renewal TLD 'Register New Domain') */
div.can-card a.can-card-btn-secondary,
a.can-card-btn-secondary,
button.can-card-btn-secondary,
.can-card-btn-secondary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: var(--can-btn-bg, #2563eb) !important;
    border: 1.5px solid var(--can-btn-bg, #2563eb) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    border-radius: var(--can-btn-radius, 8px) !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
    line-height: 1.3 !important;
    box-sizing: border-box !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    outline: none !important;
    text-align: center !important;
    height: auto !important;
    min-height: 36px !important;
    padding: 7px 16px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
}

div.can-card a.can-card-btn-secondary.btn-sm,
a.can-card-btn-secondary.btn-sm,
.can-card-btn-secondary.btn-sm {
    padding: 5px 12px !important;
    font-size: 12px !important;
    min-height: 30px !important;
}

div.can-card a.can-card-btn-secondary.btn-md,
a.can-card-btn-secondary.btn-md,
.can-card-btn-secondary.btn-md {
    padding: 7px 16px !important;
    font-size: 13px !important;
    min-height: 36px !important;
}

div.can-card a.can-card-btn-secondary.btn-lg,
a.can-card-btn-secondary.btn-lg,
.can-card-btn-secondary.btn-lg {
    padding: 9px 20px !important;
    font-size: 14px !important;
    min-height: 42px !important;
}

div.can-card a.can-card-btn-secondary:hover,
a.can-card-btn-secondary:hover,
.can-card-btn-secondary:hover {
    background: #eff6ff !important;
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15) !important;
}

div.can-card a.can-card-btn-secondary:active,
a.can-card-btn-secondary:active,
.can-card-btn-secondary:active {
    transform: translateY(0) !important;
}

div.can-card a.can-card-btn-secondary > span,
a.can-card-btn-secondary > span,
.can-card-btn-secondary > span {
    color: inherit !important;
    background: transparent !important;
    display: inline !important;
    line-height: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

.can-card-actions {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    flex-shrink: 0 !important;
}

div.can-card .can-card-actions a.can-card-btn,
div.can-card .can-card-actions button.can-card-btn,
div.can-card .can-card-actions .can-card-btn,
div.can-card .can-card-actions a.can-card-btn-secondary,
div.can-card .can-card-actions button.can-card-btn-secondary,
div.can-card .can-card-actions .can-card-btn-secondary {
    padding: 6px 13px !important;
    font-size: 12px !important;
    min-height: 32px !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* High Renewal TLD Advisory Callout */
.can-advisory-box {
    margin-top: 10px;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-sizing: border-box;
}

.can-advisory-icon {
    width: 16px;
    height: 16px;
    color: #d97706;
    flex-shrink: 0;
    margin-top: 2px;
}

.can-advisory-text {
    font-size: 12.5px;
    line-height: 1.45;
    color: #78350f;
}

.can-advisory-text strong,
.can-advisory-text b {
    color: #451a03;
    font-weight: 700;
}

/* Empty State */
.can-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
}

.can-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f0fdf4;
    color: #16a34a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.can-empty-icon svg {
    width: 32px;
    height: 32px;
}

.can-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
}

.can-empty-desc {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

/* Modal Footer with Dual Actions (Matches Screenshot Layout) */
.can-modal-footer {
    padding: 16px 24px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.can-btn-ask-later {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--can-btn-radius, 8px);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.3;
    outline: none;
}

.can-btn-ask-later:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.can-btn-primary-action {
    flex: 1.5 !important;
    background: var(--can-btn-bg, #2563eb) !important;
    background-color: var(--can-btn-bg, #2563eb) !important;
    border: none !important;
    color: var(--can-btn-color, #ffffff) !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    padding: 10px 20px !important;
    min-height: 42px !important;
    border-radius: var(--can-btn-radius, 8px) !important;
    cursor: pointer !important;
    text-align: center !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    white-space: nowrap !important;
    line-height: 1.3 !important;
    box-sizing: border-box !important;
    outline: none !important;
}

.can-btn-primary-action:hover {
    filter: brightness(1.08) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3) !important;
    color: var(--can-btn-color, #ffffff) !important;
    transform: translateY(-1px) !important;
}

.can-btn-primary-action:active {
    transform: translateY(0) !important;
}

.can-btn-primary-action > span {
    color: inherit !important;
    background: transparent !important;
    display: inline !important;
    line-height: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

/* ==========================================================================
   4. Mobile Adjustments
   ========================================================================== */
@media (max-width: 640px) {
    .can-modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: translateY(100%);
    }

    .can-modal.can-show {
        transform: translateY(0);
    }

    .can-bell-wrapper.pos-bottom-right,
    .can-bell-wrapper.pos-bottom-left {
        bottom: var(--can-bell-bottom, 80px);
        right: var(--can-bell-side, 18px);
    }
}
