/* ChataBok Plugin Styles */
.chatabok-form-container {
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.chatabok-error {
    color: red;
    margin-bottom: 15px;
}

.chatabok-success {
    color: green;
    margin-bottom: 15px;
}

.chatabok-app-wrapper {
    display: flex;
    max-width: 1000px;
    height: 600px;
    /* Move the wrapper closer to the top */
    margin: 5px auto 20px auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chatabok-sidebar {
    width: 300px;
    border-right: 1px solid #ddd;
    background: #f7f7f7;
    display: flex;
    flex-direction: column;
}

.chatabok-sidebar-header {
    padding: 15px;
    background: #ededed;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
}

.chatabok-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Individual list items */
.chatabok-list-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 5px;
    transition: background 0.2s;
}

.chatabok-list-item:hover {
    background: #ebebeb;
}

.chatabok-list-item.active {
    background: #e9edef;
}

.chatabok-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0056b3; /* Matching Dark Blue */
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
}

.chatabok-item-info {
    flex: 1;
}

.chatabok-item-name {
    font-weight: bold;
    font-size: 14px;
}

.chatabok-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #efeae2;
}

.chatabok-chat-header {
    padding: 15px;
    background: #ededed;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.chatabok-messages-window {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Message Bubbles */
.chatabok-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.chatabok-message.sent {
    align-items: flex-end;
}

.chatabok-message.received {
    align-items: flex-start;
}

.chatabok-message-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 10px;
    position: relative;
    font-size: 14px;
    line-height: 1.4;
}

.chatabok-message.received .chatabok-message-content {
    background: #fff;
    border-top-left-radius: 0;
}

.chatabok-message.sent .chatabok-message-content {
    background: #d9fdd3;
    border-top-right-radius: 0;
}

.chatabok-message-meta {
    font-size: 11px;
    color: #888;
    margin-top: 5px;
}

.chatabok-chat-controls {
    display: flex;
    padding: 15px;
    background: #bbdefb; /* Slightly darker blue filling */
    border: 2px solid #0056b3; /* Darker Blue border */
    align-items: center;
    position: sticky;
    bottom: 10px;
    z-index: 10;
    width: 75% !important;
    margin: 0 auto 15px auto !important;
    border-radius: 12px;
}

.chatabok-chat-controls textarea {
    flex: 1;
    height: 40px;
    border-radius: 20px;
    border: none;
    padding: 10px 15px;
    resize: none;
    margin-right: 15px;
    font-family: inherit;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chatabok-chat-controls textarea:focus {
    outline: none;
}

.chatabok-chat-controls button {
    background: #0056b3; /* Matching Dark Blue */
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatabok-chat-controls button:hover {
    background: #004494;
}

/* Reply Feature Styles */
.chatabok-msg {
    padding: 6px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    position: relative;
    transition: background 0.15s;
}
.chatabok-msg:hover {
    background: rgba(0,0,0,0.04);
}
.chatabok-reply-btn {
    display: none;
    font-size: 12px;
    color: #0056b3; /* Matching Dark Blue */
    cursor: pointer;
    margin-top: 2px;
}
.chatabok-msg:hover .chatabok-reply-btn {
    display: inline-block;
}
.chatabok-reply-quote {
    background: #e2f0ff;
    border-left: 3px solid #007bff;
    padding: 5px 10px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
}

/* Reduce Top Page Spacing */
.page-content, .entry-content, .chatabok-dashboard, .chatabok-admin-dashboard {
    margin-top: 0 !important;
    padding-top: 5px !important;
}
.chatabok-app-wrapper {
    margin: 2px auto 20px auto !important;
}

/* Enhanced Input Visibility */
.chatabok-chat-controls {
    background: #f0f7ff !important;
    border: 2px solid #0056b3 !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.chatabok-chat-controls textarea {
    background: #fff !important;
    border: 1px solid #0056b3 !important;
    font-size: 15px !important;
}

/* Moderator Dashboard Styles */
.chatabok-mod-dashboard { padding: 20px; background: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); margin-top: 10px !important; }
.mod-tabs { margin-bottom: 20px; border-bottom: 2px solid #eee; display: flex; gap: 5px; }
.mod-tab-btn { background: none; border: none; padding: 10px 20px; cursor: pointer; font-weight: bold; font-family: inherit; }
.mod-tab-btn.active { border-bottom: 3px solid #0056b3; color: #0056b3; }
.mod-item { border: 1px solid #ddd; padding: 15px; margin-bottom: 10px; border-radius: 5px; background: #fafafa; }
.mod-item-header { display: flex; justify-content: space-between; font-weight: bold; margin-bottom: 10px; }
.mod-item-actions button { margin-right: 5px; padding: 6px 12px; font-size: 12px; cursor: pointer; border-radius: 4px; border: none; color: white; transition: opacity 0.2s; }
.mod-item-actions button:hover { opacity: 0.8; }
.btn-warn { background: #f39c12; }
.btn-mute { background: #d35400; }
.btn-ban { background: #c0392b; }
.btn-freeze { background: #2980b9; }
.score-high { color: #c0392b; font-weight: bold; }
.score-med { color: #f39c12; font-weight: bold; }


/* ── Hide Duplicate Page Title Headings & Breadcrumbs ── */
/* Astra generates an H1 page title + breadcrumbs automatically.
   Our shortcodes already render their own headings, so we hide the theme ones.
   Scoped to article content area to avoid hiding the site logo/header. */
article.page .entry-title,
article.page .entry-header,
.ast-article-single .entry-title,
.ast-article-single .entry-header,
h1.entry-title,
.ast-archive-description .ast-archive-title,
.ast-breadcrumbs-wrapper,
.ast-breadcrumbs,
nav.rank-math-breadcrumb,
.breadcrumbs,
p#breadcrumbs {
    display: none !important;
}

/* ── Mobile Responsiveness (Stacked Option A) ── */
@media (max-width: 768px) {
    .chatabok-app-wrapper {
        flex-direction: column;
        height: 85vh; /* Take up most of the mobile screen height */
        min-height: 600px;
        margin: 0 !important;
        border-radius: 0;
        border-right: none;
        border-left: none;
    }
    .chatabok-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #0056b3;
        flex: none;
        height: 250px; /* Constrain the list height so users can scroll it */
    }
    .chatabok-chat-container {
        flex: 1;
        min-height: 350px;
    }
    .chatabok-chat-controls {
        width: 95% !important;
        margin: 0 auto 10px auto !important;
        padding: 10px;
    }
    .chatabok-chat-controls textarea {
        font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
    }
}
