/* --- Global Styles & Variables --- */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --text-color: #34495e;
    --white-color: #ffffff;
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Roboto', sans-serif;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-secondary); color: var(--text-color); line-height: 1.6; background-color: var(--light-color); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--font-primary); color: var(--dark-color); font-weight: 700; }
a { text-decoration: none; color: var(--primary-color); transition: color 0.3s ease; }
a:hover { color: var(--secondary-color); }
img { max-width: 100%; height: auto; }

/* --- Header & Navigation --- */
.main-header { background: var(--white-color); box-shadow: 0 2px 15px rgba(0,0,0,0.08); padding: 1rem 0; position: sticky; top: 0; z-index: 1000; }
.main-header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: var(--font-primary); font-size: 1.8rem; font-weight: 700; color: var(--dark-color); }
.main-nav ul { list-style: none; display: flex; gap: 2rem; }
.main-nav a { font-weight: 600; color: var(--text-color); font-size: 1rem; padding: 0.5rem 0; position: relative; }
.main-nav a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 3px; background-color: var(--primary-color); transition: width 0.3s ease; }
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.search-bar { display: flex; }
.search-bar input { border: 1px solid #ddd; border-right: none; padding: 0.5rem; border-radius: var(--border-radius) 0 0 var(--border-radius); }
.search-bar button { background: var(--primary-color); border: none; color: white; padding: 0.5rem 1rem; cursor: pointer; border-radius: 0 var(--border-radius) var(--border-radius) 0; }
.btn { padding: 0.6rem 1.2rem; border-radius: var(--border-radius); font-weight: 600; transition: all 0.3s ease; }
.btn-login { background: transparent; border: 2px solid var(--primary-color); color: var(--primary-color); }
.btn-login:hover { background: var(--primary-color); color: var(--white-color); }
.btn-signup { background: var(--primary-color); color: var(--white-color); border: 2px solid var(--primary-color); }
.btn-signup:hover { background: var(--secondary-color); border-color: var(--secondary-color); }
.mobile-menu-toggle { display: none; background: none; border: none; cursor: pointer; z-index: 1001; }
.mobile-menu-toggle span { display: block; width: 25px; height: 3px; background: var(--dark-color); margin: 5px 0; transition: all 0.3s ease-in-out; }
.mobile-side-menu { display: none; }

/* --- Hero Banner --- */
.hero-banner { position: relative; height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--white-color); overflow: hidden; }
.hero-background { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: url('https://images.unsplash.com/photo-1557804506-669a67965ba0?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb&w=2400') no-repeat center center/cover; filter: brightness(0.5); animation: zoomIn 20s infinite alternate; z-index: -1; }
@keyframes zoomIn { from { transform: scale(1); } to { transform: scale(1.1); } }
.hero-content { animation: fadeInDown 1s ease-out; }
.hero-content h1 { font-size: 3.5rem; color: var(--white-color); margin-bottom: 0.5rem; }
.hero-content p { font-size: 1.2rem; color: var(--light-color); }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* --- Blog Grid --- */
.blog-grid-section { padding: 4rem 0; }
.blog-grid-section h2 { text-align: center; font-size: 2.5rem; margin-bottom: 3rem; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }
.blog-card { background: var(--white-color); border-radius: var(--border-radius); box-shadow: var(--shadow); overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.blog-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.15); }
.card-link { display: block; color: inherit; }
.card-image { width: 100%; height: 200px; object-fit: cover; }
.card-content { padding: 1.5rem; }
.card-title { font-size: 1.3rem; margin-bottom: 0.5rem; line-height: 1.3; }
.card-excerpt { font-size: 0.95rem; margin-bottom: 1rem; color: #666; }
.read-more { font-weight: 700; color: var(--primary-color); display: inline-block; }

/* --- Single Post Page --- */
.single-post-page { padding: 4rem 0; }
.single-post-page .container { max-width: 800px; background: var(--white-color); padding: 3rem; border-radius: var(--border-radius); box-shadow: var(--shadow); }
.post-header { text-align: center; margin-bottom: 2rem; }
.post-title { font-size: 2.8rem; line-height: 1.2; margin-bottom: 1rem; }
.post-meta { font-size: 0.9rem; color: #777; }
.post-meta span { margin: 0 0.5rem; }
.post-featured-image { width: 100%; height: auto; border-radius: var(--border-radius); margin-bottom: 2rem; }
.post-content { font-size: 1.1rem; line-height: 1.8; }
.post-content p, .post-content ul, .post-content h3 { margin-bottom: 1.5rem; }
.post-content img { border-radius: var(--border-radius); margin: 1rem 0; }
.post-content ul { padding-left: 20px; }
.post-footer { margin-top: 3rem; border-top: 1px solid #eee; padding-top: 2rem; }
.tags .tag { display: inline-block; background: #eee; padding: 0.3rem 0.8rem; border-radius: 20px; margin-right: 0.5rem; font-size: 0.8rem; }

/* --- Footer --- */
.main-footer { background: var(--dark-color); color: var(--light-color); padding: 2rem 0; margin-top: 3rem; }
.footer-content { display: flex; justify-content: space-between; align-items: center; }
.social-links a { color: var(--light-color); margin-left: 1rem; }

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .main-nav, .header-actions .search-bar, .header-actions .btn { display: none; }
    .mobile-menu-toggle { display: block; }
    .mobile-side-menu { display: block; position: fixed; top: 0; left: 0; width: 280px; height: 100%; background: var(--white-color); box-shadow: var(--shadow); transform: translateX(-100%); transition: transform 0.3s ease-in-out; padding: 6rem 2rem 2rem; z-index: 999; }
    .mobile-side-menu.active { transform: translateX(0); }
    .mobile-side-menu ul { list-style: none; }
    .mobile-side-menu li { margin-bottom: 1.5rem; }
    .mobile-side-menu a { font-size: 1.2rem; font-weight: 600; color: var(--dark-color); }
    .mobile-side-menu .btn { display: inline-block; }
    .hero-content h1 { font-size: 2.5rem; }
    .single-post-page .container { padding: 1.5rem; }
    .post-title { font-size: 2rem; }
    .footer-content { flex-direction: column; gap: 1rem; }
}
/* --- Authentication Page Styles --- */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 85vh;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.auth-container {
    position: relative;
    max-width: 450px;
    width: 100%;
}

.auth-form-container {
    background: var(--white-color);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.auth-form-container.hidden {
    display: none;
}

.form-card {
    text-align: center;
}

.form-title {
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-subtitle {
    font-size: 1rem;
    color: #777;
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.input-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.btn-full {
    width: 100%;
    padding: 0.9rem;
    font-size: 1.1rem;
}
.btn-primary {
    background: var(--primary-color);
    color: var(--white-color);
    border: 2px solid var(--primary-color);
}
.btn-primary:hover {
    background: #2980b9;
    border-color: #2980b9;
}

.form-toggle-text {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: #555;
}

.form-toggle-text a {
    font-weight: 600;
    color: var(--primary-color);
}

.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.95rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.welcome-user {
    font-weight: 600;
    color: var(--dark-color);
    margin-right: 1rem;
}

/* Update Header Actions for Logged in state */
.header-actions {
    gap: 1.5rem; /* A bit more space when logged in */
}