/* ============================================================
   RESI COMUNICA v1.1.0 — Client Styles
   ============================================================ */

/* ─── TICKER ──────────────────────────────────────────────── */
#resi-ticker-wrap {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    padding: 8px 0;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.resi-ticker-label {
    background: #e74c3c;
    color: #fff;
    padding: 5px 16px;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 1px;
    border-radius: 0 4px 4px 0;
    margin-right: 12px;
}
.resi-ticker-container { overflow: hidden; flex: 1; }
.resi-ticker-content {
    display: inline-block;
    white-space: nowrap;
    animation: resiTickerScroll linear infinite;
    font-size: 13px;
    padding-right: 40px;
}
@keyframes resiTickerScroll {
    from { transform: translateX(100%); }
    to   { transform: translateX(-50%); }
}

/* ─── DASHBOARD WIDGET ────────────────────────────────────── */
#resi-comunica-dashboard-widget {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    margin-bottom: 24px;
    overflow: hidden;
}
.resi-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: #fff;
}
.resi-widget-title { font-weight: 600; font-size: 14px; }
.resi-widget-title i { margin-right: 6px; color: #f1c40f; }
.resi-widget-link { color: rgba(255,255,255,.85); font-size: 12px; text-decoration: none; transition: color .2s; }
.resi-widget-link:hover { color: #fff; text-decoration: none; }
.resi-widget-posts { padding: 0; }

.resi-widget-post {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
    transition: background .15s;
}
.resi-widget-post:hover { background: #fafbfc; }
.resi-widget-post:last-child { border-bottom: none; }
.resi-post-img {
    width: 80px; flex-shrink: 0;
    background-size: cover; background-position: center;
}
.resi-post-body { padding: 14px 16px; flex: 1; min-width: 0; }
.resi-post-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.resi-post-icon { font-size: 14px; }
.resi-pin-tag    { font-size: 10px; background: #fef9e7; color: #f39c12; padding: 1px 7px; border-radius: 10px; font-weight: 600; }
.resi-urgent-tag { font-size: 10px; background: #fadbd8; color: #e74c3c; padding: 1px 7px; border-radius: 10px; font-weight: 600; }
.resi-post-title { font-size: 14px; font-weight: 600; margin: 0 0 4px; color: #2c3e50; overflow: hidden; text-overflow: ellipsis; }
.resi-post-content { font-size: 12px; color: #7f8c8d; margin: 0 0 6px; line-height: 1.5; }
.resi-post-date { font-size: 11px; color: #aaa; }

.resi-post-urgent  { border-left: 3px solid #e74c3c; }
.resi-post-high    { border-left: 3px solid #e67e22; }
.resi-post-medium  { border-left: 3px solid #3498db; }
.resi-post-low     { border-left: 3px solid #95a9a6; }
.resi-post-pinned  { background: #fffef0; }

/* ─── POPUP URGENT ────────────────────────────────────────── */
.resi-popup-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.6);
    z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    animation: resiPopupIn .3s ease;
}
@keyframes resiPopupIn {
    from { opacity: 0; transform: scale(.95); }
    to   { opacity: 1; transform: scale(1); }
}
.resi-popup-box {
    background: #fff;
    border-radius: 14px;
    width: 90%; max-width: 460px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.resi-popup-header {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}
.resi-popup-icon { font-size: 24px; }
.resi-popup-header h3 { margin: 0; flex: 1; font-size: 16px; }
.resi-popup-close {
    background: none; border: none; color: rgba(255,255,255,.8);
    font-size: 24px; cursor: pointer; line-height: 1;
    transition: color .15s;
}
.resi-popup-close:hover { color: #fff; }
.resi-popup-body { padding: 20px; }
.resi-popup-img { width: 100%; border-radius: 8px; margin-bottom: 14px; }
.resi-popup-body h4 { margin: 0 0 10px; font-size: 17px; color: #2c3e50; }
.resi-popup-body p { color: #555; line-height: 1.6; margin: 0 0 10px; }
.resi-popup-footer { padding: 0 20px 20px; }

/* ─── CHATBOT FLOTANTE ─────────────────────────────────────── */
#resi-chatbot {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#resi-chatbot-btn {
    width: 58px; height: 58px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(52,152,219,.5);
    transition: transform .2s, box-shadow .2s;
    position: relative;
}
#resi-chatbot-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(52,152,219,.6);
}
#resi-chatbot-btn i { color: #fff; font-size: 22px; }
.resi-chat-badge {
    position: absolute; top: -4px; right: -4px;
    background: #e74c3c; color: #fff;
    min-width: 20px; height: 20px;
    border-radius: 10px; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
    animation: resiBadgePulse 2s ease infinite;
}
@keyframes resiBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.resi-chatbot-panel {
    position: absolute;
    bottom: 72px; right: 0;
    width: 360px; height: 500px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
    flex-direction: column;
    overflow: hidden;
    animation: resiChatSlideIn .25s ease;
}
@keyframes resiChatSlideIn {
    from { opacity: 0; transform: translateY(16px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.resi-chat-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: #fff;
    flex-shrink: 0;
}
.resi-chat-avatar {
    width: 38px; height: 38px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.resi-chat-info { flex: 1; }
.resi-chat-info strong { display: block; font-size: 14px; }
.resi-chat-status { font-size: 11px; opacity: .85; display: flex; align-items: center; gap: 5px; }
.resi-status-dot { width: 7px; height: 7px; background: #2ecc71; border-radius: 50%; }
.resi-chat-close {
    background: none; border: none; color: rgba(255,255,255,.7);
    font-size: 22px; cursor: pointer; line-height: 1;
    transition: color .15s;
}
.resi-chat-close:hover { color: #fff; }

.resi-chat-messages {
    flex: 1; overflow-y: auto; padding: 14px;
    display: flex; flex-direction: column; gap: 10px;
    background: #f8f9fb;
}

.resi-msg { display: flex; }
.resi-msg-bot { justify-content: flex-start; }
.resi-msg-user { justify-content: flex-end; }

.resi-msg-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}
.resi-msg-bot .resi-msg-bubble {
    background: #fff;
    color: #2c3e50;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.resi-msg-user .resi-msg-bubble {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.resi-quick-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.resi-quick-btn {
    background: #fff; border: 1px solid #e8ecf0;
    border-radius: 20px; padding: 6px 14px;
    font-size: 12px; cursor: pointer; transition: all .15s;
    color: #2c3e50; font-family: inherit;
    white-space: nowrap;
}
.resi-quick-btn:hover { background: #3498db; color: #fff; border-color: #3498db; }
.resi-qb-alert:hover  { background: #e74c3c; border-color: #e74c3c; }
.resi-qb-event:hover  { background: #27ae60; border-color: #27ae60; }
.resi-qb-pay:hover    { background: #f39c12; border-color: #f39c12; }

.resi-chat-post-card {
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    border-left: 3px solid #3498db;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    max-width: 270px;
}
.resi-chat-post-img { width: 100%; border-radius: 5px; margin-bottom: 8px; max-height: 120px; object-fit: cover; display: block; }
.resi-chat-post-content strong { display: block; font-size: 13px; color: #2c3e50; margin-bottom: 4px; }
.resi-chat-post-content p { font-size: 12px; color: #7f8c8d; margin: 0 0 4px; line-height: 1.4; }
.resi-chat-post-content small { color: #aaa; font-size: 11px; }

.resi-chat-input-wrap {
    display: flex; align-items: center;
    padding: 10px 12px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}
.resi-chat-input {
    flex: 1; border: 1px solid #e8ecf0; border-radius: 20px;
    padding: 9px 14px; font-size: 13px; outline: none;
    transition: border-color .15s; font-family: inherit;
    background: #f8f9fb;
}
.resi-chat-input:focus { border-color: #3498db; background: #fff; }
.resi-chat-send {
    margin-left: 8px; width: 36px; height: 36px;
    background: #3498db; border: none; border-radius: 50%;
    color: #fff; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: background .15s; flex-shrink: 0;
}
.resi-chat-send:hover { background: #2980b9; }

/* ─── NOTICEBOARD ─────────────────────────────────────────── */
#resi-noticeboard { padding: 10px 0; }
.resi-nb-header { margin-bottom: 20px; }
.resi-nb-header h2 { font-size: 20px; color: #2c3e50; font-weight: 700; }
.resi-nb-header h2 i { color: #3498db; margin-right: 8px; }

.resi-nb-empty { text-align: center; padding: 60px 20px; color: #aaa; }
.resi-nb-empty i { display: block; margin-bottom: 16px; color: #ddd; }

.resi-nb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.resi-nb-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    border-top: 3px solid #e8ecf0;
    transition: transform .2s, box-shadow .2s;
}
.resi-nb-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.resi-nb-urgent { border-top-color: #e74c3c; }
.resi-nb-high   { border-top-color: #e67e22; }
.resi-nb-medium { border-top-color: #3498db; }
.resi-nb-low    { border-top-color: #95a9a6; }
.resi-nb-pinned { background: #fffef0; }

.resi-nb-image {
    height: 160px;
    background-size: cover; background-position: center;
    position: relative;
}
.resi-nb-type-badge {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,.5); border-radius: 20px;
    padding: 3px 10px; font-size: 14px; color: #fff;
}
.resi-nb-no-image {
    height: 80px;
    background: linear-gradient(135deg, #f8f9fb, #ecf0f1);
    display: flex; align-items: center; justify-content: center;
}
.resi-nb-big-icon { font-size: 36px; }

.resi-nb-body { padding: 16px; }
.resi-nb-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.resi-tag {
    font-size: 10px; font-weight: 700; padding: 2px 8px;
    border-radius: 10px; text-transform: uppercase; letter-spacing: .4px;
}
.resi-tag-pin    { background: #fef9e7; color: #f39c12; }
.resi-tag-urgent { background: #fadbd8; color: #e74c3c; }
.resi-tag-high   { background: #fdebd0; color: #e67e22; }
.resi-nb-date { font-size: 11px; color: #aaa; margin-left: auto; }

.resi-nb-title { font-size: 16px; font-weight: 700; color: #2c3e50; margin: 0 0 8px; line-height: 1.4; }
.resi-nb-content { font-size: 13px; color: #555; line-height: 1.6; margin-bottom: 12px; }

/* Comments */
.resi-nb-comments { border-top: 1px solid #f0f0f0; margin-top: 12px; padding-top: 12px; }
.resi-nb-comments-title { font-size: 12px; font-weight: 600; color: #7f8c8d; margin-bottom: 10px; }
.resi-nb-comment { padding: 8px 0; border-bottom: 1px solid #f8f8f8; }
.resi-nb-comment strong { font-size: 12px; color: #2c3e50; display: block; margin-bottom: 2px; }
.resi-nb-comment p { font-size: 13px; color: #555; margin: 0 0 2px; }
.resi-nb-comment small { color: #aaa; font-size: 11px; }
.resi-nb-add-comment { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.resi-comment-input { flex: 1; border-radius: 20px !important; font-size: 13px; }
.resi-comment-btn { border-radius: 50% !important; width: 34px; height: 34px; padding: 0 !important; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

@media (max-width: 600px) {
    .resi-nb-grid { grid-template-columns: 1fr; }
    .resi-chatbot-panel { width: calc(100vw - 48px) !important; right: -12px; }
}
