/* ===== IMPORT & VARIABLES ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;       /* Your Brand Color */
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --hero-bg: linear-gradient(135deg, #e0e7ff 0%, #f8fafc 100%);
    --tag-bg: #e0e7ff;
    --skeleton-bg: #e2e8f0;
}

/* 🔥 PREMIUM DARK MODE VARIABLES */
[data-theme="dark"] {
    --primary: #3b82f6;       /* Slightly brighter blue to pop against dark mode */
    --text: #f8fafc;
    --text-light: #94a3b8;
    --bg: #0f172a;            /* Deep slate background */
    --card: #1e293b;          /* Elevated slate card */
    --border: #334155;
    --hero-bg: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    --tag-bg: #334155;
    --skeleton-bg: #334155;
}

/* ===== BASE STYLES & TRANSITIONS ===== */
body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Smooth color transitioning across all major elements */
.public-header, .blog-card, .post-container, .header-search-container, .filter-pill, .share-panel button, .site-footer {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   ===== PREMIUM HEADER UPGRADES ===== 
   ========================================== */
.public-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    gap: 20px;
}

/* 1. Round Brand Logo */
.logo { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    font-size: 22px; 
    font-weight: 800; 
    color: var(--primary); 
    cursor: pointer;
}
.logo span { color: var(--text); }

.round-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
    transition: transform 0.3s ease;
}
.logo:hover .round-logo { transform: rotate(-10deg) scale(1.05); }

/* 2. Top Header Search Bar */
.header-search-container {
    flex: 1;
    max-width: 450px;
    background: var(--bg);
    border-radius: 30px;
    padding: 8px 18px;
    border: 1px solid var(--border);
}
.header-search-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--card);
}
.header-search-form { display: flex; align-items: center; gap: 10px; width: 100%; }
.header-search-form i { color: var(--text-light); font-size: 15px; }
.header-search-form input {
    border: none; background: transparent; outline: none;
    color: var(--text); width: 100%; font-family: inherit; font-size: 14px;
}
.header-search-form input::placeholder { color: var(--text-light); }

/* 3. Navigation & Play Store Button */
nav { display: flex; gap: 25px; align-items: center; }
nav a { text-decoration: none; color: var(--text-light); font-weight: 600; transition: 0.2s; }
nav a:hover, nav a.active { color: var(--primary); }

.playstore-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--text);
    color: var(--card) !important;
    padding: 10px 20px; 
    border-radius: 8px;
}
.playstore-btn i { font-size: 16px; color: #34d399; }
.playstore-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2);
}

/* ===== BLOG HERO ===== */
.blog-hero {
    padding: 60px 20px;
    background: var(--hero-bg);
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.blog-hero h1 { font-size: 42px; font-weight: 800; margin: 0 0 15px; letter-spacing: -1px; }
.blog-hero p { font-size: 18px; color: var(--text-light); max-width: 600px; margin: 0 auto; }

/* ===== HERO TOPIC FILTERS ===== */
.hero-topic-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; 
    gap: 12px;
    margin-top: 25px;
}
.filter-pill {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.filter-pill:hover { border-color: var(--primary); color: var(--primary); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.filter-pill.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== BLOG GRID ===== */
.blog-section { padding: 60px 0; }
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}
.blog-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.blog-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.card-img-wrapper { position: relative; height: 200px; }
.card-img-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.card-tag { 
    position: absolute; top: 15px; left: 15px; background: var(--card); 
    padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; color: var(--primary); 
}
.card-content { padding: 25px; display: flex; flex-direction: column; flex: 1; }
.card-meta { display: flex; gap: 15px; font-size: 13px; color: var(--text-light); margin-bottom: 10px; font-weight: 500; }
.card-content h3 { margin: 0 0 10px; font-size: 20px; font-weight: 700; line-height: 1.3; }
.card-content p { margin: 0 0 20px; font-size: 15px; color: var(--text-light); flex: 1; }
.read-more { font-weight: 700; color: var(--primary); font-size: 14px; display: flex; align-items: center; gap: 5px; }

/* ===== SINGLE POST UPGRADES ===== */
.post-container { 
    max-width: 800px; 
    margin: 50px auto; 
    background: var(--card); 
    padding: 40px; 
    border-radius: 20px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.03); 
    border: 1px solid var(--border); 
}
#postImage { width: 100%; display: block; margin: 0 auto 40px auto; border-radius: 12px; }
.post-tags span { 
    display: inline-block; background: var(--tag-bg); color: var(--primary); 
    padding: 5px 12px; border-radius: 6px; font-size: 13px; font-weight: 700; margin-right: 10px; margin-bottom: 15px; text-transform: uppercase; 
}
.post-header h1 { font-size: 38px; font-weight: 800; line-height: 1.2; margin: 0 0 20px; letter-spacing: -0.5px; }
.post-meta { font-size: 14px; color: var(--text-light); font-weight: 500; padding-bottom: 30px; border-bottom: 1px solid var(--border); margin-bottom: 30px; }

/* Content Styles */
.post-content { font-size: 18px; color: var(--text); line-height: 1.8; }
.post-content h2 { font-size: 28px; margin-top: 40px; margin-bottom: 15px; color: var(--text); }
.post-content h3 { font-size: 24px; margin-top: 30px; margin-bottom: 15px; color: var(--text); }
.post-content p { margin-bottom: 20px; }
.post-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 20px 0; }
.post-content blockquote { 
    border-left: 4px solid var(--primary); margin: 0; padding-left: 20px; 
    font-style: italic; color: var(--text-light); background: var(--bg); padding: 20px; border-radius: 0 8px 8px 0; 
}

.post-footer { margin-top: 50px; padding-top: 30px; border-top: 1px solid var(--border); }
.btn-back { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-light); text-decoration: none; }
.btn-back:hover { color: var(--primary); }

/* ===== PREMIUM READING TOOLS ===== */
.progress-container { position: fixed; top: 0; left: 0; width: 100%; height: 4px; background: transparent; z-index: 9999; }
.progress-bar { height: 100%; background: var(--primary); width: 0%; border-radius: 0 2px 2px 0; transition: width 0.1s ease-out; }

.post-wrapper { display: flex; gap: 40px; align-items: flex-start; position: relative; max-width: 1000px; margin: 50px auto; }
.share-panel { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 15px; padding-top: 20px; }
.share-title { font-size: 12px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; text-align: center; margin-bottom: 5px; }
.share-panel button {
    width: 45px; height: 45px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--text-light);
    font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.share-panel button:hover { background: var(--primary); color: white; border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2); }
.post-wrapper .post-container { margin: 0; flex: 1; }

/* ===== LOADING SKELETONS ===== */
.skeleton { background: var(--skeleton-bg); animation: pulse 1.5s infinite; border-color: transparent; min-height: 350px; }
.skeleton-text { height: 20px; background: var(--skeleton-bg); border-radius: 4px; margin-bottom: 15px; animation: pulse 1.5s infinite; }
.skeleton-text.small { width: 40%; }
@keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }
/* ==========================================
   ===== ULTIMATE MOBILE RESPONSIVE FIXES ===== 
   ========================================== */

@media (max-width: 900px) {
    /* 1. Header Fixes: Push search bar to its own row */
    .header-container { 
        flex-wrap: wrap; 
        height: auto; 
        padding: 15px 0; 
        gap: 15px; 
    }
    .header-search-container { 
        margin: 0; 
        flex: 1 1 100%; /* Forces the search bar to take full width */
        max-width: 100%; 
        order: 3; 
    }
    
    /* 2. Reading Page Layout Fixes */
    .post-wrapper { flex-direction: column; }
    .share-panel { 
        position: static; 
        flex-direction: row; 
        justify-content: center; 
        width: 100%; 
        margin-bottom: -10px; 
    }
    .share-title { display: none; }
}

@media (max-width: 768px) {
    .public-header nav { display: none; } 
    
    /* Header & Search Bar */
    .header-container { padding: 10px 15px !important; gap: 10px; }
    .header-search-container { width: 100%; margin: 5px 0 0 0; }
    .logo { font-size: 20px; }
    
    /* Hero Section */
    .blog-hero { padding: 40px 15px; width: 100%; }
    .blog-hero h1 { font-size: 28px; word-wrap: break-word; line-height: 1.2; }
    .blog-hero p { font-size: 15px; padding: 0 10px; }
    
    /* Blog Grid */
    .blog-section { padding: 30px 15px; }
    .blog-grid { grid-template-columns: 1fr; gap: 20px; } 
    
    /* Filters */
    .hero-topic-filters { gap: 8px; margin-top: 15px; }
    .filter-pill { padding: 6px 14px; font-size: 13px; }
}