@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --color-brand: #045198; /* Royal Blue */
  --color-brand-light: #068D55; /* Accent Green */
  --color-brand-dark: #0B5A5D; /* Teal */
  --color-accent: #03234E; /* Deep Blue for text/accents */
  --color-accent-light: #03234E; /* Deep Blue for text/accents */
  --color-theme-bg: #FCFCFC; /* White Background */
  --color-theme-bg-dark: #f1f5f9; /* Light off-white background */
  --color-glow: rgba(4, 81, 152, 0.15);
  --color-gray: #999FAA;
}

body {
  background-color: var(--color-theme-bg) !important;
  color: var(--color-accent) !important; /* Deep Blue text */
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--color-accent) !important; /* Deep Blue headings */
}

/* Base tailwind utility overrides for Light Theme */
.text-brand {
  color: var(--color-brand) !important; /* Royal Blue #045198 */
}
.text-brand-light {
  color: var(--color-brand-light) !important; /* Accent Green #068D55 */
}

.bg-brand {
  background-color: var(--color-brand) !important;
}
.bg-theme-bg {
  background-color: var(--color-theme-bg) !important;
}
.bg-theme-bg-dark {
  background-color: var(--color-theme-bg-dark) !important;
}
.bg-theme-bg-dark\/50 {
  background-color: rgba(3, 35, 78, 0.5) !important;
}

/* Transparent Background Overrides */
.bg-white\/5 {
  background-color: rgba(255, 255, 255, 0.05) !important;
}
.bg-white\/10 {
  background-color: rgba(255, 255, 255, 0.1) !important;
}
.bg-white\/20 {
  background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Border Overrides */
.border-white\/5, .border-white\/10, .border-white\/20, .border-white\/30 {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Features Grid background from section */
section[style*="background-color: rgba(6, 5, 21, 0.5)"] {
  background-color: rgba(3, 35, 78, 0.2) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Glassmorphism Overrides */
.glass-card {
  background-color: rgba(3, 35, 78, 0.35) !important;
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 1.5rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3) !important;
  transition: all 0.3s ease;
}
.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.45) !important;
  transform: translateY(-2px);
}

.glass-nav {
  background-color: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid rgba(4, 81, 152, 0.12) !important;
  backdrop-filter: blur(40px);
  border-radius: 1.25rem;
  box-shadow: 0 10px 35px -10px rgba(4, 81, 152, 0.1) !important;
}

/* Buttons */
.primary-button {
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  background-color: #045198 !important;
  color: #FCFCFC !important;
  box-shadow: 0 8px 25px rgba(4, 81, 152, 0.2) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(4, 81, 152, 0.2) !important;
}

.primary-button:hover {
  background-color: #03234E !important;
  box-shadow: 0 10px 30px rgba(4, 81, 152, 0.3) !important;
  transform: translateY(-2px);
}

/* Input Fields & Forms */
input, select, textarea {
  background-color: #ffffff !important;
  color: var(--color-accent) !important;
  border: 1px solid rgba(4, 81, 152, 0.2) !important;
}
select option {
  background-color: #ffffff !important;
  color: var(--color-accent) !important;
}
input::placeholder, textarea::placeholder {
  color: var(--color-gray) !important;
  opacity: 0.7;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--color-brand) !important;
  box-shadow: 0 0 0 4px rgba(4, 81, 152, 0.1) !important;
}

/* Custom CTA Button & Menu in Dynamic Details */
#cta-button {
  background: #045198 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 30px rgba(4, 81, 152, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
#cta-button svg {
  stroke: #ffffff !important;
}
#cta-menu {
  background: #045198 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3) !important;
}
#cta-menu li {
  color: #ffffff !important;
}
#cta-menu li:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Navbar active / hover overrides */
.hover\:text-purple-500:hover {
  color: #ffffff !important;
}
.text-purple-500 {
  color: #ffffff !important;
}
.bg-purple-950\/20 {
  background-color: rgba(255, 255, 255, 0.15) !important;
}
.border-purple-500\/20 {
  border-color: rgba(255, 255, 255, 0.25) !important;
}
.shadow-purple-500\/10 {
  box-shadow: 0 10px 15px -3px rgba(4, 81, 152, 0.15) !important;
}
.via-purple-500\/20 {
  --tw-gradient-stops: var(--tw-gradient-from), rgba(255, 255, 255, 0.15), var(--tw-gradient-to) !important;
}

/* Card Category Badges Overrides */
.bg-purple-500\/80 {
  background-color: #ffffff !important;
  color: #045198 !important;
}
.border-purple-400\/20 {
  border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Glow lightning animations */
.animate-lightning::before {
  background-color: rgba(255, 255, 255, 0.15) !important;
}

@keyframes lightning {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.05); }
}

/* Category Badge background custom override */
span.bg-brand\/20 {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

/* General panel / panels */
.bg-slate-900, .bg-gray-900, .bg-purple-950 {
  background-color: #045198 !important;
}
.border-slate-800, .border-gray-800, .border-purple-900 {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Focus Ring/Border Overrides */
.focus\:ring-purple-500:focus, .focus\:ring-2:focus {
  --tw-ring-color: #045198 !important;
  border-color: #045198 !important;
}

/* Custom input styling overrides to override inline styles */
input[style*="background-color: #181622"], select[style*="background-color: #181622"], textarea[style*="background-color: #181622"] {
  background-color: rgba(0, 0, 0, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

/* Accent texts like text-purple-400, text-purple-300 */
.text-purple-400, .text-purple-300 {
  color: #ffffff !important;
}

/* Inline purple background-color glows override */
div[style*="background-color: rgba(168, 85, 247"] {
  background-color: rgba(4, 81, 152, 0.1) !important;
}

/* Unlock / Login / Submit admin button styles */
button[class*="bg-gradient-to-r from-[#7c3aed] to-[#a855f7]"],
button[class*="from-purple-600 to-purple-400"],
div[class*="from-purple-600 to-purple-400"] {
  background: #ffffff !important;
  color: #045198 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.shadow-purple-500\/20 {
  box-shadow: 0 10px 15px -3px rgba(4, 81, 152, 0.2) !important;
}

.bg-purple-500\/10 {
  background-color: rgba(4, 81, 152, 0.1) !important;
}

.border-purple-500\/30 {
  border-color: rgba(4, 81, 152, 0.3) !important;
}

/* Green variations for Quick Add Content (Accent Green #068D55) */
.text-green-400, .text-green-600 {
  color: #068D55 !important;
}

.text-green-700 {
  color: #045c37 !important;
}

.bg-green-50 {
  background-color: rgba(4, 81, 152, 0.08) !important;
}

.bg-green-500\/10 {
  background-color: rgba(4, 81, 152, 0.1) !important;
}

.bg-green-500\/20, .hover\:bg-green-500\/20:hover {
  background-color: rgba(4, 81, 152, 0.2) !important;
}

.border-green-100 {
  border-color: rgba(4, 81, 152, 0.15) !important;
}

.border-green-200 {
  border-color: rgba(4, 81, 152, 0.25) !important;
}

.border-green-500\/30 {
  border-color: rgba(4, 81, 152, 0.3) !important;
}

/* Danger Glass Card & Modals */
.glass-card-danger {
  background-color: rgba(254, 242, 242, 0.9) !important; /* Soft rose red background */
  backdrop-filter: blur(24px);
  border: 1px solid rgba(239, 68, 68, 0.25) !important;
  border-radius: 1.5rem;
  box-shadow: 0 10px 30px -10px rgba(220, 38, 38, 0.08), 0 1px 3px rgba(220, 38, 38, 0.03) !important;
  transition: all 0.3s ease;
}
.glass-card-danger:hover {
  border-color: rgba(220, 38, 38, 0.5) !important;
  box-shadow: 0 20px 40px -15px rgba(220, 38, 38, 0.2) !important;
  transform: translateY(-2px);
}

.text-real-white {
  color: #ffffff !important;
}

/* --- Advertisement Popup Styles --- */
#ad-popup {
  background-color: #045198 !important;
  border: 1.5px solid #ffffff !important;
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.15) !important;
  border-radius: 1rem !important;
}

/* Ensure the heading (Company Name) is fully visible, crisp, and brand-aligned */
#ad-popup h4 {
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 0.875rem !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.25rem !important;
}

/* Ensure description is clean and readable on dark bg */
#ad-popup p {
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 0.75rem !important;
  line-height: 1.4 !important;
}

/* Restore translucent backgrounds/borders for close button against dark bg */
#ad-popup .bg-white\/5 {
  background-color: rgba(255, 255, 255, 0.08) !important;
}
#ad-popup .bg-white\/5:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
}
#ad-popup .bg-white\/10 {
  background-color: rgba(255, 255, 255, 0.15) !important;
}
#ad-popup .bg-white\/10:hover {
  background-color: rgba(255, 255, 255, 0.25) !important;
}
#ad-popup .border-white\/10 {
  border-color: rgba(255, 255, 255, 0.15) !important;
}
#ad-popup .text-gray-400 {
  color: #94a3b8 !important;
}
#ad-popup .hover\:text-white:hover {
  color: #ffffff !important;
}

/* AI Fetch Dropdown Custom Styles */
.fetch-dropdown-btn {
  background-color: #ffffff !important;
  color: #045198 !important;
  border: 1.5px solid #ffffff !important;
  box-shadow: 0 4px 12px rgba(4, 81, 152, 0.2) !important;
}

.fetch-dropdown-btn:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 6px 16px rgba(4, 81, 152, 0.3) !important;
}

.fetch-dropdown-menu {
  background-color: #045198 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 10px 30px rgba(4, 81, 152, 0.3) !important;
}

.fetch-dropdown-item {
  color: #ffffff !important;
  transition: all 0.2s ease;
}

.fetch-dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.fetch-dropdown-item svg {
  stroke: #ffffff !important;
}

/* ==========================================================
   Text Container Fitting and Responsive Wrapping Enhancements
   ========================================================== */

/* Universal word wrap & break settings to prevent overflows */
p, h1, h2, h3, h4, h5, h6, span, a, div, li, td, th {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: normal !important;
}

/* Ensure flex/grid layout items don't stretch beyond containers when holding long strings */
.glass-card, .card, div, section, article {
  min-width: 0;
}

/* Standard Line Clamping utilities for older Tailwind versions */
.line-clamp-1 {
  display: -webkit-box !important;
  -webkit-line-clamp: 1 !important;
  line-clamp: 1 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.line-clamp-2 {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.line-clamp-3 {
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.line-clamp-4 {
  display: -webkit-box !important;
  -webkit-line-clamp: 4 !important;
  line-clamp: 4 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.line-clamp-5 {
  display: -webkit-box !important;
  -webkit-line-clamp: 5 !important;
  line-clamp: 5 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.line-clamp-6 {
  display: -webkit-box !important;
  -webkit-line-clamp: 6 !important;
  line-clamp: 6 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Table Horizontal Overflow protection */
.overflow-x-auto {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* Details Page Header Container fit optimization on mobile */
@media (max-width: 640px) {
  #news-container > div:first-child,
  #event-container > div:first-child,
  #fact-container > div:first-child {
    height: auto !important;
    min-height: 360px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    padding-top: 4rem !important;
  }
  
  #news-container > div:first-child > div.absolute.bottom-6,
  #event-container > div:first-child > div.absolute.bottom-6,
  #fact-container > div:first-child > div.absolute.bottom-6 {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    padding: 1.5rem !important;
    width: 100% !important;
    z-index: 30 !important;
  }
  
  #news-container h1,
  #event-container h1,
  #fact-container h1 {
    font-size: 1.5rem !important; /* Scale down titles on mobile */
    line-height: 1.25 !important;
    margin-top: 0.5rem !important;
  }
}

/* ==========================================================
   Global Style Overrides for White & #045198 Theme
   ========================================================== */

/* Force all dark text to Deep Blue */
.text-gray-950, .text-gray-900, .text-slate-900, .text-gray-800, .text-slate-800, .text-gray-700, .text-slate-700 {
  color: #03234E !important;
}
.text-gray-600, .text-slate-600, .text-gray-500, .text-slate-500 {
  color: #03234E !important;
  opacity: 0.8 !important;
}
.text-gray-400, .text-slate-400, .text-gray-300, .text-slate-300, .text-gray-200, .text-slate-200, .text-gray-100, .text-slate-100 {
  color: #03234E !important;
  opacity: 0.65 !important;
}

/* Force gray/slate backgrounds to light theme background */
.bg-gray-50, .bg-slate-50, .bg-gray-100, .bg-slate-100, .bg-gray-200, .bg-slate-200 {
  background-color: var(--color-theme-bg-dark) !important;
  border-color: rgba(3, 35, 78, 0.1) !important;
}

/* Override all glass cards and inline white dialog/modal elements to light glassmorphism */
.glass-card.bg-white, .glass-card {
  background-color: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(4, 81, 152, 0.12) !important;
  color: var(--color-accent) !important;
}

div.glass-card[style*="background-color: rgba(255, 255, 255"],
div.glass-card[style*="background-color: #ffffff"],
div[style*="background-color: rgba(255, 255, 255"],
div[style*="background-color: #ffffff"],
div[style*="background-color: #fff"] {
  background-color: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(4, 81, 152, 0.12) !important;
  color: var(--color-accent) !important;
}

/* Input overlays */
input[style*="background-color: rgba(30, 41, 59, 0.5)"],
input[style*="background-color: rgba(30, 41, 59"],
textarea[style*="background-color: rgba(30, 41, 59"] {
  background-color: #ffffff !important;
  color: var(--color-accent) !important;
  border-color: rgba(4, 81, 152, 0.2) !important;
}

/* Override inline text colors that are slate/black */
span[style*="color: #0f172a"],
span[style*="color: #1e293b"],
span[style*="color: #000"],
strong[style*="color: #0f172a"] {
  color: var(--color-accent) !important;
}


/* Navbar text overrides for white theme */
.glass-nav a {
  color: rgba(3, 35, 78, 0.6) !important;
}
.glass-nav a:hover,
.glass-nav a.text-white {
  color: #03234E !important;
}
.glass-nav span.text-white\/30 {
  color: rgba(3, 35, 78, 0.2) !important;
}
.glass-nav span.text-base {
  color: #03234E !important;
}

/* Footer overrides for white theme */
footer.w-full {
  background-color: var(--color-theme-bg-dark) !important;
  border-top: 1px solid rgba(4, 81, 152, 0.1) !important;
}
footer.w-full,
footer.w-full a,
footer.w-full div,
footer.w-full span {
  color: var(--color-accent) !important;
}
footer.w-full a:hover {
  color: var(--color-brand) !important;
}
footer.w-full .text-white\/50,
footer.w-full .text-white\/70,
footer.w-full .text-white\/60,
footer.w-full .text-white\/30 {
  color: rgba(3, 35, 78, 0.6) !important;
}

/* Prevent fixed navbar from overlapping page content on desktop devices */
@media (min-width: 768px) {
  .pt-32 {
    padding-top: 10rem !important; /* Increase from 8rem (pt-32) to 10rem to clear the 136px high navbar */
  }
}
