:root {
    --primary: #667eea;
    --primary-dark: #5a6fd8;
    --success: #198754;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #2d3748;
    --gray: #6c757d;
    --border: #e2e8f0;
    --warning: #ffc107;
}

.article-content {
    white-space: pre-line;
    line-height: 1.9;
    font-size: 1.15rem;
    text-align: justify;
    color: #4a5568;
}

.article-content p {
    margin-bottom: 1.5rem;
    white-space: pre-line;
}

.article-content h2 {
    font-size: 1.75rem;
    margin: 2.5rem 0 1.2rem 0;
    color: var(--dark);
    border-right: 5px solid var(--primary);
    padding-right: 20px;
    font-weight: 700;
}

.article-content h3 {
    font-size: 1.4rem;
    margin: 2rem 0 1rem 0;
    color: #4a5568;
    font-weight: 600;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.5rem;
    padding-right: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-meta {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(102, 126, 234, 0.02) 100%);
    border-radius: 16px;
    padding: 20px 25px;
    margin: 25px 0;
    border: 1px solid rgba(102, 126, 234, 0.1);
    backdrop-filter: blur(10px);
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.article-image {
    max-width: 900px !important;
    width: 90% !important;
    margin: 20px auto !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    background: #fff !important;
    border: 1px solid #eaeaea !important;
    padding: 4px !important;
    position: relative !important;
    transition: transform 0.3s ease;
}

.article-image:hover {
    transform: scale(1.01);
}

.article-image img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: cover !important;
}

.article-meta-description {
    border-radius: 16px;
    border-right: 4px solid var(--primary);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin: 25px 0;
}

.article-meta-description .bi-info-circle-fill {
    color: var(--primary);
    font-size: 1.2rem;
}

.related-article-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
}

.related-article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.related-course-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    background: white;
}

.related-course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.course-level-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    font-size: 0.75rem;
}

.course-level-beginner {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.course-level-advanced {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.comment-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    background: white;
    padding: 25px;
}

.comment-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.vote-buttons {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    padding: 20px;
    margin: 40px 0;
    border: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.vote-buttons .btn {
    border-radius: 50px;
    padding: 12px 20px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1.1rem;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 60px;
    justify-content: center;
}

.vote-buttons .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.vote-buttons .btn-outline-success:hover {
    background-color: var(--success);
    border-color: var(--success);
}

.vote-buttons .btn-outline-danger:hover {
    background-color: var(--danger);
    border-color: var(--danger);
}

.breadcrumb {
    background: transparent !important;
    padding: 15px 0 !important;
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
}

.lead {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-right: 4px solid var(--primary);
    border-radius: 16px;
    font-size: 1.25rem !important;
    line-height: 1.8 !important;
    padding: 30px !important;
}

.card-header {
    border-radius: 16px 16px 0 0 !important;
    font-weight: 600;
}

.social-share {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1.3rem;
    position: relative;
    overflow: hidden;
}

.social-share a::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.social-share a:hover::before {
    opacity: 0.1;
}

.social-share a:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.social-share .whatsapp {
    color: #25D366 !important;
    background-color: rgba(37, 211, 102, 0.1);
}

.social-share .telegram {
    color: #0088cc !important;
    background-color: rgba(0, 136, 204, 0.1);
}

.social-share .twitter {
    color: #1DA1F2 !important;
    background-color: rgba(29, 161, 242, 0.1);
}

.social-share .linkedin {
    color: #0077b5 !important;
    background-color: rgba(0, 119, 181, 0.1);
}

.social-share a:hover {
    color: white !important;
}

.social-share .whatsapp:hover {
    background-color: #25D366;
}

.social-share .telegram:hover {
    background-color: #0088cc;
}

.social-share .twitter:hover {
    background-color: #1DA1F2;
}

.social-share .linkedin:hover {
    background-color: #0077b5;
}

.article-footer-meta {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 25px;
    margin: 30px 0;
    border: 1px solid var(--border);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}

.author-details h6 {
    margin: 0;
    color: var(--dark);
    font-weight: 600;
}

.author-details small {
    color: var(--gray);
}

.article-tags {
    margin: 40px 0;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    border: 2px solid transparent;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.tag-item::before {
    content: '#';
    margin-left: 4px;
    opacity: 0.8;
}

.tag-item:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
    border-color: rgba(255, 255, 255, 0.3);
}

.tag-item-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.tag-popularity-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.tag-popularity-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.tag-popularity-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.tag-popularity-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.tag-popularity-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }

.smart-tag-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #00cec9;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-tags-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #f8f9fa;
    color: #667eea;
    text-decoration: none;
    border-radius: 12px;
    border: 1px solid #667eea;
    transition: all 0.3s ease;
    font-size: 0.75rem;
}

.tag-badge:hover {
    background: #667eea;
    color: white;
    text-decoration: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-content, .vote-buttons, .comments-section, .related-articles, .article-tags, .related-courses {
    animation: fadeInUp 0.6s ease-out;
}

.article-content pre {
    background: #1a1a1a;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 25px 0;
    direction: ltr;
}

.article-content code {
    background: #f1f3f4;
    color: #d73a49;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 0.9em;
    direction: ltr;
}

.article-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.related-article-meta {
    font-size: 0.85rem;
    color: var(--gray);
}

.related-article-meta .badge {
    font-size: 0.75rem;
}

.course-meta {
    font-size: 0.85rem;
    color: var(--gray);
}

.course-meta .badge {
    font-size: 0.75rem;
}

.article-content pre {
    position: relative;
}

.article-content pre::before {
    content: 'کد';
    position: absolute;
    top: 10px;
    left: 10px;
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.article-content table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    text-align: right;
    font-weight: 600;
}

.article-content table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
}

.article-content table tr:hover td {
    background: #f8f9fa;
}

.article-content blockquote {
    border-right: 4px solid #667eea;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    margin: 30px 0;
    border-radius: 12px;
    font-style: italic;
    position: relative;
}

.article-content blockquote::before {
    content: '"';
    font-size: 3rem;
    color: #667eea;
    position: absolute;
    top: 10px;
    right: 20px;
    opacity: 0.3;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

.article-content iframe {
    width: 100%;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.course-category-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
}

.course-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9rem;
}

.section-title {
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.btn .spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.alert-success {
    border-radius: 16px;
    border: 1px solid #d1e7dd;
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.15);
}

.alert-success .alert-heading {
    color: #0f5132;
}

#countdown {
    font-weight: bold;
    color: #198754;
}