﻿/* ================================================
   SPC Prayer.Com - Theme Enhancement CSS
   Modernizes design while preserving content
   ================================================ */

/* ===== ROOT VARIABLES ===== */
:root {
  --color-primary: #2C3E50;
  --color-secondary: #34495E;
  --color-accent: #9a6c2f;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F8F9FA;
  --color-text: #2C3E50;
  --color-text-light: #7F8C8D;
  --color-border: #E8EAED;
  --color-shadow: rgba(0, 0, 0, 0.04);
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== PWA CONTROLS CONTAINER ===== */
.pwa-controls {
  position: sticky;
  top: 70px;
  z-index: 999;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding: 1rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

#mainNav {
  padding-top: env(safe-area-inset-top);
}

.universal-footer {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.dark-mode .pwa-controls {
  background: rgba(26, 26, 26, 0.95);
  border-bottom-color: #3a3a3a;
}

@media (max-width: 768px) {
  .pwa-controls {
    top: 56px;
    padding: 0.75rem;
    gap: 0.5rem;
  }
}

/* ===== BODY & BACKGROUND IMPROVEMENTS ===== */
body {
  background-color: var(--color-bg) !important;
  color: var(--color-text) !important;
  line-height: 1.7 !important;
  transition: var(--transition);
  font-family: 'Lora', Georgia, serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body[style*="lightyellow"] {
  background-color: var(--color-bg) !important;
}

/* ===== IMPROVED CONTAINER & CARD DESIGN (Minimalist) ===== */
.col-md-8[style*="background-color"] {
  background-color: white !important;
  border: none !important;
  border-radius: var(--border-radius) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  padding: 3rem 2.5rem !important;
  margin-bottom: var(--spacing-lg);
  transition: var(--transition);
}

.col-md-8[style*="background-color"]:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04) !important;
  transform: translateY(-1px);
}

/* ===== NAVIGATION ENHANCEMENTS (Sleek & Minimalist) ===== */
#mainNav {
  position: fixed !important;
  background-color: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: var(--transition);
  border-bottom: 1px solid var(--color-border);
  width: 100%;
  z-index: 1030;
}

#mainNav.navbar-scrolled,
#mainNav.is-fixed,
#mainNav.is-visible {
  background-color: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.navbar-brand {
  color: var(--color-primary) !important;
  font-weight: 600 !important;
  transition: var(--transition);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-logo {
  height: 40px;
  width: 40px;
  object-fit: contain;
  border-radius: 50%;
}

.navbar-brand:hover,
.navbar-brand:focus {
  color: var(--color-accent) !important;
}

.nav-link {
  color: var(--color-text) !important;
  font-weight: 500;
  padding: 0.75rem 1rem !important;
  transition: var(--transition);
  border-radius: 8px;
  margin: 0 0.15rem;
  font-size: 0.95rem;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--color-accent) !important;
  background-color: var(--color-bg-alt);
}

/* Override all Clean Blog default navbar colors */
#mainNav .navbar-brand,
#mainNav.is-fixed .navbar-brand,
#mainNav.is-visible .navbar-brand {
  color: var(--color-primary) !important;
}

#mainNav .navbar-nav > li.nav-item > a,
#mainNav.is-fixed .navbar-nav > li.nav-item > a,
#mainNav.is-visible .navbar-nav > li.nav-item > a {
  color: var(--color-text) !important;
}

#mainNav .navbar-toggler {
  color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}

/* ===== DROPDOWN IMPROVEMENTS (Clean & Minimal) ===== */
.dropdown-menu {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
  margin-top: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

/* Scrollbar styling for dropdown */
.dropdown-menu::-webkit-scrollbar {
  width: 8px;
}

.dropdown-menu::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.dropdown-item {
  padding: 0.65rem 1rem !important;
  color: var(--color-text) !important;
  transition: var(--transition);
  font-size: 0.9rem !important;
  border-radius: 6px;
  margin-bottom: 0.15rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--color-bg-alt) !important;
  color: var(--color-accent) !important;
  padding-left: 1.2rem !important;
}

/* Fix deprecated font tags in dropdowns */
.dropdown-menu font {
  font-size: inherit !important;
}

/* ===== NESTED DROPDOWN SUBMENU ===== */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
  margin-left: 0.125rem;
}

.dropdown-submenu:hover > .dropdown-menu {
  display: block;
}

.dropdown-submenu > .dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  content: "";
  border-top: 0.3em solid transparent;
  border-right: 0;
  border-bottom: 0.3em solid transparent;
  border-left: 0.3em solid;
  float: right;
  margin-top: 0.5em;
}

/* Mobile nested dropdown */
@media (max-width: 991px) {
  .dropdown-submenu > .dropdown-menu {
    position: static;
    float: none;
    margin: 0.25rem 0 0 1rem;
    box-shadow: none;
    border: none;
    padding-left: 0.5rem;
  }
  
  .dropdown-submenu > .dropdown-toggle::after {
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
  }
}

/* ===== HEADER/MASTHEAD IMPROVEMENTS ===== */
.masthead {
  position: relative;
  min-height: 280px;
  padding: 5rem 0 3rem;
}

.masthead .overlay {
  background-color: rgba(0, 0, 0, 0.5);
}

.masthead .site-heading h2 {
  color: white !important;
  font-size: 2.8rem;
  text-shadow: 3px 3px 12px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6);
  margin-bottom: 0.8rem;
  font-weight: 700;
}

.masthead .site-heading h4 {
  color: white !important;
  font-size: 1.6rem;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 0, 0, 0.6);
  font-weight: 500;
}

/* ===== TYPOGRAPHY ENHANCEMENTS (Modern & Clean) ===== */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-primary);
  margin-bottom: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 {
  --color-primary: #6b421f;
  --color-secondary: #805226;
  padding-bottom: 0.75rem;
  --color-bg: #fffaf0;
  --color-bg-alt: #f7f1e5;
  --color-text: #4a3320;
  --color-text-light: #806544;
  --color-border: #dfcda9;
  color: var(--color-secondary);
  font-size: 1.5rem;
  font-weight: 500;
}

p {
  line-height: 1.7;
  margin-bottom: 1.25rem;
  color: var(--color-text);
  font-size: 1.05rem;
}

/* Better text justification */
p[style*="text-align: justify"] {
  text-align: justify;
  hyphens: auto;
}

/* ===== UNIVERSAL FOOTER STYLES - MINIMALIST PURPLE ===== */
.universal-footer {
  background: #9a6c2f !important;
  color: white !important;
  padding: 0.5rem 0 !important;
  margin-top: auto !important;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.06) !important;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
  width: 100%;
  flex-shrink: 0;
}

/* Ensure footer stays at bottom - Universal solution */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
}

/* All main content containers should grow to fill space */
.container,
.container-fluid,
.prayer-page-container,
.dashboard-container {
  flex: 1 0 auto !important;
}

/* Landing page palette: light yellow, warm and readable. */
body.dashboard-container:not(.dark-mode) {
  background: #fffbea !important;
  color: #4a3320 !important;
}

body.dashboard-container:not(.dark-mode) .dashboard-header {
  background: #f3e4b8 !important;
  color: #4a3320 !important;
  border-bottom: 1px solid #ddc98e;
}

body.dashboard-container:not(.dark-mode) .card,
body.dashboard-container:not(.dark-mode) .prayer-card,
body.dashboard-container:not(.dark-mode) .action-btn {
  background: #fffdf4 !important;
  color: #4a3320 !important;
  border-color: #e4d5a8 !important;
}

body.dashboard-container:not(.dark-mode) .card p,
body.dashboard-container:not(.dark-mode) .prayer-card-description,
body.dashboard-container:not(.dark-mode) .action-btn-label {
  color: #604b32 !important;
}

body.dashboard-container:not(.dark-mode) .category-title,
body.dashboard-container:not(.dark-mode) .gradient-text {
  color: #704a22 !important;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-bottom {
  text-align: center;
  padding: 0.3rem 0;
}

.footer-bottom p {
  margin: 0.1rem 0;
  font-size: 0.85rem;
  opacity: 0.95;
  color: white;
}

.footer-credit {
  display: inline-block;
  color: rgba(255, 244, 223, 0.42) !important;
  font-size: 0.68rem !important;
  font-style: normal;
  margin-left: 0.35rem;
  white-space: nowrap;
}

.universal-footer:hover .footer-credit {
  color: rgba(255, 244, 223, 0.55) !important;
}

.dark-mode .universal-footer {
  background: #805226 !important;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.2) !important;
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
  /* Footer responsive */
  .universal-footer {
    padding: 1.5rem 0 0 0;
    margin-top: 2rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
    padding-bottom: 1rem;
  }

  .footer-links a:hover {
    transform: none;
  }

  .footer-section h4 {
    font-size: 1.1rem;
  }

  /* Larger touch targets for mobile */
  .nav-link {
    padding: 1rem 1.2rem !important;
    font-size: 1.1rem;
  }
  
  .dropdown-item {
    padding: 0.9rem 1.5rem !important;
    font-size: 1rem !important;
  }
  
  /* Better mobile typography */
  body {
    font-size: 18px !important;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.8rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  .masthead .site-heading h2 {
    font-size: 2rem;
  }
  
  .masthead .site-heading h4 {
    font-size: 1.3rem;
  }
  
  /* Better mobile spacing */
  .col-md-8[style*="background-color"] {
    padding: var(--spacing-md) !important;
  }
  
  /* Hamburger menu improvements */
  .navbar-toggler {
    padding: 0.5rem 0.75rem;
    font-size: 1.25rem;
    border: 2px solid var(--color-primary) !important;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
  }
  
  .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
  }
  
  /* Mobile navbar background */
  #mainNav {
    background-color: rgba(255, 255, 255, 0.98) !important;
  }
  
  /* Mobile collapsed menu styling */
  .navbar-collapse {
    background-color: rgba(255, 255, 255, 0.98);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  
  /* Mobile nav items */
  .navbar-nav .nav-item {
    margin: 0.25rem 0;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem !important;
    color: var(--color-text) !important;
  }
  
  /* Mobile dropdown menu */
  .dropdown-menu {
    border: none;
    box-shadow: none;
    background-color: var(--color-bg-alt);
    margin-left: 1rem;
  }
}

@media (max-width: 576px) {
  body {
    font-size: 16px !important;
  }
  
  .masthead {
    min-height: 300px;
    padding: 6rem 0 3rem;
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
a:focus,
button:focus,
.nav-link:focus,
.dropdown-item:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Keyboard navigation visible focus */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  
  nav,
  footer,
  .navbar,
  .pwa-controls {
    display: none !important;
  }
  
  .masthead {
    display: none;
  }
  
  .col-md-8[style*="background-color"] {
    border: none !important;
    box-shadow: none !important;
  }
  
  h1, h2, h3, h4, h5, h6 {
    color: black !important;
    page-break-after: avoid;
  }
  
  p {
    page-break-inside: avoid;
  }
}

/* ===== SMOOTH SCROLLING ===== */
html {
  scroll-behavior: smooth;
}

/* ===== IMAGE IMPROVEMENTS ===== */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
}

.masthead {
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
}

/* ===== LOADING STATES ===== */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ===== UTILITY CLASSES ===== */
.text-primary {
  color: var(--color-primary) !important;
}

.text-secondary {
  color: var(--color-secondary) !important;
}

.bg-primary {
  background-color: var(--color-primary) !important;
}

.border-primary {
  border-color: var(--color-primary) !important;
}

/* ===== SKIP TO CONTENT (ACCESSIBILITY) ===== */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}

/* ===== REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== FOOTER MOBILE RESPONSIVE (SMALL SCREENS) ===== */
@media (max-width: 576px) {
  .footer-container {
    padding: 0 1.25rem;
  }

  .footer-content {
    gap: 1.75rem;
  }

  .footer-section h4 {
    font-size: 1.05rem;
    margin-bottom: 1rem;
  }

  .footer-bottom {
    padding: 1.5rem 0;
  }

  .footer-bottom p {
    font-size: 0.85rem;
  }
}

/* ===== PRINT - HIDE FOOTER ===== */
@media print {
  .universal-footer {
    display: none !important;
  }
}

