/* Article Page Styles */
:root {
    /* Modern Dark Theme with Purple Accents */
    --primary-purple: #8b5cf6;
    --secondary-purple: #a855f7;
    --accent-purple: #c084fc;
    --dark-purple: #7c3aed;
    --light-purple: #e9d5ff;

    /* Background Colors */
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.1);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-accent: #8b5cf6;

    /* Card and Component Backgrounds */
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-hover-bg: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-focus-bg: rgba(255, 255, 255, 0.08);

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --border-focus: #8b5cf6;

    /* Gradients */
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --gradient-bg: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);

    /* Shadows */
    --shadow-sm: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
    --shadow-md: 0 0.5rem 2rem rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 1rem 4rem rgba(0, 0, 0, 0.3);
    --shadow-purple: 0 0.5rem 2rem rgba(139, 92, 246, 0.3);

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;

    /* Typography */
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Courier Prime', Monaco, 'Cascadia Code', monospace;

    /* Glass Effects */
    --glass-backdrop: blur(1.25rem);
    --glass-border: 0.0625rem solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.1);

    /* Navbar specific */
    --navbar-bg: rgba(15, 15, 35, 0.8);
    --navbar-scrolled-bg: rgba(15, 15, 35, 0.95);

    /* Footer specific */
    --footer-bg: #1a1a2e;
    --footer-border: rgba(255, 255, 255, 0.1);
    --theme-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* inverse-filter */
    --icon-filter: invert(1);

}

.light-theme {
    /* Modern light Theme with Purple Accents */
    --primary-purple: #8b5cf6;
    --secondary-purple: #a855f7;
    --accent-purple: #c084fc;
    --dark-purple: #7c3aed;
    --light-purple: #e9d5ff;

    /* Background Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-hover: rgba(255, 255, 255, 0.9);


    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-accent: #7c3aed;

    /* Card and Component Backgrounds */
    --card-bg: #f8fafc;
    --card-hover-bg: #f8fafc;
    --input-bg: #f1f5f9;
    --input-focus-bg: #ffffff;

    /* Borders */
    --border-color: #cbd5e1;
    --border-hover: #94a3b8;
    --border-focus: #7c3aed;

    /* Gradients */
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-bg: #ffffff;

    /* Shadows (Scalable) */
    --shadow-sm: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
    --shadow-md: 0 0.5rem 2rem rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 1rem 4rem rgba(0, 0, 0, 0.3);
    --shadow-purple: 0 0.5rem 2rem rgba(139, 92, 246, 0.3);

    /* Border Radius (Scalable) */
    --radius-sm: 0.5rem;
    /* 8px */
    --radius-md: 1rem;
    /* 16px */
    --radius-lg: 1.5rem;
    /* 24px */
    --radius-xl: 2rem;
    /* 32px */

    /* Typography */
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Courier Prime', Monaco, 'Cascadia Code', monospace;


    /* Glass Effects (Replaced with soft shadows) */
    --glass-backdrop: none;
    --glass-border: 0.0625rem solid var(--border-color);
    --glass-shadow: var(--shadow-md);

    /* Navbar specific */
    --navbar-bg: rgba(255, 255, 255, 0.8);
    --navbar-scrolled-bg: rgba(255, 255, 255, 0.95);

    /* Footer specific */
    --footer-bg: #f8fafc;
    --footer-border: #cbd5e1;

    /* inverse-filter */
    --icon-filter: invert(0);

    /* Theme transition */
    --theme-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-purple);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background: var(--gradient-bg);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.inverse-icon {
    filter: var(--icon-filter);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 0.375rem;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-purple);
    border-radius: 0.1875rem;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-purple);
}

/* Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--navbar-bg);
    backdrop-filter: blur(1.25rem);
    border-bottom: var(--glass-border);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: var(--navbar-scrolled-bg);
    box-shadow: var(--shadow-md);
}

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 75rem;
    margin: 0 auto;
    padding: 1rem 2rem;
    height: 5rem;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


.toggle-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-sm);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3rem;
    transition: background 0.3s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-icon {
    height: 1.7rem;

}

.back-to-home {
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.back-to-home:hover {
    transform: translateY(-0.125rem);
}

.home-icon {
    height: 1.7rem;
}


/* Main Content */
.main-content {
    padding-top: 5rem;
    min-height: 100vh;
}

.container {
    max-width: 50rem;
    margin: 0 auto;
    padding: 0 2rem;
}


/* Article Styles */
.article {
    padding: 3rem 0 6rem;
}

/* Article Header */
.article-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}


.article-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    padding-left: 1rem;
    text-align: center;
}

.article-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 45rem;
    margin: 0 auto;
    border-left: 4px solid var(--primary-purple);
    border-width: 0.2rem;
    padding: 1rem;
    background: var(--card-bg);
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    flex-direction: row;
    margin-left: 1rem;
    margin-right: 1rem;
    margin-top: 1rem;
}


.date {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.author {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.8rem;
}

/* Article Content */
.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.content-section {
    margin-bottom: 3rem;
}

.content-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-purple);
    margin-bottom: 1.5rem;
    background-clip: text;
}

.content-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
}

.content-section h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 0.75rem 0;
}

.content-section p {
    margin-bottom: 1.5rem;
}

.content-section ul,
.content-section ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.content-section li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.content-section li strong {
    color: var(--text-primary);
}

/* Special Components */
.highlight-box {
    background: var(--card-bg);
    border-left: 4px solid var(--primary-purple);
    padding: 1.5rem;
    margin: 2rem 0;
    position: relative;
}

.highlight-box h4 {
    color: var(--primary-purple);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.library-card {
    background: var(--card-bg);
    backdrop-filter: blur(1.25rem);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.library-card:hover {
    background: var(--card-hover-bg);
    transform: translateY(-0.25rem);
    box-shadow: var(--shadow-md);
}

.library-card h4 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.steps-list {
    counter-reset: step-counter;
    list-style: none;
    padding: 0;
}

.steps-list li {
    counter-increment: step-counter;
    background: var(--card-bg);
    backdrop-filter: blur(1.25rem);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 4rem;
}

.steps-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--secondary-purple);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}

.steps-list li strong {
    color: var(--text-primary);
    font-size: 1.2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.challenge-item {
    background: var(--card-bg);
    backdrop-filter: blur(1.25rem);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.challenge-item h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.call-to-action {
    background: var(--card-bg);
    backdrop-filter: blur(1.25rem);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    margin: 3rem 0;
    position: relative;
    overflow: hidden;
}

.call-to-action h3 {
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

/* buttons */

.buttons {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.button {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
}

.button:hover {
    transform: translateY(-0.125rem);
    background: var(--card-hover-bg);
    border-color: var(--border-hover);

}


/* The Modal (background) */
#openShareBtn {
    display: flex;
    align-items: center;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
    gap: 0.5rem;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    backdrop-filter: var(--glass-backdrop);
}

#openShareBtn:hover {
    background: var(--card-hover-bg);
    border-color: var(--border-hover);
    transform: translateY(-0.125rem);
    box-shadow: var(--shadow-sm);
}

.button-icon {
    height: 1.2rem;
}

/* The Modal (background) - Updated with theme */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(0.25rem);
    justify-content: center;
    align-items: center;
}

/* Modal Content - Updated with theme */
.modal-content {
    background: var(--bg-secondary);
    backdrop-filter: var(--glass-backdrop);
    border: var(--glass-border);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: fadeIn 0.3s;
    color: var(--text-primary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-btn {
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: var(--text-primary);

}

.share-link-container {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.share-link-container:focus-within {
    background: var(--input-focus-bg);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

#shareLinkInput {
    flex-grow: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    padding: 0.25rem;
    outline: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#shareLinkInput::selection {
    background: var(--primary-purple);
    color: white;
}

#copyLinkBtn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

#copyLinkBtn:hover {
    color: var(--text-primary);
    background: var(--card-hover-bg);
    border-color: var(--border-hover);
    transform: translateY(-0.0625rem);
}

#copyLinkBtn:active {
    transform: translateY(0);
    background: var(--primary-purple);
    color: white;
    border-color: var(--primary-purple);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    backdrop-filter: var(--glass-backdrop);
}

.social-icons a:hover {
    color: var(--text-primary);
    background: var(--card-hover-bg);
    border-color: var(--border-hover);
    transform: translateY(-0.125rem);
    box-shadow: var(--shadow-sm);
}



/* Copy success feedback */
.copy-success {
    position: absolute;
    top: -2rem;
    right: 0;
    background: var(--primary-purple);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    opacity: 0;
    transform: translateY(0.5rem);
    transition: all 0.3s ease;
    pointer-events: none;
}

.copy-success.show {
    opacity: 1;
    transform: translateY(0);
}




/* Footer */
.footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
    padding: 3rem 0 1rem;
}

.footer-container {
    max-width: 75rem;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-brand h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.purple-span {
    color: var(--text-secondary);
}

.footer-brand p {
    color: var(--text-muted);
}

.footer-socials {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.social-link:hover {
    background: var(--card-hover-bg);
    border-color: var(--border-hover);
    transform: translateY(-0.125rem);
}

.social-icon {
    height: 1.25rem;
}

.footer-bottom {
    text-align: center;
    align-items: center;
    padding-top: 1rem;
    margin-top: 2rem;
    border-top: 1px solid var(--footer-border);
    color: var(--text-muted);
}


/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .nav-bar {
        padding: 1rem;
    }

    .nav-links {

        gap: 0.5rem;
    }

    .article {
        padding: 2rem 0 4rem;
    }

    .library-grid {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .steps-list li {
        padding-left: 1.5rem;
    }

    .steps-list li::before {
        left: -1rem;
        position: relative;
        margin-right: 1rem;
        margin-bottom: 1rem;
        transform: none;
        top: auto;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .article-content {
        font-size: 1rem;
    }

    .content-section {
        margin-bottom: 2rem;
    }

    .highlight-box,
    .library-card,
    .challenge-item,
    .call-to-action,
    .article-footer,
    .related-card {
        padding: 1.5rem;
    }

    .steps-list li {
        padding: 1.5rem;
    }

}

/* Print Styles */
@media print {

    .navbar,
    .footer,
    .related-articles {
        display: none;
    }

    .main-content {
        padding-top: 0;
    }

    body {
        background: white;
        color: black;
    }

    .article-title,
    .content-section h2 {
        color: black;
        -webkit-text-fill-color: black;
    }
}