/* Code Help Section Styles */
.code-help-container {
    padding: 20px 0;
}

.code-question-card {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.code-question-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.code-question-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #6c5ce7, #a29bfe);
    border-radius: 10px 10px 0 0;
}

.code-question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.code-question-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
}

.code-question-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 10px;
}

.code-question-tag {
    background-color: #e6f0fd;
    color: #2a5885;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    margin-right: 5px;
}

.code-question-language {
    background-color: #f0e6fd;
    color: #6c5ce7;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

.code-question-content {
    margin-bottom: 20px;
}

.code-snippet {
    background-color: #282c34;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    overflow-x: auto;
    position: relative;
}

.code-snippet pre {
    margin: 0;
    color: #abb2bf;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.code-snippet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background-color: #21252b;
    border-radius: 8px 8px 0 0;
    margin: -15px -15px 15px -15px;
}

.code-snippet-language {
    color: #abb2bf;
    font-size: 0.8rem;
    font-weight: 500;
}

.copy-code-btn {
    background: none;
    border: none;
    color: #abb2bf;
    cursor: pointer;
    transition: color 0.2s ease;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-code-btn:hover {
    color: #fff;
}

.code-question-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.code-action-buttons {
    display: flex;
    gap: 15px;
}

.code-action-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.code-action-btn:hover {
    color: #2a5885;
}

.code-action-btn.solved {
    color: #27ae60;
}

.code-answers-count {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Code answer styles */
.code-answers {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.code-answer {
    background-color: #f0f7ff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.code-answer.accepted {
    background-color: #e6ffed;
    border-left: 3px solid #27ae60;
}

.accepted-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #27ae60;
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.code-answer-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.code-answer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #6c5ce7;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    margin-right: 10px;
}

.code-answer-author {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 0 3px 0;
}

.code-answer-date {
    font-size: 0.8rem;
    color: #777;
}

.code-answer-content {
    margin-bottom: 15px;
}

.code-answer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-answer-votes {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vote-btn {
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.vote-btn:hover {
    color: #2a5885;
}

.vote-btn.upvote.active {
    color: #27ae60;
}

.vote-btn.downvote.active {
    color: #e74c3c;
}

.vote-count {
    font-weight: 600;
    color: #333;
}

.accept-answer-btn {
    background-color: #f0f0f0;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #666;
}

.accept-answer-btn:hover {
    background-color: #e6ffed;
    color: #27ae60;
}

.accept-answer-btn.accepted {
    background-color: #27ae60;
    color: white;
}

/* Ask question form */
.ask-question-form {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
}

.code-editor-container {
    margin-bottom: 20px;
}

.code-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.code-language-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

.code-editor {
    width: 100%;
    height: 200px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #282c34;
    color: #abb2bf;
    resize: vertical;
}

/* Filter and sort */
.code-help-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.code-filter-options {
    display: flex;
    gap: 15px;
}

.code-filter-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.code-filter-btn:hover, .code-filter-btn.active {
    color: #2a5885;
}

.code-search-box {
    display: flex;
    align-items: center;
    background-color: #f0f0f0;
    border-radius: 20px;
    padding: 5px 15px;
    width: 250px;
}

.code-search-box input {
    border: none;
    background: none;
    padding: 8px;
    width: 100%;
    font-size: 0.9rem;
}

.code-search-box input:focus {
    outline: none;
}

/* Language badges */
.language-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.language-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-badge:hover {
    transform: translateY(-2px);
}

.language-badge.js {
    background-color: #fff3bf;
    color: #f59f00;
}

.language-badge.python {
    background-color: #e6fcf5;
    color: #0ca678;
}

.language-badge.java {
    background-color: #fff4e6;
    color: #fd7e14;
}

.language-badge.cpp {
    background-color: #f3f0ff;
    color: #7950f2;
}

.language-badge.csharp {
    background-color: #e3fafc;
    color: #15aabf;
}

.language-badge.html {
    background-color: #fff5f5;
    color: #fa5252;
}

.language-badge.css {
    background-color: #e7f5ff;
    color: #1c7ed6;
}

.language-badge.sql {
    background-color: #f8f9fa;
    color: #495057;
}

/* Syntax highlighting */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #5c6370;
    font-style: italic;
}

.token.punctuation {
    color: #abb2bf;
}

.token.selector,
.token.tag {
    color: #e06c75;
}

.token.property,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.attr-name,
.token.deleted {
    color: #d19a66;
}

.token.string,
.token.char,
.token.attr-value,
.token.builtin,
.token.inserted {
    color: #98c379;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #56b6c2;
}

.token.atrule,
.token.keyword {
    color: #c678dd;
}

.token.function {
    color: #61afef;
}

.token.regex,
.token.important,
.token.variable {
    color: #c678dd;
}

.token.important,
.token.bold {
    font-weight: bold;
}

.token.italic {
    font-style: italic;
}

.token.entity {
    cursor: help;
}

/* Line numbers */
.line-numbers .line-numbers-rows {
    position: absolute;
    pointer-events: none;
    top: 0;
    font-size: 100%;
    left: -3.8em;
    width: 3em;
    letter-spacing: -1px;
    border-right: 1px solid #999;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.line-numbers-rows > span {
    display: block;
    counter-increment: linenumber;
}

.line-numbers-rows > span:before {
    content: counter(linenumber);
    color: #999;
    display: block;
    padding-right: 0.8em;
    text-align: right;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .code-help-filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .code-search-box {
        width: 100%;
    }
    
    .language-badges {
        overflow-x: auto;
        padding-bottom: 10px;
        flex-wrap: nowrap;
    }
    
    .language-badge {
        white-space: nowrap;
    }
}
