/**
 * WP Community Board Styles
 * Matches the provided design layout
 */

/* Container */
.wpcb-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
}

/* Hide default WordPress comments when our shortcode is present */
.wpcb-container ~ #comments,
.wpcb-container ~ .comments-area,
.wpcb-container ~ #respond {
    display: none !important;
}

/* Alternative: Hide all default comments on pages with our shortcode */
body.page .wpcb-container ~ * #comments,
body.page .wpcb-container ~ * .comments-area {
    display: none !important;
}

/* Login Notice */
.wpcb-login-notice {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
}

.wpcb-login-button {
    display: inline-block;
    background: #00b8a9;
    color: white !important;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 15px;
    transition: background 0.3s;
}

.wpcb-login-button:hover {
    background: #009688;
    color: white !important;
}

/* Subscription Wrapper */
.wpcb-subscription-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.wpcb-subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: all 0.2s;
}

.wpcb-subscribe-btn:hover {
    border-color: #00b8a9;
    color: #00b8a9;
}

.wpcb-subscribe-btn svg {
    width: 16px;
    height: 16px;
}

.wpcb-subscription-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    min-width: 350px;
}

.wpcb-subscription-content label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.wpcb-notify-type {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
}

.wpcb-subscribed-message {
    font-size: 13px;
    color: #666;
    margin: 10px 0;
}

.wpcb-unsubscribe-link {
    color: #00b8a9;
    text-decoration: none;
}

.wpcb-save-subscription {
    background: #00b8a9;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
}

.wpcb-save-subscription:hover {
    background: #009688;
}

/* Comment Form */
.wpcb-comment-form {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.wpcb-reply-form {
    margin: 15px 0 15px 60px;
    padding: 15px;
}

.wpcb-form-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.wpcb-form-content {
    flex: 1;
}

.wpcb-reply-to-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.wpcb-reply-to-indicator svg {
    width: 16px;
    height: 16px;
}

.wpcb-editor-wrapper {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.wpcb-comment-textarea {
    width: 100%;
    border: none;
    padding: 15px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    outline: none;
}

.wpcb-comment-textarea:focus {
    outline: none;
}

/* Editor Toolbar */
.wpcb-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    border-top: 1px solid #eee;
    background: #fafafa;
    flex-wrap: wrap;
}

.wpcb-format-btn {
    background: transparent;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    transition: all 0.2s;
}

.wpcb-format-btn:hover {
    background: #e9ecef;
    color: #333;
}

.wpcb-format-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

.wpcb-toolbar-separator {
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 4px;
}

.wpcb-toolbar-right {
    margin-left: auto;
}

.wpcb-file-upload-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.wpcb-file-upload-btn:hover {
    background: #e9ecef;
}

.wpcb-file-upload-btn svg {
    width: 16px;
    height: 16px;
    color: #666;
}

/* File Preview */
.wpcb-file-preview {
    padding: 10px 15px;
    border-top: 1px solid #eee;
    display: none;
    flex-wrap: wrap;
    gap: 10px;
}

.wpcb-file-preview.has-files {
    display: flex;
}

.wpcb-file-preview-item {
    position: relative;
    padding: 8px 12px;
    background: #f1f3f5;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpcb-file-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
}

/* Form Actions */
.wpcb-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 15px;
    border-top: 1px solid #eee;
}

.wpcb-cancel-reply,
.wpcb-submit-comment {
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 14px;
}

.wpcb-cancel-reply {
    background: #e9ecef;
    color: #495057;
}

.wpcb-cancel-reply:hover {
    background: #dee2e6;
}

.wpcb-submit-comment {
    background: #00b8a9;
    color: white;
}

.wpcb-submit-comment:hover {
    background: #009688;
}

/* Comments Header */
.wpcb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.wpcb-comment-count {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    letter-spacing: 0.5px;
}

.wpcb-count {
    font-size: 18px;
    color: #00b8a9;
}

.wpcb-user-icon {
    display: flex;
    align-items: center;
    color: #6c757d;
}

.wpcb-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wpcb-icon-btn {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6c757d;
    border-radius: 4px;
    transition: all 0.2s;
}

.wpcb-icon-btn:hover {
    background: #f8f9fa;
    color: #00b8a9;
}

.wpcb-icon-btn svg {
    width: 20px;
    height: 20px;
}

.wpcb-icon-btn.wpcb-trending svg,
.wpcb-icon-btn.wpcb-hot svg {
    color: #ffc107;
}

.wpcb-sort-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* Comments List */
.wpcb-comments-list {
    margin-top: 20px;
}

.wpcb-no-comments {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 16px;
}

/* Individual Comment */
.wpcb-comment {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
}

.wpcb-comment-avatar {
    position: relative;
}

.wpcb-comment-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.wpcb-author-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #00b8a9;
    border: 2px solid white;
    border-radius: 50%;
}

.wpcb-comment-content {
    flex: 1;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e9ecef;
}

/* Nested Comments Connector Line */
.wpcb-children {
    position: relative;
    margin-top: 15px;
}

.wpcb-children::before {
    content: '';
    position: absolute;
    left: -45px;
    top: 0;
    bottom: 20px;
    width: 2px;
    background: #00b8a9;
    opacity: 0.3;
}

.wpcb-children .wpcb-comment {
    padding-left: 0;
}

/* Comment Header */
.wpcb-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.wpcb-comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wpcb-comment-author {
    font-weight: 600;
    color: #00b8a9;
    font-size: 15px;
}

.wpcb-badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpcb-author-label {
    background: #00b8a9;
    color: white;
}

.wpcb-editor-label {
    background: #ff6b35;
    color: white;
}

.wpcb-admin-label {
    background: #dc3545;
    color: white;
}

.wpcb-comment-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #6c757d;
}

.wpcb-comment-date svg {
    width: 14px;
    height: 14px;
}

.wpcb-pinned-icon {
    color: #00b8a9;
    display: flex;
    align-items: center;
}

.wpcb-pinned-icon svg {
    width: 16px;
    height: 16px;
}

/* Reply Indicator */
.wpcb-reply-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
}

.wpcb-reply-indicator svg {
    width: 14px;
    height: 14px;
}

.wpcb-reply-indicator a {
    color: #00b8a9;
    text-decoration: none;
}

.wpcb-reply-indicator a:hover {
    text-decoration: underline;
}

/* Comment Text */
.wpcb-comment-text {
    color: #495057;
    line-height: 1.6;
    font-size: 15px;
    margin-bottom: 15px;
}

.wpcb-comment-text p {
    margin: 0 0 10px;
}

.wpcb-comment-text p:last-child {
    margin-bottom: 0;
}

/* Editing State */
.wpcb-comment-editing .wpcb-comment-text {
    display: none;
}

.wpcb-edit-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 10px;
}

.wpcb-edit-actions {
    display: flex;
    gap: 10px;
}

.wpcb-save-edit,
.wpcb-cancel-edit {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.wpcb-save-edit {
    background: #00b8a9;
    color: white;
}

.wpcb-save-edit:hover {
    background: #009688;
}

.wpcb-cancel-edit {
    background: #e9ecef;
    color: #495057;
}

.wpcb-cancel-edit:hover {
    background: #dee2e6;
}

/* Attachments */
.wpcb-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.wpcb-attachment {
    border-radius: 8px;
    overflow: hidden;
}

.wpcb-attachment-image img {
    max-width: 300px;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.wpcb-attachment-audio audio,
.wpcb-attachment-video video {
    max-width: 100%;
    border-radius: 8px;
}

.wpcb-attachment-file a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-decoration: none;
    color: #495057;
    transition: all 0.2s;
}

.wpcb-attachment-file a:hover {
    background: #e9ecef;
    color: #00b8a9;
}

.wpcb-attachment-file svg {
    width: 20px;
    height: 20px;
}

/* Comment Footer */
.wpcb-comment-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Voting */
.wpcb-voting {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpcb-vote-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid #dee2e6;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s;
    font-size: 13px;
}

.wpcb-vote-btn svg {
    width: 16px;
    height: 16px;
}

.wpcb-vote-btn:hover {
    border-color: #00b8a9;
    color: #00b8a9;
}

.wpcb-upvote.active {
    background: #00b8a9;
    color: white;
    border-color: #00b8a9;
}

.wpcb-downvote.active {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.wpcb-vote-count {
    font-weight: 600;
}

/* Action Buttons */
.wpcb-reply-btn,
.wpcb-edit-btn,
.wpcb-delete-btn,
.wpcb-pin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid transparent;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #6c757d;
    font-size: 13px;
    transition: all 0.2s;
}

.wpcb-reply-btn:hover,
.wpcb-edit-btn:hover {
    color: #00b8a9;
    background: #f8f9fa;
}

.wpcb-delete-btn:hover {
    color: #dc3545;
    background: #f8f9fa;
}

.wpcb-pin-btn:hover {
    color: #ffc107;
    background: #f8f9fa;
}

.wpcb-reply-btn svg,
.wpcb-edit-btn svg,
.wpcb-delete-btn svg,
.wpcb-pin-btn svg {
    width: 16px;
    height: 16px;
}

/* Loading States */
.wpcb-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wpcb-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #00b8a9;
    border-radius: 50%;
    animation: wpcb-spin 1s linear infinite;
}

@keyframes wpcb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .wpcb-comment-form,
    .wpcb-reply-form {
        flex-direction: column;
    }
    
    .wpcb-form-avatar {
        display: none;
    }
    
    .wpcb-reply-form {
        margin-left: 0;
    }
    
    .wpcb-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .wpcb-toolbar {
        width: 100%;
        justify-content: space-between;
    }
    
    .wpcb-comment {
        flex-direction: column;
        gap: 10px;
    }
    
    .wpcb-comment-avatar {
        width: 50px;
    }
    
    .wpcb-comment-avatar img {
        width: 50px;
        height: 50px;
    }
    
    .wpcb-children::before {
        left: -25px;
    }
    
    .wpcb-subscription-dropdown {
        left: auto;
        right: 0;
        min-width: 280px;
    }
}
