:root {
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary-color: #dc2626; /* News Red */
    --primary-hover: #b91c1c;
    --border-color: #e2e8f0;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Main Container */
.container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Slider Section */
.slider-section {
    margin-bottom: 50px;
}

.slider-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

.slider {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    background: #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-size: cover;
    background-position: center;
}

.slide.active {
    opacity: 1;
}

.slide::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.slide-content {
    position: relative;
    padding: 30px;
    z-index: 1;
}

.slide-content h2 {
    color: white;
    font-size: 2rem;
    margin: 0 0 10px 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.slide-content h2 a {
    color: white;
    text-decoration: none;
}

.slide-content h2 a:hover {
    text-decoration: underline;
}

.slider-controls {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 2;
    display: flex;
    gap: 10px;
}

.slider-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid white;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(4px);
}
.slider-btn:hover { background: white; color: black; }

/* Grid Section */
.grid-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    border-left: 4px solid var(--text-main);
    padding-left: 10px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.post-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.card-img-placeholder {
    height: 200px;
    background: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: 500;
}

.card-body {
    padding: 20px;
}

.post-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
}

.post-card h3 a {
    color: var(--text-main);
    text-decoration: none;
}
.post-card h3 a:hover {
    color: var(--primary-color);
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.post-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Single Post */
.single-post-container {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.single-post-title {
    font-size: 2.5rem;
    margin-top: 0;
    color: var(--text-main);
}

.single-post-content {
    font-size: 1.1rem;
    color: #334155;
}

/* --- Admin Panel Styles --- */
.admin-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 30px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.admin-header h2 {
    margin: 0;
    color: var(--text-main);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-danger {
    background: #ef4444;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.85rem;
}

td {
    color: var(--text-main);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-light);
    color: var(--text-main);
    font-family: inherit;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.login-box {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.login-box h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
    color: var(--text-main);
}

/* --- Admin Sidebar Layout --- */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-light);
}

.admin-sidebar {
    width: 250px;
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.admin-sidebar-header {
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.admin-sidebar-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.admin-nav {
    display: flex;
    flex-direction: column;
}

.admin-nav a {
    padding: 15px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.admin-nav a:hover, .admin-nav a.active {
    background: #f1f5f9;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.admin-main {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

/* Adjust old admin container to fit in main */
.admin-main .admin-container {
    margin: 0;
    max-width: 100%;
}

/* --- Frontend Layout with Sidebar --- */
.frontend-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0; /* Prevent flex overflow */
}

.frontend-sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .frontend-layout {
        flex-direction: column;
    }
    .frontend-sidebar {
        width: 100%;
    }
}

/* Sidebar Widgets */
.sidebar-widget {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.widget-title {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-main);
}

.widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.widget-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.widget-list a {
    color: #475569;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
}

.widget-list a:hover {
    color: var(--primary-color);
}

.widget-list .post-date {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* Related Posts */
.related-posts-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.related-posts-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}

.related-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.related-img {
    height: 140px;
    background-size: cover;
    background-position: center;
}

.related-content {
    padding: 15px;
}

.related-content h4 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
}

.related-content a {
    color: var(--text-main);
    text-decoration: none;
}

.related-content a:hover {
    color: var(--primary-color);
}
