/* --- Variables & Theme Setup --- */
:root {
    /* Light Mode (Default) */
    --primary-color: #009688; /* Teal */
    --primary-hover: #00796b;
    --secondary-color: #f4f6f8; /* Very Light Grey/Blue */
    --bg-color: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --border-color: #e0e0e0;
}

[data-theme="dark"] {
    /* Dark Mode Overrides */
    --primary-color: #26a69a; /* Lighter Teal for dark mode */
    --primary-hover: #4db6ac;
    --secondary-color: #1e1e1e;
    --bg-color: #121212;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --card-bg: #1e1e1e;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.5);
    --border-color: #333333;
}

/* --- Base Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--primary-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}


/* Header/Navbar Container */


/* Brand Container */
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

/* Logo Image */
.brand-icon {
    /* This applies to the img element */
    height: 60px;
    width: auto;
    object-fit: contain;
}

/* Optional: Add hover effect */
.brand:hover h1.brand-icon {
    color: #555;
}

.brand:hover .highlight {
    color: #0056b3;
}


icon-btn{
    padding: 10px;
    background-color: #000000;
}
/* --- Navbar --- */
.navbar {
    background-color: none;
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(6px);
}

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

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-main);
}

.logo .highlight {
    color: var(--primary-color);
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main);
    padding: 8px;
    border-radius: 50%;
}

.icon-btn:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* --- Hero --- */
.hero {
    padding: 40px 0 20px;
    text-align: center;
}

.hero h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* --- Blog Grid --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0 60px;
}


/* ... Add this after the Hero section and before Blog Grid ... */

/* --- Filter Section --- */
.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-wrapper input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--secondary-color);
    color: var(--text-main);
    outline: none;
    font-size: 0.95rem;
}

.search-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.1);
}

.filter-controls {
    display: flex;
    gap: 15px;
}

.filter-controls select {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--secondary-color);
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    font-size: 0.9rem;
    min-width: 160px;
}

.filter-controls select:focus {
    border-color: var(--primary-color);
}

/* Mobile Responsiveness for Filters */
@media (max-width: 768px) {
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls {
        flex-direction: column;
    }
}


/* --- Blog Card --- */
.blog-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-img-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: var(--secondary-color);
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.card-content {
    padding: 20px;
}

.card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: inline-block;
    letter-spacing: 1px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

/* --- Loader --- */
.loader-container {
    display: flex;
    justify-content: center;
    padding: 50px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--secondary-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}


/* ... Previous CSS ... */

/* --- FOOTER STYLES --- */
.main-footer {
    background-color: var(--card-bg); /* Matches card background */
    border-top: 1px solid var(--border-color);
    padding-top: 50px;
    margin-top: 50px;
    color: var(--text-muted);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
}

.footer-col h3 {
    color: var(--text-main);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Brand Column */
.footer-logo {
    color: var(--text-main);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.social-links {
    margin-top: 15px;
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 35px;
    height: 35px;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-main);
    text-decoration: none;
    transition: 0.3s;
}

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

/* Links Column */
.links-col ul {
    list-style: none;
}

.links-col ul li {
    margin-bottom: 10px;
}

.links-col ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.2s;
}

.links-col ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px; /* slight shift effect */
}

/* Newsletter Column */
.newsletter-form {
    display: flex;
    margin-top: 15px;
}

.newsletter-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 6px 0 0 6px;
    outline: none;
    background: var(--secondary-color);
    color: var(--text-main);
}

.btn-subscribe {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 1rem;
}

.btn-subscribe:hover {
    background-color: var(--primary-hover);
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
}

/* --- MODAL STYLES --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto; /* 10% from the top and centered */
    padding: 30px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-body {
    margin-top: 20px;
    color: var(--text-main);
    line-height: 1.6;
}

.modal-body h3 {
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 1rem;
    color: var(--primary-color);
}


/* --- Ad Card Styling --- */
.ad-card {
    background-color: var(--card-bg); /* Matches your blog card bg */
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: 300px; /* Ensures it has height even while loading */
    overflow: hidden;
}

.ad-card iframe {
    border: none;
    overflow: hidden;
}
