﻿/*
Theme Name: Ask Theme
Theme URI: https://muhammadalaa.com
Author: Muhammad Alaa
Author URI: https://muhammadalaa.com
Description: ثيم أسئلة وأجوبة متكامل على نمط Quora - من تطوير Muhammad Alaa
Version: 1.0.6
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ask-theme
Tags: rtl-language-support, custom-menu, featured-images, threaded-comments, question-answer
*/

:root {
    --bs-body-bg: #f1f2f2;
    --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --bs-primary: #283373;
    --bs-primary-rgb: 40, 51, 115;
    --bs-link-color: #1f1f1f;
    --bs-link-hover-color: #283373;
}

body {
    background-color: var(--bs-body-bg);
    color: #282829;
}

/* Override Bootstrap danger color to use our primary blue */
.btn-danger {
    background-color: #283373 !important;
    border-color: #283373 !important;
}

.btn-danger:hover {
    background-color: #1e2860 !important;
    border-color: #1e2860 !important;
}

.text-danger {
    color: #283373 !important;
}

/* Navbar */
.navbar {
    border-bottom: 1px solid #dee2e6;
}

.navbar-brand {
    font-family: 'Georgia', serif;
    letter-spacing: -0.5px;
}

.nav-link {
    color: #636466;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--bs-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--bs-primary);
}

/* Cards */
.card {
    border: 1px solid #dee2e6;
    transition: box-shadow 0.2s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05) !important;
}

.card-title a {
    color: #1f1f1f;
    font-weight: 700;
}

.card-title a:hover {
    text-decoration: underline !important;
}

/* Sidebar */
.sidebar-widget {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.sidebar-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #636466;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Tags */
.badge {
    font-weight: normal;
    padding: 0.4em 0.8em;
    transition: all 0.2s ease-in-out;
}

.badge:hover {
    background-color: #e9ecef !important;
    color: #1f1f1f !important;
}

/* Pagination */
.pagination .page-numbers {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin: 0 2px;
    border-radius: 50rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    color: #636466;
    text-decoration: none;
}

.pagination .page-numbers.current {
    background-color: #e4e6e6;
    color: #1f1f1f;
    border-color: #e4e6e6;
    font-weight: bold;
}

.pagination .page-numbers:hover:not(.current) {
    background-color: #f8f9fa;
}

/* Footer */
footer {
    background: #fff;
    border-top: 1px solid #dee2e6;
    margin-top: 3rem;
    padding: 2rem 0;
    text-align: center;
    line-height: 1.75;
    color: #282829;
}

.question-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.question-content h2,
.question-content h3,
.question-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #1f1f1f;
}

.question-content h2 {
    font-size: 1.5rem;
}

.question-content h3 {
    font-size: 1.25rem;
}

.question-content p {
    margin-bottom: 1.25rem;
}

.question-content ul,
.question-content ol {
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.question-content a {
    color: var(--bs-primary);
    text-decoration: underline;
}

.question-content a:hover {
    color: #1e2860;
}

.question-content code {
    background-color: #f8f9fa;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    color: #d63384;
}

.question-content pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.question-content blockquote {
    border-right: 4px solid var(--bs-primary);
    padding-right: 1rem;
    margin: 1.5rem 0;
    color: #636466;
    font-style: italic;
}

/* Comments (Answers) */
ol.comment-list,
ol.comment-list>li,
.comment-list,
.comment-list>li,
ul.children,
ul.children>li,
.children,
.children>li,
li.comment {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

.comment-content {
    font-size: 1rem;
    line-height: 1.7;
    color: #282829;
}

.comment-content p {
    margin-bottom: 1rem;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-content a {
    color: var(--bs-primary);
    text-decoration: underline;
}

.comment-content code {
    background-color: #f8f9fa;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

/* Nested Replies */
.children {
    list-style: none;
    padding-right: 3rem;
    margin-top: 1rem;
}

.children>li {
    list-style: none;
}

/* Vote Buttons */
.vote-widget .vote-btn {
    transition: all 0.2s ease-in-out;
}

.vote-widget .vote-btn:hover {
    background-color: #f8f9fa;
    border-color: var(--bs-primary);
}

.vote-widget .vote-btn:hover i {
    color: var(--bs-primary) !important;
}

.vote-comment.voted,
.vote-post.voted {
    background-color: #fff0f0 !important;
    border-color: var(--bs-primary) !important;
}

.vote-comment.voted i,
.vote-post.voted i {
    color: var(--bs-primary) !important;
}

/* Comment Form */
.comment-form {
    background: transparent;
}

.comment-form .form-control {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.comment-form .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(40, 51, 115, 0.15);
}

.comment-form textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.comment-form .form-submit {
    margin-bottom: 0;
}

/* Best Answer Styling */
.best-answer {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%) !important;
    border: 2px solid #4caf50 !important;
    position: relative;
}

.best-answer-badge {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: 0 0 8px 0;
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.best-answer .card-body {
    padding-top: 2.5rem !important;
}

/* Comment Navigation */
.comment-navigation {
    margin: 2rem 0;
}

.comment-navigation .nav-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Ask Form */
.ask-form-wrapper {
    background: #fff;
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Sidebar Related */
.sidebar-widget .list-group-item {
    transition: background-color 0.2s ease-in-out;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-widget .list-group-item:last-child {
    border-bottom: none;
}

.sidebar-widget .list-group-item:hover {
    background-color: #f8f9fa;
}

/* Buttons */
.btn-light {
    transition: all 0.2s ease-in-out;
}

.btn-light:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* Avatar */
.bg-light.rounded-circle {
    background-color: #e9ecef !important;
}

/* Utilities */
.text-quora-red {
    color: #283373;
}

.bg-quora-red {
    background-color: #283373;
}

.btn-quora {
    background-color: #283373;
    color: #fff;
    border: none;
}

.btn-quora:hover {
    background-color: #1e2860;
    color: #fff;
}

/* Categories Grid */
.categories-section {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
}

.categories-section .section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f1f1f;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.categories-section .section-title i {
    color: var(--bs-primary);
}

.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    text-decoration: none;
    color: #282829;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
    width: 100%;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(40, 51, 115, 0.05), rgba(40, 51, 115, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(40, 51, 115, 0.15);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.category-card:hover::before {
    opacity: 1;
}

.category-card .category-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bs-primary), #3d4a9e);
    color: #fff;
    font-size: 1.5rem;
    border-radius: 50%;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 51, 115, 0.2);
}

.category-card:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(40, 51, 115, 0.3);
}

.category-card .category-name {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

.category-card .category-count {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 0.25rem;
    position: relative;
    z-index: 1;
}

.category-card:hover .category-count {
    color: var(--bs-primary);
}

/* Responsive Categories Grid */
@media (max-width: 767.98px) {
    .category-card {
        padding: 0.875rem 0.5rem;
    }

    .category-card .category-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .category-card .category-name {
        font-size: 0.8rem;
    }
}

/* Responsive */
@media (max-width: 991.98px) {
    .question-content {
        font-size: 0.95rem;
    }

    .children {
        padding-right: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .question-content {
        font-size: 0.9rem;
    }

    .children {
        padding-right: 1rem;
    }

    .breadcrumb {
        font-size: 0.8rem;
    }
}