/* XenForo-style Comments CSS */

.comments-area.xenforo-style {
    margin: 2rem 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.comment-list {
    margin: 0;
    padding: 0;
}

/* Main message container - XenForo style with proper borders */
.message {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    margin-bottom: 15px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.message-inner {
    display: flex;
    padding: 15px;
}

/* User section (left side) */
.message-user {
    flex: 0 0 140px;
    padding-right: 15px;
    text-align: center;
}

.message-avatar {
    margin-bottom: 8px;
}

.avatar-container {
    position: relative;
    display: inline-block;
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: block;
    margin: 0 auto;
}

/* Online status indicator */
.avatar-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.avatar-status--online {
    background-color: #4caf50;
}

.avatar--default {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 24px;
}

.avatar-text {
    display: block;
}

.message-userDetails {
    font-size: 12px;
}

.message-name {
    font-size: 14px;
    font-weight: bold;
    margin: 0 0 4px 0;
    color: #2e5984;
}

.userTitle {
    color: #666;
    font-size: 11px;
    margin: 2px 0;
    display: block;
}

/* Specific role styling */
.userTitle--administrator {
    background: #d32f2f;
}

.userTitle--moderator {
    background: #388e3c;
}

.userTitle--staffmember {
    background: #1976d2;
}

.userBanner {
    background: #f0f0f0;
    color: #666;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin: 2px 0;
    display: inline-block;
}

/* Main content section (right side) */
.message-main {
    flex: 1;
    min-width: 0;
}

.message-content {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    position: relative;
    margin-top: 5px;
}

.message-attribution {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f0f0f0;
    border-bottom: 1px solid #e8e8e8;
    font-size: 12px;
    color: #666;
}

.u-dt {
    color: #666;
    text-decoration: none;
}

.message-number {
    font-weight: bold;
    color: #2e5984;
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #e8e8e8;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* New indicator badge */
.message-newIndicator {
    background: #ff9800;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Message action icons */
.message-share-icon,
.message-bookmark-icon {
    color: #666;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.message-share-icon:hover,
.message-bookmark-icon:hover {
    opacity: 1;
}

.message-body {
    padding: 12px;
}

.bbWrapper {
    line-height: 1.5;
    color: #333;
}

.bbWrapper p {
    margin: 0 0 1em 0;
}

.bbWrapper p:last-child {
    margin-bottom: 0;
}

/* Action bar */
.message-footer {
    border-top: 1px solid #e8e8e8;
    background: #f8f9fa;
}

.message-actionBar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    font-size: 12px;
}

.actionBar-set {
    display: flex;
    gap: 12px;
}

.actionBar-action {
    color: #666;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s ease;
    font-size: 12px;
}

.actionBar-action:hover {
    background: #e8e8e8;
    color: #333;
    text-decoration: none;
}

/* Specific action button styles */
.actionBar-action--report {
    color: #f44336;
}

.actionBar-action--edit {
    color: #2196f3;
}

.actionBar-action--delete {
    color: #f44336;
}

.actionBar-action--ip {
    color: #9e9e9e;
}

.actionBar-action--reply {
    color: #2e5984;
    font-weight: bold;
}

.actionBar-action--reply:hover {
    background: #2e5984;
    color: white;
}

/* External actions (left side) */
.actionBar-set--external .actionBar-action {
    opacity: 0.8;
}

.actionBar-set--external .actionBar-action:hover {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .message-inner {
        flex-direction: column;
    }
    
    .message-user {
        flex: none;
        padding-right: 0;
        padding-bottom: 10px;
        text-align: left;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .message-avatar {
        margin-bottom: 0;
    }
    
    .avatar {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    .message-userDetails {
        text-align: left;
    }
}

/* Hide interfering graphics */
.comments-area svg,
.comments-area .star-graphic,
.comments-area canvas {
    display: none !important;
}

/* Override any conflicting styles */
.comments-area * {
    box-sizing: border-box;
}

.comments-area a {
    color: #2e5984;
}

.comments-area a:hover {
    color: #1a3a5c;
}

/* XenForo-style Reply Box */
.xenforo-reply-container {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    overflow: hidden;
}

.xenforo-reply-box {
    display: flex;
    padding: 20px;
    gap: 20px;
    background: #f7f7f7;
}

.reply-user-section {
    flex: 0 0 64px;
}

.reply-avatar .avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.reply-avatar .avatar--default {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.reply-form-section {
    flex: 1;
    min-width: 0;
}

/* Reply Toolbar */
.reply-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    align-items: center;
}

.toolbar-group {
    display: flex;
    gap: 2px;
    align-items: center;
}

.toolbar-group:not(:last-child)::after {
    content: '';
    width: 1px;
    height: 20px;
    background: #ddd;
    margin-left: 8px;
}

.toolbar-btn {
    background: none;
    border: none;
    padding: 6px 8px;
    border-radius: 3px;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-btn:hover {
    background: #e8e8e8;
    color: #333;
}

.toolbar-btn:active {
    background: #ddd;
}

.toolbar-btn.active {
    background: #2e5984;
    color: white;
}

.toolbar-btn--preview {
    background: #2e5984;
    color: white;
    font-weight: bold;
    padding: 6px 12px;
}

.toolbar-btn--preview:hover {
    background: #1a3a5c;
}

/* Reply Editor */
.reply-editor {
    position: relative;
}

.reply-textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    background: #fff;
    transition: all 0.2s ease;
}

.reply-textarea:focus {
    border-color: #2e5984;
    box-shadow: 0 0 0 2px rgba(46, 89, 132, 0.1);
}

.reply-textarea::placeholder {
    color: #999;
    font-style: italic;
}

/* Reply Actions */
.reply-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-top: 1px solid #e8e8e8;
    border-radius: 0 0 4px 4px;
}

.reply-actions-left,
.reply-actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.attach-files-btn {
    background: none;
    border: none;
    color: #2e5984;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 3px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.attach-files-btn:hover {
    background: #e8e8e8;
    color: #1a3a5c;
}

.post-reply-btn {
    background: #2e5984;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-reply-btn:hover {
    background: #1a3a5c;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.post-reply-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .xenforo-reply-box {
        flex-direction: column;
        gap: 10px;
    }
    
    .reply-user-section {
        flex: none;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .reply-avatar .avatar,
    .reply-avatar .avatar--default {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    .reply-toolbar {
        flex-wrap: wrap;
        gap: 4px;
        padding: 6px 8px;
    }
    
    .toolbar-group::after {
        display: none;
    }
    
    .toolbar-btn {
        padding: 4px 6px;
        font-size: 12px;
    }
    
    .reply-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .reply-actions-left,
    .reply-actions-right {
        justify-content: center;
    }
    
    .post-reply-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Font Awesome Icons Support */
.fas, .far {
    font-family: "Font Awesome 5 Free", "Font Awesome 5 Pro", FontAwesome;
    font-weight: 900;
}

.far {
    font-weight: 400;
}

/* Fallback for missing Font Awesome */
.toolbar-btn i::before {
    font-style: normal;
}

.fa-bold::before { content: "B"; font-weight: bold; }
.fa-italic::before { content: "I"; font-style: italic; }
.fa-underline::before { content: "U"; text-decoration: underline; }
.fa-strikethrough::before { content: "S"; text-decoration: line-through; }
.fa-list-ul::before { content: "•"; }
.fa-list-ol::before { content: "1."; }
.fa-link::before { content: "🔗"; }
.fa-image::before { content: "🖼"; }
.fa-smile::before { content: "😊"; }
.fa-quote-right::before { content: "\201D"; }
.fa-code::before { content: "C"; }
.fa-eye::before { content: "👁"; }
.fa-reply::before { content: "↩"; }
.fa-paperclip::before { content: "📎"; }

/* Preview Modal */
.xenforo-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.preview-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    width: 800px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.preview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8e8e8;
}

.preview-modal-header h3 {
    margin: 0;
    color: #2e5984;
    font-size: 18px;
}

.preview-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.preview-modal-close:hover {
    background: #e8e8e8;
    color: #333;
}

.preview-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    line-height: 1.6;
}

.preview-modal-body blockquote {
    background: #f8f9fa;
    border-left: 4px solid #2e5984;
    margin: 10px 0;
    padding: 10px 15px;
    font-style: italic;
}

.preview-modal-body pre {
    background: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
}

.preview-modal-body code {
    background: #f4f4f4;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.preview-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}
/* Guest User Fields */
.guest-fields {
    margin-top: 15px;
    padding: 15px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.guest-field-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.guest-input {
    padding: 8px 12px;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s ease;
}

.guest-input:focus {
    outline: none;
    border-color: #2188ff;
    box-shadow: 0 0 0 2px rgba(33, 136, 255, 0.1);
}

.guest-input::placeholder {
    color: #656d76;
}

/* Responsive guest fields */
@media (max-width: 768px) {
    .guest-field-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}