/* Article Page Specific Styles */

/* Header */
.article-header {
    min-height: unset;
    padding: 2rem 0;
    background: linear-gradient(180deg, var(--dark) 0%, var(--dark-light) 100%);
    position: relative;
    z-index: 10;
}

.article-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 90% 30%, rgba(142, 92, 249, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 10% 70%, rgba(25, 234, 220, 0.1) 0%, transparent 50%);
    z-index: -1;
}

/* Main Article Container */
.article-main {
    position: relative;
    z-index: 2;
}

.article-container {
    padding: 3rem 0;
    background-color: var(--dark);
}

/* Article Meta Header */
.article-meta-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.article-date,
.article-reading-time {
    color: var(--gray-light);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.article-date::after {
    content: "•";
    margin: 0 0.5rem;
    color: var(--gray);
}

/* Article Title */
.article-title {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 2rem;
    font-weight: 700;
}

/* Article Author */
.article-author {
    display: flex;
    align-items: center;
    margin-bottom: 2.5rem;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 1rem;
    object-fit: cover;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.author-title {
    color: var(--gray-light);
    font-size: 0.9rem;
}

/* Featured Image */
.article-featured-image {
    margin-bottom: 2.5rem;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.image-caption {
    display: block;
    padding: 0.75rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--gray-light);
    font-size: 0.85rem;
    font-style: italic;
    text-align: center;
}

/* Article Content */
.article-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

.article-lead {
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--light);
    margin-bottom: 2rem;
    font-weight: 500;
}

.article-content h2 {
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--light);
    position: relative;
}

.article-content h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50px;
    height: 3px;
    background-image: linear-gradient(to right, var(--accent), var(--primary));
    border-radius: 2px;
}

.article-content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
    color: var(--gray-light);
    font-size: 1.1rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    margin-left: 1.5rem;
    color: var(--gray-light);
    font-size: 1.1rem;
}

.article-content li {
    margin-bottom: 0.75rem;
}

.article-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: all 0.2s ease;
}

.article-content a:hover {
    color: var(--accent-light);
    text-decoration-thickness: 2px;
}

/* Blockquote */
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    margin: 2rem 0;
    background-color: rgba(110, 55, 240, 0.1);
    border-radius: 0 8px 8px 0;
}

.article-content blockquote p {
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 0.5rem;
    color: var(--light);
}

.article-content blockquote cite {
    font-size: 0.9rem;
    color: var(--gray-light);
    display: block;
    text-align: right;
    font-style: normal;
}

/* Callout */
.article-callout {
    background-color: rgba(28, 23, 68, 0.5);
    border-radius: 8px;
    padding: 2rem;
    margin: 2.5rem 0;
    border: 1px solid rgba(110, 55, 240, 0.2);
}

.article-callout h3 {
    margin-top: 0;
    color: var(--accent);
    margin-bottom: 1rem;
}

.impact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.impact-item {
    display: flex;
    flex-direction: column;
}

.impact-item strong {
    color: var(--light);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.impact-item span {
    color: var(--gray-light);
    font-size: 0.95rem;
}

/* Figure */
.article-figure {
    margin: 2.5rem 0;
}

.article-figure img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

.article-figure figcaption {
    text-align: center;
    color: var(--gray);
    font-size: 0.9rem;
    margin-top: 0.75rem;
    font-style: italic;
}

/* Tags */
.article-tags {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.tags-list a {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.tags-list a:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Share Buttons */
.article-share {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.share-label {
    font-weight: 600;
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.share-button:hover {
    transform: translateY(-3px);
}

.share-button.twitter:hover {
    background-color: #1DA1F2;
}

.share-button.linkedin:hover {
    background-color: #0077B5;
}

.share-button.facebook:hover {
    background-color: #4267B2;
}

.share-button.email:hover {
    background-color: var(--primary);
}

/* Author Bio */
.article-author-bio {
    margin-top: 3rem;
    padding: 2rem;
    background-color: rgba(28, 23, 68, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.article-author-bio .author-avatar {
    width: 100px;
    height: 100px;
    margin-right: 0;
}

.author-bio-content {
    flex: 1;
}

.author-bio-content h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.author-bio-content p {
    color: var(--gray-light);
    margin-bottom: 1.5rem;
}

.author-social {
    display: flex;
    gap: 0.75rem;
}

.author-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.author-social a:hover {
    background-color: var(--primary);
    transform: translateY(-3px);
}

/* Related Articles */
.related-articles {
    padding: 5rem 0;
    background-color: rgba(28, 23, 68, 0.3);
    position: relative;
    z-index: 2;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-image: linear-gradient(to right, var(--accent), var(--primary));
    border-radius: 2px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.related-article {
    background-color: var(--dark-light);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.related-article .article-image img {
    transition: transform 0.5s ease;
}

.related-article:hover .article-image img {
    transform: scale(1.05);
}

/* Comments Section */
.comments-section {
    padding: 5rem 0;
    position: relative;
    z-index: 2;
}

.comment-count {
    color: var(--gray);
    font-weight: normal;
    font-size: 1.2rem;
}

.comment-form-container {
    margin-bottom: 3rem;
}

.comment-form-container h3 {
    margin-bottom: 1.5rem;
}

.comment-form {
    background-color: var(--dark-light);
    padding: 2rem;
    border-radius: 8px;
}

.comment-form .form-group {
    margin-bottom: 1.5rem;
}

.comment-form textarea {
    width: 100%;
    height: 120px;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--light);
    font-family: var(--font-secondary);
    font-size: 1rem;
    resize: vertical;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.user-info {
    display: flex;
    gap: 1rem;
    flex: 1;
    flex-wrap: wrap;
}

.user-info input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--light);
    font-family: var(--font-secondary);
    font-size: 1rem;
}

.user-info input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Comments List */
.comments-list {
    margin-top: 2rem;
}

.comment {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
}

.comment-author-tag {
    background-color: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    text-transform: uppercase;
}

.comment-date {
    color: var(--gray);
    font-size: 0.85rem;
}

.comment-body {
    margin-bottom: 1rem;
}

.comment-body p {
    color: var(--gray-light);
    font-size: 0.95rem;
}

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

.reply-btn {
    background: none;
    border: none;
    color: var(--gray-light);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.reply-btn:hover {
    color: var(--accent);
}

.comment-votes {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upvote,
.downvote {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.2s ease;
}

.upvote:hover {
    color: var(--accent);
}

.downvote:hover {
    color: var(--secondary);
}

.vote-count {
    font-size: 0.9rem;
    color: var(--gray-light);
}

/* Reply Comments */
.comment.reply {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Load More Comments */
.load-more-comments {
    text-align: center;
    margin-top: 2rem;
}

/* Table of Contents */
.article-toc {
    position: sticky;
    top: 2rem;
    background-color: var(--dark-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid rgba(110, 55, 240, 0.2);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.article-toc h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toc-toggle {
    background: none;
    border: none;
    color: var(--gray-light);
    cursor: pointer;
    font-size: 0.9rem;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-list li {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.toc-list a {
    color: var(--gray-light);
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    padding: 0.3rem 0;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--accent);
    border-left-color: var(--primary);
}

/* Progress Bar */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 100;
    background-color: transparent;
}

.progress-bar {
    height: 100%;
    background-image: linear-gradient(to right, var(--accent), var(--primary));
    width: 0%;
    transition: width 0.1s ease;
}

/* Highlight Effect */
.highlight {
    background-color: rgba(110, 55, 240, 0.2);
    padding: 0.2rem 0;
    border-radius: 2px;
    transition: background-color 0.5s ease;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 45px;
    height: 45px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 50;
    box-shadow: 0 4px 15px rgba(110, 55, 240, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.back-to-top:hover {
    background-color: var(--primary-light);
    transform: translateY(-3px);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 10, 31, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Text Selection Sharing */
.highlight-indicator {
    position: absolute;
    background-color: var(--primary);
    border-radius: 4px;
    padding: 5px 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(10px);
    animation: fade-in 0.3s ease forwards;
}

.highlight-share-twitter {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.highlight-share-twitter:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Time Markers */
.time-marker {
    position: absolute;
    right: -60px;
    font-size: 0.8rem;
    color: var(--gray);
    font-style: italic;
}

/* Copy Code Button */
.copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--primary-dark);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

pre:hover .copy-button {
    opacity: 1;
}

.copy-button:hover {
    background-color: var(--primary);
}

/* Reply Form */
.reply-form {
    margin-top: 1rem;
}

.reply-form textarea {
    width: 100%;
    height: 80px;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--light);
    font-family: var(--font-secondary);
    font-size: 0.95rem;
    resize: vertical;
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.reply-form .btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

/* Improved List Styling */
.article-content ul li::before {
    content: '•';
    color: var(--primary);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.article-content ol {
    counter-reset: item;
}

.article-content ol li {
    counter-increment: item;
}

.article-content ol li::before {
    content: counter(item) ". ";
    color: var(--primary);
    font-weight: bold;
    display: inline-block;
    width: 1.5em;
    margin-left: -1.5em;
}

/* Responsive Styles for Article Pages */

/* Large Screens (1024px and below) */
@media (max-width: 1024px) {
    .article-title {
        font-size: 2.5rem;
    }
    
    .article-lead {
        font-size: 1.2rem;
    }
    
    .impact-grid {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .article-toc {
        position: relative;
        top: 0;
        margin-bottom: 2rem;
    }
    
    .time-marker {
        display: none;
    }
}

/* Medium Screens (768px and below) */
@media (max-width: 768px) {
    .article-title {
        font-size: 2rem;
    }
    
    .article-content h2 {
        font-size: 1.8rem;
    }
    
    .article-lead {
        font-size: 1.1rem;
    }
    
    .article-content blockquote p {
        font-size: 1.1rem;
    }
    
    .article-author-bio {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .article-author-bio .author-avatar {
        margin-bottom: 1rem;
    }
    
    .author-social {
        justify-content: center;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .form-footer {
        flex-direction: column;
    }
    
    .user-info {
        width: 100%;
    }
}

/* Small Screens (480px and below) */
@media (max-width: 480px) {
    .article-title {
        font-size: 1.8rem;
    }
    
    .article-meta-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .article-date::after {
        display: none;
    }
    
    .article-content p,
    .article-content ul,
    .article-content ol {
        font-size: 1rem;
    }
    
    .article-lead {
        font-size: 1rem;
    }
    
    .comment {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .comment-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .article-share {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}