@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

:root {
  --primary: #9e0000;
  --primary-hover: #7a0000;
  --secondary: #002147;
  --accent: #ff9900;
  --background: #f0f0f0;
  --card-bg: #ffffff;
  --text-main: #333333;
  --text-muted: #555555;
  --border-color: #cccccc;
  --border: #e2e8f0;          /* alias used in post.php widgets */
  --shadow: 0 2px 8px rgba(0,0,0,0.07);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.10);
  --radius: 4px;
  --radius-lg: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.5;
  transition: background-color 0.3s, color 0.3s;
}

a {
  text-decoration: none;
  color: #0000ee;
}

a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 10px;
}

/* Top Bar */
.top-bar {
  background-color: #333;
  color: #fff;
  font-size: 0.85rem;
  padding: 5px 0;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.top-bar a {
  color: #fff;
  margin-left: 15px;
  font-weight: 500;
}

.top-bar a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Header */
.main-header {
  background-color: var(--primary);
  color: white;
  padding: 20px 0;
  text-align: center;
}

.header-content {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo a {
  color: white;
  text-decoration: none;
  display: inline-block;
}

.logo a:hover {
  text-decoration: none;
}

.logo h1 {
  font-size: 2.8rem;
  font-weight: 700;
  color: white;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  margin-bottom: 2px;
  letter-spacing: 1px;
}

.logo p {
  font-size: 1.1rem;
  color: #ffcccc;
  font-weight: 700;
  letter-spacing: 2px;
}

/* Navigation */
.main-nav {
  background-color: var(--secondary);
  border-bottom: 4px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.main-nav ul {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
}

.main-nav a {
  color: white;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 15px;
  display: block;
  text-transform: uppercase;
}

.main-nav a:hover {
  background-color: var(--primary);
  text-decoration: none;
}

/* Search */
.search-bar {
  display: flex;
  padding: 8px 0;
}

.search-bar input {
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius) 0 0 var(--radius);
  outline: none;
  width: 200px;
  font-size: 0.95rem;
}

.search-bar button {
  padding: 6px 15px;
  background-color: var(--accent);
  color: #000;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-weight: 700;
}

.search-bar button:hover {
  background-color: #e68a00;
}

/* Live Search Autocomplete Dropdown */
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1001;
  max-height: 400px;
  overflow-y: auto;
  text-align: left;
}
.search-item {
  display: flex !important;
  flex-direction: column;
  padding: 10px 15px !important;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: var(--text-main) !important;
  transition: background 0.2s;
  text-transform: none !important;
  font-weight: normal !important;
}
.search-item:last-child {
  border-bottom: none;
}
.search-item:hover {
  background-color: #f8f9fa !important;
  text-decoration: none !important;
}
.search-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.search-item-empty {
  padding: 15px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

.pagination {
  margin-top: 20px;
}

.pagination .page-link {
  padding: 8px 12px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #0f172a;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.pagination .page-link:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination .page-link.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Marquee */
.marquee-container {
  background-color: #000;
  color: #fff;
  display: flex;
  align-items: stretch;
  border-bottom: 3px solid var(--primary);
}

.marquee-title {
  background-color: var(--primary);
  color: white;
  padding: 8px 15px;
  font-weight: 700;
  white-space: nowrap;
}

marquee {
  padding: 8px 0;
  font-weight: 500;
}

marquee a {
  color: #ffff00;
  margin-right: 30px;
}

marquee a:hover {
  color: #fff;
}

/* Trending Grid */
.trending-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 15px 0 25px;
}

.trending-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 15px;
  color: white;
  border-radius: var(--radius);
  font-weight: 700;
  text-align: center;
  border: 1px solid rgba(0,0,0,0.2);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  font-size: 0.95rem;
  line-height: 1.3;
  transition: transform 0.1s;
}

.trending-box:hover {
  color: white;
  text-decoration: none;
  transform: scale(1.02);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.trending-box i {
  margin-right: 8px;
  font-size: 1.2em;
}

/* Section Titles */
.section-title {
  background-color: var(--primary);
  color: white;
  padding: 8px 15px;
  margin: 25px 0 15px;
  border-radius: var(--radius);
  border-left: 5px solid var(--accent);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-title h2 {
  font-size: 1.3rem;
  margin: 0;
}

/* Grid & Cards */
.main-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.card {
  background-color: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.card-header {
  color: white;
  padding: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  border-bottom: 2px solid #fff;
}

/* Classic Sarkari Colors for Headers */
.bg-red { background-color: #a50000; }
.bg-green { background-color: #006600; }
.bg-blue { background-color: #003399; }
.bg-purple { background-color: #660066; }
.bg-orange { background-color: #cc6600; }
.bg-pink { background-color: #990033; }
.bg-teal { background-color: #006666; }
.bg-indigo { background-color: #330066; }
.bg-cyan { background-color: #006699; }

.card-body {
  padding: 0;
}

.card-body ul {
  list-style: none;
}

.card-body li {
  border-bottom: 1px solid #eee;
}

.card-body li:nth-child(even) {
  background-color: #fafafa;
}

.card-body li:last-child {
  border-bottom: none;
}

.card-body a {
  display: block;
  padding: 8px 12px;
  font-weight: 500;
  font-size: 0.95rem;
  color: #003399;
}

.card-body a:hover {
  background-color: #ffe6e6;
  color: var(--primary);
  text-decoration: underline;
}

/* Footer */
footer {
  background-color: #111;
  color: #ccc;
  padding: 40px 0 20px;
  margin-top: 40px;
  border-top: 5px solid var(--primary);
}

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

.footer-brand h2 {
  color: white;
  margin-bottom: 15px;
}

.footer-links h3 {
  color: white;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 5px;
  display: inline-block;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: #aaa;
}

.footer-links a:hover {
  color: white;
}

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

.social-links a {
  display: inline-block;
  background-color: #333;
  color: white;
  padding: 8px 12px;
  border-radius: var(--radius);
}

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

.footer-bottom {
  text-align: center;
  border-top: 1px solid #333;
  padding-top: 20px;
  font-size: 0.9rem;
}

/* Post Page Specific */
.post-header-card {
  background-color: white;
  border: 1px solid var(--border-color);
  padding: 20px;
  margin-bottom: 20px;
  border-top: 5px solid var(--primary);
}

.post-title {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 10px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 5px;
}

.post-content-wrap {
  background-color: white;
  border: 1px solid var(--border-color);
  padding: 20px;
}

.post-content table {
  width: 100% !important;
  border-collapse: collapse;
  margin: 20px 0;
}

.post-content th, .post-content td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
}

.post-content th {
  background-color: #f4f4f4;
  font-weight: 700;
}

.post-content h2, .post-content h3 {
  color: var(--primary);
  margin: 25px 0 15px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
  padding-bottom: 5px;
}

/* Custom Sections below post */
.custom-sections {
  margin-top: 30px;
}

.post-section h3 {
  background-color: var(--primary);
  color: white;
  padding: 10px;
  margin: 0;
  font-size: 1.1rem;
}

.post-section table {
  width: 100%;
  border-collapse: collapse;
}

.post-section td {
  border: 1px solid #ccc;
  padding: 10px;
}

.post-section a {
  color: #003399;
  font-weight: 700;
}

.post-section a:hover {
  color: var(--primary);
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .trending-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .trending-grid {
    grid-template-columns: 1fr;
  }
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  .logo h1 {
    font-size: 2.2rem;
  }
  .nav-content {
    flex-direction: column;
  }
  .main-nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }
  .search-bar {
    margin-top: 10px;
    width: 100%;
    justify-content: center;
  }
}

/* Dark Mode Theme */
body.dark-mode {
  --background: #121212;
  --card-bg: #1e1e1e;
  --text-main: #e0e0e0;
  --text-muted: #aaaaaa;
  --border-color: #333333;
}
body.dark-mode .sarkari-header-table,
body.dark-mode .post-content table,
body.dark-mode .card,
body.dark-mode .search-dropdown,
body.dark-mode .post-header-card,
body.dark-mode .post-content-wrap {
  background-color: var(--card-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-main);
}
body.dark-mode .sarkari-header-table td,
body.dark-mode .post-content td,
body.dark-mode .post-section td {
  border-color: var(--border-color) !important;
  color: var(--text-main);
}
body.dark-mode .post-content th {
  border-color: var(--border-color);
}
body.dark-mode .post-title-table {
  color: #fff;
}
body.dark-mode a {
  color: #66b3ff;
}
body.dark-mode .post-content td a {
  color: #ff8585;
}
body.dark-mode .card-body li:nth-child(even) {
  background-color: #1a1a1a;
}
body.dark-mode .card-body li {
  border-bottom-color: var(--border-color);
}
body.dark-mode .card-body a {
  color: #88c0d0;
}
body.dark-mode .card-body a:hover {
  background-color: #2a2a2a;
}
body.dark-mode .search-item:hover {
  background-color: #2a2a2a !important;
}
body.dark-mode .search-item {
  border-bottom-color: #333;
}
body.dark-mode .post-section table {
  background: var(--card-bg) !important;
}
body.dark-mode .seo-content {
  background: var(--card-bg) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}
body.dark-mode .seo-content h2,
body.dark-mode .seo-content h3 {
  color: #ffcc00 !important;
}
body.dark-mode .pagination .page-link {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-main);
}
body.dark-mode .pagination .page-link:hover,
body.dark-mode .pagination .page-link.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
