/* ==========================================================================
   1. IMPORTS & FONTS
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;800&family=JetBrains+Mono:wght@400;700&display=swap');

/* ==========================================================================
   2. GLOBAL VARIABLES
   ========================================================================== */
:root {
    --text_font: "Roboto", sans-serif;       
    --blog-font: "JetBrains Mono", monospace; 
    --font-main: 'Poppins', system-ui, -apple-system, sans-serif;

    --color-purple: #6b21a8;
    --color-purple-dark: #4c1d95;
    --color-purple-light: #9333ea;
    --color-yellow: #eab308;
    --color-yellow-light: #fef08a;
    --color-black: #111111;
    --color-white: #ffffff;
    --color-grey-light: #f4f4f5;
    
    --ease-hover: ease-out; 
}

/* ==========================================================================
   3. GLOBAL RESET & BODY STYLES
   ========================================================================== */
body {
    font-family: var(--font-main);
    background-color: #f8fafc;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(107, 33, 168, 0.06) 0px, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(234, 179, 8, 0.06) 0px, transparent 40%),
        radial-gradient(circle at 80% 10%, rgba(107, 33, 168, 0.06) 0px, transparent 40%),
        radial-gradient(circle at 20% 90%, rgba(234, 179, 8, 0.06) 0px, transparent 40%);
    background-attachment: fixed;
    color: var(--color-black);
    font-size: 18px; 
    line-height: 1.6;
    margin: 0;
    

    animation: fadeInPage 0.4s ease-in-out forwards;
}


body.fade-out {
    animation: fadeOutPage 0.4s ease-in-out forwards;
}


@keyframes fadeInPage {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes fadeOutPage {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

body.loaded {
    opacity: 1;
}

a { text-decoration: underline; color: var(--color-purple); transition: 0.2s; }

a:not(.btn):not(.read-more):not(.footer-button):not(.nav-btn):hover {
    background-color: var(--color-purple);
    color: var(--color-white);
    padding: 2px 6px;
    border-radius: 4px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}


.inline_link, #link, #link-alt {
    font-weight: 800;
    color: var(--color-purple);
    text-decoration: none;
    transition: color 0.15s ease-out, background-color 0.15s ease-out;
    padding: 2px 6px;
    border-radius: 4px;
}

.inline_link:hover, #link:hover, #link-alt:hover {
    color: var(--color-white);
    background-color: var(--color-purple);
    text-decoration: none;
}

/* ==========================================================================
   4. BANNER
   ========================================================================== */
.bg-animated-purple {
    background: linear-gradient(-45deg, var(--color-purple-dark), var(--color-purple), #3b0764, var(--color-purple-light));
    background-size: 400% 400%;
    animation: gradientMove 12s ease infinite;
    color: var(--color-white);
    width: 100%;
    position: relative;
    padding: 8rem 20px;
    text-align: center;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom: 3rem;
}

@keyframes gradientMove { 
    0% { background-position: 0% 50%; } 
    50% { background-position: 100% 50%; } 
    100% { background-position: 0% 50%; } 
}

#hero-canvas { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    pointer-events: none; 
    z-index: 0; 
    opacity: 0.8; 
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    color: var(--color-white);
    font-family: var(--font-main);
    font-size: 4rem;
    margin: 0 0 10px 0;
    text-shadow: 2px 4px 10px rgba(0,0,0,0.3);
    font-weight: 800;
    line-height: 1.1;
}

p.header-welcome {
    color: var(--color-white);
    font-family: var(--font-main);
    font-size: 1.5rem;
    text-align: center !important; 
    margin: 0 auto;
}

/* ==========================================================================
   5. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-main);
}

h2 { 
    font-size: 2.5rem; 
    color: var(--color-purple); 
    margin: 2.5rem auto 1.5rem auto; 
    font-weight: 800; 
    display: inline-block; 
    position: relative; 
    cursor: default;
    text-align: center;
}

h2::after { 
    content: ''; 
    position: absolute; 
    left: 0; 
    bottom: -5px; 
    width: 30%; 
    height: 6px; 
    background: var(--color-purple); 
    border-radius: 3px; 
    box-shadow: 1px 2px 5px rgba(0,0,0,0.2); 
    transition: width 0.4s cubic-bezier(0.5, 0, 0, 1); 
}

h2:hover::after { width: 100%; }

.updates-feed h2::after { display: none; }

/* General Blog Post Headings */
h3, h4, h5, h6 {
    color: var(--color-purple-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 800;
    text-align: left;
}

h3 { font-size: 1.8rem; }
h4 { font-size: 1.5rem; }

p, ul li, ol li {
    font-family: var(--blog-font);
    font-size: 1.1rem;
    text-align: left;
    margin-bottom: 15px;
}

.date {
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    color: #666;
    margin-top: -5px;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.85;
}

/* ==========================================================================
   6. LAYOUT 
   ========================================================================== */
.main-content-wrapper { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

.homepage-layout {
    display: flex;
    flex-direction: row;
    gap: 40px;
}

.homepage-layout > .blog-feed { flex: 3; min-width: 0; }
.homepage-layout > .updates-feed { flex: 1; min-width: 0; display: flex; flex-direction: column; }

@media (max-width: 900px) {
    .homepage-layout { flex-direction: column; }
    .updates-feed { margin-top: 0; }
}

.blog-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 0 0 20px 0;
}


.blog-card, .update-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-top: 8px solid var(--color-purple);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.15s ease-out, border-top-color 0.15s ease-out, box-shadow 0.15s ease-out, background 0.15s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.blog-card:hover, .update-card:hover { 
    transform: translateY(-10px);
    border-top-color: var(--color-yellow);
    box-shadow: 0 15px 40px rgba(107, 33, 168, 0.15);
    background: rgba(255, 255, 255, 0.85);
}

.blog-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.blog-content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }

.blog-card h3, .update-card h3 {
    font-family: var(--font-main);
    font-size: 1.5rem; 
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 10px; 
    color: var(--color-purple);
}

.blog-content h4 { font-size: 1rem; color: #666; margin-top: 0; margin-bottom: 10px; font-family: var(--font-main); font-weight: 600;}
.blog-content p { font-size: 1rem; margin-bottom: 20px; font-family: var(--font-main); flex-grow: 1; }

/* ==========================================================================
   7. SEARCH AND BUTTONS
   ========================================================================== */
#filterSearchContainer {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

#myBtnContainer {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    flex: 1 1 50%;
    justify-content: flex-start;
    margin-bottom: 0;
}

#myBtnContainer .btn {
    background-color: var(--color-purple);
    color: var(--color-white);
    font-family: var(--font-main);
    font-weight: 600;
    border: none;
    border-radius: 100px; 
    padding: 10px 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s var(--ease-hover), background-color 0.15s var(--ease-hover), box-shadow 0.15s var(--ease-hover);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#myBtnContainer .btn:hover {
    background-color: var(--color-purple-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(107, 33, 168, 0.2);
}

#myBtnContainer .btn.active {
    background-color: var(--color-yellow);
    color: var(--color-black);
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(234, 179, 8, 0.3);
}

#searchBar {
    padding: 10px 20px;
    border-radius: 100px;
    border: 1px solid rgba(0,0,0,0.1);
    background-color: #fff;
    color: var(--color-black);
    font-family: var(--font-main);
    font-size: 1rem;
    flex: 0 1 300px; 
    min-width: 200px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    box-sizing: border-box;
    height: 44px; 
    margin: 0;
}

.read-more, .show-more-btn {
    background-color: var(--color-purple);
    color: var(--color-white);
    font-family: var(--font-main);
    font-weight: 600;
    border-radius: 100px;
    padding: 10px 24px;
    border: none;
    cursor: pointer;
    transition: all 0.15s var(--ease-hover);
    margin-top: auto; 
    align-self: flex-start;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.read-more:hover, .show-more-btn:hover {
    background-color: var(--color-yellow);
    color: var(--color-black);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(234, 179, 8, 0.2);
}

.show-more-btn { width: 100%; margin-top: 20px; }

.filterDiv { display: none; }
.show { display: flex; }

.updates-feed h2 { margin-top: 0; } 

.update-card { padding: 20px; margin-bottom: 20px; }
.update-card h3 { text-align: center; margin-top: 0; }

.update-content {
    font-family: var(--blog-font);
    font-size: 0.9rem;
    max-height: 100px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.4s ease-out;
}
.update-content.expanded { max-height: 5000px; }

.expand-btn {
    background: none;
    border: none;
    color: var(--color-purple);
    font-family: var(--font-main);
    font-weight: bold;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 10px;
    transition: color 0.15s var(--ease-hover);
}
.expand-btn:hover { color: var(--color-yellow); text-decoration: underline; }

/* ==========================================================================
   8. FOOTER
   ========================================================================== */
footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    background-color: var(--color-black);
    color: var(--color-white);
    width: 100%;
    margin-top: 50px;
}

.about-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 30px;
    box-sizing: border-box;
    gap: 20px;
    margin-bottom: 20px;
}

.about-card img { 
    width: 100%; 
    max-width: 300px;
    height: 300px; 
    object-fit: cover; 
    border-radius: 20px; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.about-text { 
    flex: 1;
    text-align: center; 
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.about-name {
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    font-family: var(--font-main);
    font-weight: 800;
    color: var(--color-white);
}

.button-group {
    display: flex;
    flex-direction: row;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
    justify-content: center;
}

.footer-button {
    padding: 12px 24px;
    font-size: 1rem;
    font-family: var(--font-main);
    font-weight: 800;
    cursor: pointer;
    border: none;
    border-radius: 100px;
    transition: transform 0.15s var(--ease-hover), background-color 0.15s var(--ease-hover), box-shadow 0.15s var(--ease-hover);
}

.yellow-button { background-color: var(--color-yellow); color: var(--color-black); }
.yellow-button:hover { background-color: var(--color-yellow-light); transform: translateY(-3px); box-shadow: 0 6px 12px rgba(234, 179, 8, 0.2); }

.purple-button { background-color: var(--color-purple); color: var(--color-white); }
.purple-button:hover { background-color: var(--color-purple-light); transform: translateY(-3px); box-shadow: 0 6px 12px rgba(107, 33, 168, 0.2); }

@media (min-width: 800px) {
    .about-card {
        flex-direction: row;
        text-align: left;
        padding: 40px;
        gap: 40px;
    }
    .about-text { text-align: left; }
    .button-group { justify-content: flex-start; }
}

@media (max-width: 700px) {
    #filterSearchContainer { flex-direction: column; }
    #myBtnContainer { flex-direction: column; align-items: stretch; width: 100%; }
    #myBtnContainer .btn { width: 100%; text-align: center; }
    #searchBar { width: 100%; max-width: 100%; flex: 1 1 100%; margin-top: 10px; }
    .hero-content h1 { font-size: 3rem; }
}

/* ==========================================================================
   BLOG POST STYLES
   ========================================================================== */

.blog-post-wrapper {
    width: 90%;
    max-width: 1000px; 
    margin: 40px auto; 
    padding: 40px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-top: 8px solid var(--color-purple);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    display: block; 
    box-sizing: border-box;
}

.article-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--color-purple);
    padding-bottom: 20px;
}

.article-header h1 {
    font-size: 2.5rem;
    color: var(--color-purple-dark);
    margin-bottom: 10px;
}

.blog-nav-footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

@media (max-width: 768px) {
    .blog-post-wrapper {
        width: 95%;
        padding: 20px;
        margin: 20px auto;
    }
    .article-header h1 {
        font-size: 2rem;
    }
}

/* ==========================================================================
   CALLOUTS
   ========================================================================== */
.callout {
    padding: 20px;
    border-radius: 12px;
    border-left: 6px solid var(--color-purple);
    margin: 20px 0;
    font-size: 1.1rem;
    font-family: var(--blog-font);
    background: rgba(255, 255, 255, 0.4); /* Translucent */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    color: var(--color-black);
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.callout.note { border-color: var(--color-yellow); }
.callout.warning { border-color: var(--color-red); }

/* ==========================================================================
   AI PROMPT BOX
   ========================================================================== */
@keyframes swirlGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.ai-prompt {
    background: linear-gradient(135deg, rgba(76, 29, 149, 0.8), rgba(17, 17, 17, 0.8), rgba(50, 2, 103, 0.8), rgba(107, 33, 168, 0.8));
    background-size: 300% 300%;
    animation: swirlGradient 8s infinite linear;
    
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 6px solid var(--color-yellow);
    border-right: 6px solid var(--color-yellow);
    
    color: var(--color-white);
    font-family: var(--blog-font);
    padding: 24px;
    padding-top: 35px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(107, 33, 168, 0.25);
    margin: 40px 0;
    white-space: pre-wrap;
    word-break: break-word;
    position: relative;
}

.ai-prompt::before {
    content: "AI Prompt";
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-yellow);
    color: var(--color-black);
    padding: 6px 30px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 100px;
    box-shadow: 0 4px 10px rgba(234, 179, 8, 0.3);
    white-space: nowrap;
}

/* ==========================================================================
   IMAGES & CAPTIONS
   ========================================================================== */
article figure { 
    margin: 3rem auto; 
    text-align: center; 
    max-width: 85%;
    position: relative;
}

article figure img { 
    max-width: 100%; 
    height: auto; 
    display: block; 
    margin: 0 auto;
    border-radius: 16px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
    transition: transform 0.3s var(--ease-hover), box-shadow 0.3s var(--ease-hover);
    cursor: zoom-in;
    position: relative;
    z-index: 1;
}

article figure img:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(107, 33, 168, 0.15); 
}

/* ==========================================================================
   LIGHTBOX OVERLAY
   ========================================================================== */
#global-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

#global-lightbox.active {
    display: flex;
}

#global-lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

article figcaption { 
    font-family: var(--font-main);
    font-size: 0.95rem; 
    color: #666; 
    margin-top: 1rem; 
    font-style: italic; 
    display: block; 
}

/* ==========================================================================
   BLOCKQUOTES
   ========================================================================== */
article blockquote {
    border-left: 5px solid var(--mainpurple);
    padding: 15px 25px;
    background-color: rgba(96, 8, 172, 0.05);
    font-style: italic;
    font-family: var(--blog-font);
    color: #333;
    margin: 25px 0;
    border-radius: 0 10px 10px 0;
}

/* ==========================================================================
   REPLY CARDS (Updated Style)
   ========================================================================== */
.fancy-reply-card {
    margin: 30px 0;
    border-radius: 12px;
    border: 1px solid var(--maingrey);
    background: linear-gradient(135deg, #ffffff, #fdfdfd); 
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: max-height 0.6s ease, box-shadow 0.4s ease;
    max-height: 180px; 
    cursor: pointer;
    position: relative;
    font-family: var(--text_font);
    border-left: 5px solid var(--mainpurple); 
}

.fancy-reply-card.expanded {
    max-height: 3000px; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.reply-full-content {
    padding: 0 20px 20px 20px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.4s ease, max-height 0.6s ease;
}

.fancy-reply-card.expanded .reply-full-content {
    opacity: 1;
    max-height: 2500px; 
}

.reply-thumbnail {
    width: 200px;        
    height: 130px;       
    object-fit: cover;   
    border-radius: 8px;
    flex-shrink: 0;      
    display: block;      
}

@media (max-width: 600px) {
    .reply-thumbnail {
        width: 100%;     
        height: 180px;   
    }
}

.fancy-reply-card {
    margin: 30px 0;
    border-radius: 12px;
    border: 1px solid var(--maingrey);
    background: linear-gradient(135deg, #ffffff, #fdfdfd); 
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: max-height 0.6s ease, box-shadow 0.4s ease;
    max-height: 180px; 
    cursor: pointer;
    position: relative;
    font-family: var(--text_font);
    border-left: 5px solid var(--mainpurple); 
}

.reply-card-top {
    display: flex;
    flex-direction: row;
    padding: 20px;
    gap: 20px;
    align-items: flex-start; 
}

.reply-top-right {
    flex: 1; 
    min-width: 0; 
    display: flex;
    flex-direction: column;
}

.reply-title {
    color: var(--mainpurple);
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.2;
}

.reply-date {
    color: #666;
    margin: 4px 0 8px 0;
    font-size: 0.9rem;
}

/* ==========================================================================
   9. TABLES (Responsive & Container-Safe)
   ========================================================================== */
.table-responsive-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 30px 0;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    overflow: hidden;
    text-align: left;
    margin: 0;
    table-layout: fixed;
}

table th {
    background-color: var(--color-purple);
    color: var(--color-white);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 16px 20px;
    border-bottom: 2px solid var(--color-purple-dark);
    letter-spacing: 0.5px;
    line-height: 1.3;
}

table td {
    padding: 14px 20px;
    font-family: var(--blog-font);
    font-size: 1rem;
    color: var(--color-black);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: break-word;
}

table tbody tr {
    transition: background-color 0.15s var(--ease-hover);
}

table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

table tbody tr:hover {
    background: rgba(107, 33, 168, 0.08);
}

table tbody tr:last-child td {
    border-bottom: none;
}

@media (max-width: 768px) {
    .table-responsive-wrapper {
        margin: 20px 0;
    }
    
    table th {
        padding: 12px 14px;
        font-size: 1rem;
    }

    table td {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}