/* Community Forum Styles - BEM Methodology */

/* Community Index Page */
.community__actions {
    margin-bottom: 2em;
    text-align: right;
}

.community__login-prompt {
    margin-bottom: 2em;
}

.community__login-prompt a {
    color: inherit;
    text-decoration: underline;
}

.community__category-grid {
    display: grid;
    grid-template-columns: 1fr;
    align-items: flex-start;
    padding: 1em;
}

.community__category-info h3 {
    margin: 0 0 0.5em 0;
    font-size: 1em;
    font-weight: 600;
}

.community__category-question-count {
    font-weight: 400;
    color: #666;
    font-size: 0.9em;
}

.community__category-description {
    margin: 0;
    color: #666;
    line-height: 26px;
    font-style: italic;
}

.community__category-count {
    text-align: right;
    align-self: flex-start;
    margin-top: 0.5em;
}

.community__question-count {
    display: inline-block !important;
    background: var(--background-red) !important;
    color: white !important;
    padding: 0.25em 0.75em 0.35em 0.75em !important;
    border-radius: var(--border-radius) !important;
    font-size: 0.9em !important;
    text-decoration: none !important;
    border: none !important;
}


/* Community Category Container */
.community__category-container {
    display: block;
    text-decoration: none;
    color: inherit;
}

.community__category-main-link {
    text-decoration: none;
    color: inherit;
}

.community__category-main-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Community Category Inline Activity */
.community__category-activity-inline {
    padding-top: 1em;
}

.community__category-activity-inline-title {
    margin: 0 0 0.75em 0;
    font-size: 0.8em;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.community__category-activity-inline-list {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.community__category-activity-inline-item {
    display: block;
    align-items: center;
    gap: 0.5em;
    padding: 0.5em;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    position: relative;
}

.community__category-activity-inline-item:hover {
    background: #e9ecef;
    text-decoration: none;
    color: inherit;
}

.community__category-activity-inline-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: flex-start;
    justify-content: center;
    width: 1.6em;
    height: 1.6em;
    border-radius: 50%;
    font-size: 0.7em;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.community__category-activity-inline-icon--question {
    background: var(--background-red);
}

.community__category-activity-inline-icon--reply {
    background: #28a745;
}

.community__category-activity-inline-text {
    display: -webkit-box;
    padding: 0 8em 0 2em;
    font-size: 0.9em;
    color: var(--color-dark-grey);
    line-height: 22px;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.community__category-activity-inline-time {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.9em;
    color: #666;
}

/* Community Question Replies Inline (for category page) */
.community__question-replies-inline {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid #e9ecef;
}

.community__question-replies-inline-title {
    margin: 0 0 0.75em 0;
    font-size: 0.8em;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.community__question-replies-inline-list {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.community__question-reply-inline-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75em;
    padding: 0.75em;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    font-size: 0.85em;
    transition: all 0.2s ease;
}

.community__category-container:hover .community__question-reply-inline-item {
    background: #e9ecef;
}

.community__question-reply-inline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2em;
    height: 1.2em;
    border-radius: 50%;
    font-size: 0.7em;
    font-weight: 600;
    color: white;
    background: #28a745;
    flex-shrink: 0;
}

.community__question-reply-inline-content {
    flex: 1;
    min-width: 0;
}

.community__question-reply-inline-text {
    display: block;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
    margin-bottom: 0.25em;
}

.community__question-reply-inline-meta {
    font-size: 0.8em;
    color: #666;
    line-height: 1.2;
}

/* Community Category Page */

/* Search Box */
.community__search-box {
    padding: 1em;
    border-bottom: 1px solid var(--border-grey);
}

.community__search-form {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.community__search-input-group {
    display: flex;
    gap: 0.5em;
}

.community__search-input {
    flex: 1;
    padding: 1em;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 0.9em;
    transition: border-color 0.2s ease;
}

.community__search-input:focus {
    outline: none;
    border-color: var(--background-red);
}

.community__search-button {
    padding: 0.75em 1.5em;
    background: var(--background-red);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.community__search-button:hover {
    background: #0056b3;
}

.community__search-results-info {
    padding: 0.75em 1em;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9em;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.community__clear-search {
    color: var(--color-dark-red);
    text-decoration: none;
    font-weight: 500;
}

.community__clear-search:hover {
    text-decoration: underline;
}
.community__category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em;
    border-bottom: 1px solid var(--border-grey);
}

.community__question-item {
    padding: 1em;
}

.community__question-content {
    display: flex;
    gap: 1em;
    align-items: start;
}

.community__question-main {
    flex: 1;
}

.community__question-title {
    margin: 0 0 0.5em 0;
    font-size: 1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.community__question-preview {
    margin: 0 0 0.75em 0;
    color: #666;
    font-size: 0.9em;
}

.community__question-meta {
    display: flex;
    gap: 0.5em;
    font-size: 0.85em;
    color: #888;
}

.community__solved-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 0.15em 0.5em 0.35em 0.5em;
    border-radius: 0.25em;
    font-size: 0.6em;
    font-weight: 600;
}

/* Community Question Page */
.community__back-link {
    margin-bottom: 1em;
}

.community__question-header {
    margin-bottom: 1.5em;
}

.community__question-header--with-edit {
    position: relative;
}

.community__edit-button--question {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--background-red);
    color: white;
    padding: 0.5em 1em;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 500;
    transition: background-color 0.2s ease;
    z-index: 10;
}

.community__edit-button--question:hover {
    background: var(--background-red);
    color: white;
    text-decoration: none;
    opacity: 0.9;
}

.community__question-title-main {
    margin-bottom: 0.5em;
    display: flex;
    align-items: center;
    gap: 0.75em;
}

.community__question-meta-header {
    display: flex;
    gap: 0.5em;
    font-size: 0.9em;
    color: #666;
}

.community__question-content-text {
    line-height: 1.6;
    padding: 1em;
}

.community__question-content-text a,
.community__reply-content a {
    display: inline-block;
    color: var(--color-blue);
    text-decoration: underline;
    text-decoration-color: var(--border-blue);
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}

.community__question-content-text a:hover,
.community__reply-content a:hover {
    text-decoration: none;
}

.community__question-category {
    padding: 1em;
    border-top: 1px solid #e0e0e0;
}

.community__category-badge {
    display: inline-block;
    background: #f0f0f0;
    padding: 0.5em 1em;
    border-radius: var(--border-radius);
    font-size: 0.9em;
}

/* Community Replies */
.community__replies-header {
    margin: 0 0 1.5em 0;
    padding: 1em;
    font-size: 1em;
    font-weight: 600;
    border-bottom: 1px solid var(--border-grey);
}

.community__reply-item {
    padding: 1em;
    margin:  0 0 1em 1.5em;
    border-radius: 0.5em;
    border-left: 4px solid #e0e0e0;
}

.community__reply-item--accepted {
    background: #f0f9ff;
    border-left: 4px solid #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1);
    position: relative;
}

.community__accepted-badge {
    margin-bottom: 0.75em;
}

.community__accepted-badge span {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 0.25em 0.75em;
    border-radius: 0.25em;
    font-size: 0.85em;
    font-weight: 600;
    animation: acceptedPulse 2s ease-in-out;
}

@keyframes acceptedPulse {
    0% {
        background: #28a745;
        transform: scale(1);
    }
    50% {
        background: #34ce57;
        transform: scale(1.05);
    }
    100% {
        background: #28a745;
        transform: scale(1);
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Highlight targeted reply */
.community__reply-item:target {
    background: #fff3cd !important;
    border-left: 4px solid #ffc107 !important;
    animation: highlightReply 3s ease-in-out;
}

@keyframes highlightReply {
    0% {
        background: #fff3cd;
        transform: scale(1);
    }
    25% {
        background: #ffeaa7;
        transform: scale(1.02);
    }
    75% {
        background: #fff3cd;
        transform: scale(1.01);
    }
    100% {
        background: #fff3cd;
        transform: scale(1);
    }
}

.community__reply-content {
    line-height: 1.6;
    margin-bottom: 0.5em;
}

.community__reply-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: #666;
}

.community__reply-meta-left {
    display: flex;
    gap: 0.5em;
}

.community__no-replies {
    padding: 1em;
}

/* Community Reply Form */
.community__reply-form {
    margin-top: 1em;
}

.community__reply-form h2 {
    margin: 0;
    padding: 1em;
    font-size: 1em;
    font-weight: 600;
    border-bottom: 1px solid var(--border-grey);
}

.community__form-group {
    padding: 1em 1em 0 1em;
}

.community__form-label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
    font-size: 0.9em;
}

.community__form-input,
.community__form-select,
.community__form-textarea {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 0.9em;
}

.community__form-textarea {
    resize: vertical;
}

.community__form-error {
    color: #dc3545;
    font-size: 0.875em;
}

.community__form-help {
    display: block;
    color: #666;
    font-size: 0.875em;
    margin-bottom: 1em;
}

.community__form-actions {
    display: flex;
    gap: 1em;
    padding: 0 1em 1em 1em;
}

.community__login-prompt-box {
    margin-top: 1em;
}

.community__login-prompt-box p {
    text-align: center;
}

.community__login-prompt-box a {
    color: #007bff;
    text-decoration: underline;
}

/* Community Create Question */
.community__create-back {
    margin-bottom: 1em;
}

.community__tips-box {
    display: block;
    padding: 1em;
    background: #f0f9ff;
}

.community__tips-title {
    margin: 0 0 1em 0;
    font-size: 1em;
    font-weight: 600;
}

.community__tips-list {
    margin: 0;
    line-height: 1.8;
}

/* Community My Questions */
.community__my-questions-actions {
    margin-bottom: 1.5em;
    text-align: right;
}

.community__my-questions-item {
    padding: 1.5em;
}

.community__my-questions-content {
    display: flex;
    gap: 1em;
    align-items: start;
}

.community__my-questions-main {
    flex: 1;
}

.community__my-questions-title {
    margin: 0 0 0.5em 0;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
}

.community__my-questions-meta {
    display: flex;
    gap: 1em;
    font-size: 0.85em;
    color: #888;
    flex-wrap: wrap;
}

.community__my-questions-category {
    background: #f0f0f0;
    padding: 0.15em 0.5em;
    border-radius: 0.25em;
}

.community__my-questions-actions-right {
    display: flex;
    align-items: center;
}

.community__no-questions-link {
    color: #007bff;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .community__category-grid {
        grid-template-columns: 1fr;
    }
    
    .community__category-count {
        text-align: left;
    }
    
    .community__category-header {
        flex-direction: column;
        gap: 1em;
        align-items: stretch;
    }
    
    .community__question-meta {
        flex-direction: column;
        gap: 0.5em;
    }
    
    .community__reply-meta {
        flex-direction: column;
        gap: 0.5em;
        align-items: flex-start;
    }
    
    .community__form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .community__form-actions .button {
        text-align: center;
    }
    
    .community__search-input-group {
        flex-direction: column;
        gap: 0.75em;
    }
    
    .community__search-results-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5em;
    }
    
    .community__my-questions-meta {
        flex-direction: column;
        gap: 0.5em;
    }
    
    .community__user-actions {
        flex-direction: row;
        gap: 0.5em;
    }
}

/* User Community Dashboard */
.community__section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5em;
}

.community__section-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.community__user-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    align-items: flex-end;
}

.community__delete-form {
    margin: 0;
}

.community__success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 1em;
    border-radius: var(--border-radius);
    margin-bottom: 1em;
}

.community__question-context {
    background: #f8f9fa;
    padding: 1em;
    margin: 0 0 1em 0;
    border-radius: var(--border-radius);
}

.community__question-context h3 {
    margin: 0 0 0.5em 0;
    font-size: 1em;
    font-weight: 600;
    color: #666;
}

.community__question-preview {
    background: white;
    padding: 1em;
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
}

.community__question-preview h4 {
    margin: 0 0 0.5em 0;
    font-size: 1em;
    font-weight: 600;
}

.community__question-preview p {
    margin: 0 0 0.5em 0;
    color: #666;
    line-height: 1.4;
}

.community__question-preview small {
    color: #999;
    font-size: 0.85em;
}

.community__accepted-answer {
    color: #28a745;
}

/* Mark Answer Form */
.community__mark-answer-form {
    display: inline-block;
    margin-left: 1em;
}

/* Success Button Styling */
.btn--success {
    background-color: #28a745;
    color: white;
    border: 1px solid #28a745;
    padding: 0.5em 1em;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875em;
}

.btn--success:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.btn--success:active {
    background-color: #1e7e34;
    border-color: #1c7430;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(40, 167, 69, 0.2);
}

.btn--success:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

/* Warning Button Styling */
.btn--warning {
    background-color: #ffc107;
    color: #212529;
    border: 1px solid #ffc107;
    padding: 0.5em 1em;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875em;
}

.btn--warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    color: #212529;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.btn--warning:active {
    background-color: #d39e00;
    border-color: #c69500;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(255, 193, 7, 0.2);
}

.btn--warning:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.25);
}

/* Reply Meta Layout */
.community__reply-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.community__reply-meta-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.community__reply-meta-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.community__mark-answer-form {
    display: inline-block;
    margin: 0;
}

/* Edit Reply Button Link Styling */
.community__reply-meta-right .btn--secondary {
    color: var(--color-blue) !important;
}

.community__reply-meta-right .btn--secondary:hover {
    text-decoration: underline
}

@media (max-width: 768px) {
    .community__question-title-main {
        display: -webkit-box;
        line-height: 28px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .community__reply-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .community__category-info h3 {
        line-height: 26px;
    }

    .community__category-description {
        display: -webkit-box;
        line-height: 26px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .community__reply-meta-right {
        width: 100%;
        justify-content: flex-end;
    }

    .community__question-meta-header {
        overflow: auto;
        white-space: nowrap;
    }

    .community__question-meta-header span {
        display: inline-block;
    }
}