/* Navigation Enhancements */
.navbar {
    transition: all 0.3s ease;
}

.navbar .nav-link {
    transition: all 0.2s ease;
    position: relative;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    background-color: var(--bs-secondary-bg);
}

.navbar .nav-link.active {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

/* Theme toggle icons */
.theme-icon-light,
.theme-icon-dark {
    transition: opacity 0.3s ease;
}

[data-bs-theme="dark"] .theme-icon-light {
    display: none !important;
}

[data-bs-theme="dark"] .theme-icon-dark {
    display: inline !important;
}

[data-bs-theme="light"] .theme-icon-dark {
    display: none !important;
}

[data-bs-theme="light"] .theme-icon-light {
    display: inline !important;
}

/* Card hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15) !important;
}

[data-bs-theme="dark"] .hover-lift:hover {
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.5) !important;
}

/* Stretched link color fix */
.card .stretched-link {
    color: inherit;
    transition: color 0.2s ease;
}

.card:hover .stretched-link {
    color: var(--bs-primary) !important;
}

/* Custom styles for Vue progress bars */
.progress {
    position: relative;
    background-color: #e9ecef;
    height: 1.5rem;
}

.progress .progress-bar {
    height: 100%;
}

.progress .text-white {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Article Card Hover Effects */
.hover-shadow-lg {
    transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.hover-shadow-lg:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-4px);
}

/* Smooth transitions for all interactive elements */
.transition {
    transition: all 0.3s ease-in-out;
}

/* Card link styling - ensures the stretched link changes color on hover */
.card .stretched-link {
    transition: color 0.2s ease-in-out;
}

.card:hover .stretched-link {
    color: var(--bs-primary) !important;
}

/* Enhanced progress bar animation */
.progress-bar {
    transition: width 0.6s ease;
}

/* Debug badge styling */
.debug-badge {
    font-size: 0.75rem;
    line-height: 1.4;
}

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

/* Back to top button (if implemented) */
.btn-back-to-top {
    width: 50px;
    height: 50px;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.btn-back-to-top.show {
    display: block;
    opacity: 1;
}

/* Dark Mode Card Improvements */
[data-bs-theme="dark"] .card {
    background-color: var(--bs-dark);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .card .stretched-link {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .card:hover .stretched-link {
    color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .bg-body-secondary {
    background-color: #1a1d20 !important;
}

[data-bs-theme="light"] .bg-body-secondary {
    background-color: #f8f9fa !important;
}

/* Video Card Specific Styles */
.card img.card-img-top {
    transition: opacity 0.3s ease-in-out;
}

.card:hover img.card-img-top {
    opacity: 0.9;
}

/* Play Button Overlay */
.card .position-absolute .bg-danger {
    transition: transform 0.3s ease-in-out;
}

.card:hover .position-absolute .bg-danger {
    transform: scale(1.1);
}

/* Project Card Specific Styles */
.card .badge {
    font-size: 0.75rem;
    font-weight: 600;
}

/* GitHub Button Styling */
.card-footer .btn-outline-secondary {
    transition: all 0.2s ease-in-out;
}

.card-footer .btn-outline-secondary:hover {
    background-color: var(--bs-secondary);
    color: white;
    transform: translateY(-2px);
}

/* Dark Mode - Video and Project Cards */
[data-bs-theme="dark"] .card .btn-outline-secondary {
    border-color: #6c757d;
    color: #adb5bd;
}

[data-bs-theme="dark"] .card .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

/* Ensure badges are visible in dark mode */
[data-bs-theme="dark"] .badge.bg-primary {
    background-color: #0d6efd !important;
}

[data-bs-theme="dark"] .badge.bg-secondary {
    background-color: #6c757d !important;
}

/* SVG icons in dark mode */
[data-bs-theme="dark"] .card svg {
    filter: brightness(1.2);
}

/* Article List - Dark Mode Improvements */
[data-bs-theme="dark"] .card .card-title a {
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .card .card-title a:hover {
    color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .card .card-subtitle {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .card .card-subtitle a {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .card .card-subtitle a:hover {
    color: #dee2e6 !important;
}

/* Ensure article card text is readable in dark mode */
[data-bs-theme="dark"] .card .card-text {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .card .text-muted {
    color: #6c757d !important;
}

/* Fix author name visibility in dark mode - card footer */
[data-bs-theme="dark"] .card-footer .text-dark {
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .card-footer strong.text-dark {
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .card-footer small {
    color: #adb5bd !important;
}

/* ============================================
   Article Reading Experience Styles
   ============================================ */

/* Article Header */
.article-header {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.article-title {
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-meta {
    font-size: 0.95rem;
}

.article-meta svg {
    flex-shrink: 0;
}

/* Article Body - Optimal Reading Experience */
.article-body {
    font-size: 1.125rem; /* 18px */
    line-height: 1.7;
    color: var(--bs-body-color);
}

/* Typography Hierarchy */
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.article-body h1 { font-size: 2.25rem; }
.article-body h2 { font-size: 1.875rem; }
.article-body h3 { font-size: 1.5rem; }
.article-body h4 { font-size: 1.25rem; }
.article-body h5 { font-size: 1.125rem; }
.article-body h6 { font-size: 1rem; }

/* Paragraphs */
.article-body p {
    margin-bottom: 1.5rem;
}

/* Lists */
.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body li > ul,
.article-body li > ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Links */
.article-body a {
    color: var(--bs-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

.article-body a:hover {
    color: var(--bs-primary);
    text-decoration-thickness: 2px;
}

/* Blockquotes */
.article-body blockquote {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--bs-primary);
    background-color: var(--bs-secondary-bg);
    font-style: italic;
}

.article-body blockquote p:last-child {
    margin-bottom: 0;
}

/* Code Blocks */
.article-body pre {
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
}

.article-body pre code {
    padding: 0;
    background: none;
    font-size: inherit;
}

/* Inline Code */
.article-body code {
    padding: 0.2rem 0.4rem;
    background-color: var(--bs-secondary-bg);
    border-radius: 0.25rem;
    font-size: 0.9em;
    font-family: 'Courier New', Courier, monospace;
}

/* Images */
.article-body img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Tables */
.article-body table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.article-body table th,
.article-body table td {
    padding: 0.75rem;
    border: 1px solid var(--bs-border-color);
}

.article-body table th {
    background-color: var(--bs-secondary-bg);
    font-weight: 600;
    text-align: left;
}

.article-body table tr:nth-child(even) {
    background-color: var(--bs-tertiary-bg);
}

/* Horizontal Rules */
.article-body hr {
    margin: 3rem 0;
    border: 0;
    border-top: 2px solid var(--bs-border-color);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .article-body {
        font-size: 1rem; /* 16px on mobile */
    }
    
    .article-body h1 { font-size: 1.75rem; }
    .article-body h2 { font-size: 1.5rem; }
    .article-body h3 { font-size: 1.25rem; }
    .article-body h4 { font-size: 1.125rem; }
    
    .article-body pre {
        padding: 1rem;
        font-size: 0.85rem;
    }
    
    .article-body blockquote {
        padding: 0.75rem 1rem;
    }
}

/* Dark Mode Specific Adjustments */
[data-bs-theme="dark"] .article-body {
    color: #e9ecef;
}

[data-bs-theme="dark"] .article-body a {
    color: #6ea8fe;
}

[data-bs-theme="dark"] .article-body a:hover {
    color: #9ec5fe;
}

[data-bs-theme="dark"] .article-body blockquote {
    background-color: rgba(255, 255, 255, 0.05);
    border-left-color: #6ea8fe;
}

[data-bs-theme="dark"] .article-body code {
    background-color: rgba(255, 255, 255, 0.1);
    color: #f8f9fa;
}

[data-bs-theme="dark"] .article-body img {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .article-body table th {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .article-body table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Article Footer */
.article-footer {
    margin-top: 3rem;
}

.article-footer .btn {
    transition: all 0.2s ease;
}

.article-footer .btn:hover {
    transform: translateX(-4px);
}

/* ============================================
   Timeline Styles (About Page)
   ============================================ */

.timeline {
    position: relative;
    padding: 2rem 0;
    margin: 2rem 0;
}

/* Vertical line in the center */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--bs-primary);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    display: flex;
    align-items: flex-start;
}

/* Alternate left and right on desktop */
.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-item:nth-child(odd) .timeline-content {
    padding-right: calc(50% + 2rem);
    text-align: right;
}

.timeline-item:nth-child(even) .timeline-content {
    padding-left: calc(50% + 2rem);
    text-align: left;
}

/* Timeline marker (dot) */
.timeline-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--bs-primary);
    border: 4px solid var(--bs-body-bg);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 4px var(--bs-primary-bg-subtle);
}

/* Timeline content */
.timeline-content {
    flex: 1;
    background: var(--bs-body-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.timeline-year {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    margin-bottom: 0.75rem;
}

.timeline-content h4 {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.timeline-content p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.timeline-content ul {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.timeline-content li {
    margin-bottom: 0.5rem;
}

.timeline-content .alert {
    font-size: 0.9rem;
}

/* Mobile responsive - single column */
@media (max-width: 768px) {
    /* Move line to the left */
    .timeline::before {
        left: 20px;
    }
    
    /* Reset alternating layout */
    .timeline-item {
        flex-direction: row !important;
    }
    
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        padding-left: 3rem;
        padding-right: 1rem;
        text-align: left;
    }
    
    /* Move marker to the left */
    .timeline-marker {
        left: 20px;
    }
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .timeline-content {
    background: var(--bs-dark);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .timeline-content:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .timeline-marker {
    border-color: var(--bs-dark);
}

/* ============================================
   Prism Theme Switching
   ============================================ */

/* Hide dark theme by default (light mode) */
body:not(.prism-atom-dark) pre[class*="language-"],
body:not(.prism-atom-dark) code[class*="language-"] {
    /* Light theme will be visible */
}

/* When dark theme class is applied, ensure it takes precedence */
body.prism-atom-dark pre[class*="language-"],
body.prism-atom-dark code[class*="language-"] {
    /* Dark theme styles from prism-atom-dark.css will apply */
}

/* Ensure smooth transition between themes */
pre[class*="language-"],
code[class*="language-"] {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================
   Category Badge Styles
   ============================================ */

/* Make category badges look clickable */
.badge.cursor-pointer {
    cursor: pointer;
    transition: all 0.2s ease;
}

.badge.cursor-pointer:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

.badge.cursor-pointer:active {
    transform: translateY(0);
}

/* Category filter buttons */
.btn.cursor-pointer {
    cursor: pointer;
}

/* Ensure category badges in cards are properly styled */
.card-header .badge.cursor-pointer,
.card-footer .badge.cursor-pointer {
    padding: 0.35em 0.65em;
    font-size: 0.875em;
    font-weight: 600;
}

/* Dark mode adjustments for category badges */
[data-bs-theme="dark"] .badge.cursor-pointer:hover {
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.2);
}
