/* ===== CSS Variables ===== */
:root {
    --primary: #c8102e;
    --primary-dark: #a00d24;
    --secondary: #1a1a2e;
    --accent: #e94560;
    --bg: #f5f5f5;
    --white: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 20px rgba(0,0,0,0.15);
    --radius: 8px;
    --transition: all 0.3s ease;
}

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Noto Sans Devanagari', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* ===== Header ===== */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}
.logo a { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 50px; width: auto; }
.logo-text h1 {
    font-size: 1.6rem;
    color: var(--primary);
    font-weight: 700;
    line-height: 1.1;
}
.logo-text span {
    font-size: 0.75rem;
    color: var(--text-light);
    display: block;
    letter-spacing: 0.5px;
}
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.date-display {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
}
.admin-link {
    background: var(--primary);
    color: var(--white);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}
.admin-link:hover { background: var(--primary-dark); }
.user-link {
    background: transparent;
    color: var(--text);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid var(--border);
}
.user-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.signup-link {
    background: var(--primary);
    color: var(--white);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}
.signup-link:hover { background: var(--primary-dark); }

/* ===== Navigation ===== */
.navbar { border-top: 1px solid var(--border); }
.navbar ul { display: flex; list-style: none; gap: 0; }
.navbar li a {
    display: block;
    padding: 12px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}
.navbar li a:hover, .navbar li a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ===== Breaking News ===== */
.breaking-news {
    background: var(--primary);
    color: var(--white);
    padding: 10px 0;
}
.breaking-news .container { display: flex; align-items: center; gap: 15px; }
.breaking-label {
    background: var(--white);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
}
.ticker { overflow: hidden; flex: 1; }
.ticker-content { display: flex; gap: 50px; animation: ticker 20s linear infinite; }
.ticker-content span { white-space: nowrap; font-size: 0.9rem; }
@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ===== Main Content ===== */
.main-content { padding: 30px 0; }

/* ===== Hero Section ===== */
.hero-section { margin-bottom: 40px; }
.hero-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    height: 400px;
    box-shadow: var(--shadow-lg);
}
.hero-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    padding: 40px 30px 30px;
    color: var(--white);
}
.category-badge {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}
.hero-overlay h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    line-height: 1.3;
}
.hero-overlay p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 15px;
}
.hero-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.8;
}
.read-more {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

/* ===== Section Header ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}
.section-header h2 {
    font-size: 1.5rem;
    color: var(--secondary);
    position: relative;
}
.section-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--primary), transparent);
}

/* ===== News Grid ===== */
.news-section { margin-bottom: 40px; }
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}
.news-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}
.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.news-card-image {
    height: 180px;
    overflow: hidden;
}
.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}
.news-card:hover .news-card-image img { transform: scale(1.05); }
.news-card-content { padding: 20px; }
.news-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: var(--text-light);
}
.meta-right { display: flex; align-items: center; gap: 10px; }
.views-count, .comments-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-light);
}
.news-card h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Category News ===== */
.category-section { margin-bottom: 40px; }
.category-news {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}
.category-news-item {
    display: flex;
    gap: 15px;
    background: var(--white);
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}
.category-news-item:hover { box-shadow: var(--shadow-lg); }
.category-news-item img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.category-news-info { flex: 1; }
.category-news-info h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    line-height: 1.4;
}
.category-news-meta {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ===== Article Detail ===== */
.article-detail {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}
.article-header { margin-bottom: 25px; }
.article-header h1 {
    font-size: 2rem;
    color: var(--secondary);
    margin: 10px 0;
    line-height: 1.3;
}
.article-meta {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
    flex-wrap: wrap;
}
.article-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 25px;
}
.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
}
.article-body p { margin-bottom: 15px; }
.article-tags {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.tag {
    display: inline-block;
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 5px 5px 5px 0;
}
.article-share {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}
.share-buttons { display: flex; gap: 10px; }
.share-btn {
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius);
    color: var(--white);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}
.share-btn.fb { background: #1877f2; }
.share-btn.tw { background: #1da1f2; }
.share-btn.wa { background: #25d366; }
.share-btn:hover { opacity: 0.9; }

/* ===== Related News ===== */
.related-news { margin-bottom: 40px; }

/* ===== Footer ===== */
.footer {
    background: var(--secondary);
    color: var(--white);
    padding: 40px 0 0;
    margin-top: 50px;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-logo h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 10px;
}
.footer-logo p { opacity: 0.7; font-size: 0.9rem; }
.footer-links h4, .footer-contact h4 {
    margin-bottom: 15px;
    color: var(--primary);
}
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { opacity: 0.7; transition: var(--transition); }
.footer-links a:hover { opacity: 1; color: var(--primary); }
.footer-contact p { margin-bottom: 8px; opacity: 0.7; font-size: 0.9rem; }
.footer-bottom {
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* ===== Login Page ===== */
.login-page { background: linear-gradient(135deg, var(--secondary), var(--primary)); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.login-logo { margin-bottom: 30px; }
.login-logo h1 { font-size: 2rem; color: var(--primary); }
.login-logo span { display: block; color: var(--text-light); margin-top: 5px; }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(200,16,46,0.1);
}
.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.login-btn:hover { background: var(--primary-dark); }
.login-hint {
    margin-top: 15px;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ===== Admin Page ===== */
.admin-page { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 260px;
    background: var(--secondary);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header h2 { font-size: 1.5rem; color: var(--primary); }
.sidebar-header span { display: block; font-size: 0.85rem; opacity: 0.7; margin-top: 5px; }
.sidebar-nav { flex: 1; padding: 20px 0; }
.sidebar-nav ul { list-style: none; }
.sidebar-nav li a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
    font-size: 0.95rem;
}
.sidebar-nav li a:hover, .sidebar-nav li a.active {
    background: rgba(200,16,46,0.2);
    color: var(--white);
    border-left: 3px solid var(--primary);
}
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.view-site {
    display: block;
    text-align: center;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: var(--transition);
}
.view-site:hover { background: rgba(255,255,255,0.2); }
.logout-btn {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}
.logout-btn:hover { background: var(--primary-dark); }

/* ===== Admin Main ===== */
.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    background: var(--bg);
    min-height: 100vh;
}
.admin-section h2 {
    font-size: 1.8rem;
    color: var(--secondary);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}
.stat-card h3 { font-size: 2.5rem; color: var(--primary); }
.stat-card p { color: var(--text-light); font-size: 0.95rem; }

/* News Table */
.news-table {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.news-table-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.news-table-item:hover { background: #fafafa; }
.news-table-info { flex: 1; }
.news-table-info h4 { font-size: 1rem; margin-bottom: 5px; }
.news-table-info span { font-size: 0.85rem; color: var(--text-light); }
.news-table-actions { display: flex; gap: 10px; }
.btn {
    padding: 6px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}
.btn-edit { background: #1877f2; color: var(--white); }
.btn-delete { background: var(--primary); color: var(--white); }
.btn:hover { opacity: 0.85; }

/* Form Styles */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.submit-btn {
    padding: 14px 30px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.submit-btn:hover { background: var(--primary-dark); }

/* Categories List */
.categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
.category-item {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}
.category-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.category-item h4 { color: var(--primary); margin-bottom: 5px; }
.category-item p { font-size: 0.9rem; color: var(--text-light); }
.category-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }

/* ===== Admin Toolbar ===== */
.manage-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: var(--white);
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.manage-toolbar input, .manage-toolbar select {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    flex: 1;
    min-width: 180px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}
.pagination button {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}
.pagination button:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination span {
    font-weight: 600;
    color: var(--text-light);
}

/* Category Form */
.category-form {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}
.category-form input {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    flex: 1;
    min-width: 200px;
}

/* Checkbox in table */
.news-table-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}
.news-table-item.selected {
    background: #fff3f3;
}

/* Profile Card */
.profile-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.profile-info p {
    margin-bottom: 12px;
    font-size: 1rem;
}

/* ===== Comments Section ===== */
.comments-section {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}
.comments-section .section-header { margin-bottom: 20px; }
.comment-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; }
.comment-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.comment-form input, .comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    resize: vertical;
}
.comment-form input:focus, .comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(200,16,46,0.1);
}
.comment-form button {
    align-self: flex-start;
    padding: 12px 28px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.comment-form button:hover { background: var(--primary-dark); }
.comments-list { display: flex; flex-direction: column; gap: 18px; }
.comment-item {
    display: flex;
    gap: 14px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; padding-bottom: 0; }
.comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.comment-author { font-weight: 700; color: var(--secondary); }
.comment-date { font-size: 0.8rem; color: var(--text-light); }
.comment-text { color: var(--text); line-height: 1.6; margin-bottom: 8px; }
.comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}
.comment-like-btn:hover, .comment-like-btn.liked {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(200,16,46,0.06);
}
.no-comments { text-align: center; padding: 20px; color: var(--text-light); }

/* Responsive */
@media (max-width: 768px) {
    .comment-form-row { grid-template-columns: 1fr; }
    .comments-section { padding: 20px; }
    .header-top { flex-direction: column; gap: 10px; text-align: center; }
    .header-right { justify-content: center; }
    .navbar ul { flex-wrap: wrap; justify-content: center; }
    .navbar li a { padding: 10px 12px; font-size: 0.85rem; }
    .hero-card { height: 300px; }
    .hero-overlay h2 { font-size: 1.3rem; }
    .news-grid { grid-template-columns: 1fr; }
    .category-news { grid-template-columns: 1fr; }
    .admin-sidebar { width: 100%; position: relative; height: auto; }
    .admin-main { margin-left: 0; }
    .admin-page { flex-direction: column; }
    .form-row { grid-template-columns: 1fr; }
    .article-header h1 { font-size: 1.5rem; }
    .article-image { height: 250px; }
    .footer-content { grid-template-columns: 1fr; text-align: center; }
}
@media (max-width: 480px) {
    .hero-card { height: 250px; }
    .hero-overlay { padding: 20px; }
    .hero-overlay h2 { font-size: 1.1rem; }
    .article-detail { padding: 20px; }
    .stats-grid { grid-template-columns: 1fr; }
    .news-table-item { flex-direction: column; align-items: flex-start; gap: 10px; }
}
