/**
 * File: css/styles.css
 * Custom CSS styles for Pelham Family website
 */

/* Global styles */
body {
  font-family: 'Arial', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header with textured background */
.site-header {
  background-color: var(--primary);
  background-image: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23152a47' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
  opacity: 0.6;
}

.header-content {
  position: relative;
  z-index: 2;
}

/* Main content container */
.container {
  width: 100%;
  padding-right: var(--bs-gutter-x, 0.75rem);
  padding-left: var(--bs-gutter-x, 0.75rem);
  margin-right: auto;
  margin-left: auto;
}

main {
  flex: 1 0 auto;
  padding-bottom: 3rem;
}

footer {
  margin-top: auto;
}

/* Card styling with optimized transitions */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  border-radius: 8px;
  border: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  will-change: transform, box-shadow;
}

.contact-page .card {
  height: auto;
}

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

.card-img-top {
  height: 180px;
  object-fit: cover;
  background-color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.card-title {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.text-primary {
  color: var(--primary) !important;
}

/* News card styling */
.news-card {
  border-left: 4px solid var(--primary);
}

.news-date {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: bold;
}

/* Accent button with adequate contrast */
.btn-accent {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.btn-accent:hover {
  background-color: #b89630;
  border-color: #b89630;
  color: #000;
}

/* Primary login button styling */
.btn-login {
  background-color: var(--primary);
  color: #fff;
  border: none;
}

/* Login modal styling */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 5px;
  color: #757575;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.google-btn:hover {
  background-color: #f5f5f5;
}

.google-btn img {
  margin-right: 10px;
  height: 18px;
}

.form-divider {
  position: relative;
  text-align: center;
  margin: 20px 0;
}

.form-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: #ddd;
}

.form-divider span {
  position: relative;
  padding: 0 10px;
  background-color: white;
  color: #757575;
}

/* Modal centering fix */
.modal-dialog {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin: 0 auto;
}

.modal-content {
  margin: auto;
  max-width: 450px;
}

/* Make sure the modal background covers the entire screen */
.modal-backdrop {
  opacity: 0.5;
}

/* Loading placeholders */
.loading-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  width: 100%;
  background-color: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.loading-placeholder::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Stats cards */
.stats-card {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  height: 100%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  position: relative;
}

.stats-card h3 {
  color: var(--primary);
  font-size: 18px;
  margin-bottom: 15px;
}

.stats-card .number {
  font-size: 36px;
  font-weight: bold;
  color: var(--primary);
}

.stats-card .icon {
  font-size: 30px;
  color: var(--primary);
  opacity: 0.2;
  position: absolute;
  top: 20px;
  right: 20px;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--secondary);
  border-color: var(--secondary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .user-info {
    display: none;
  }
  
  .user-dropdown {
    margin-left: 0;
  }
  
  .card-img-top {
    height: 160px;
  }
}

@media (max-width: 576px) {
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  .card-img-top {
    height: 140px;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .container {
    width: 100%;
    max-width: 100%;
  }
  
  body {
    font-size: 12pt;
  }
  
  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* Theme toggle button */
#theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: #fff;
  cursor: pointer;
}

#theme-toggle .bi {
  font-size: 1.25rem;
}

/* Dark mode styles */
body.dark-mode {
  background-color: #121212;
  color: #f8f9fa;
}

body.dark-mode .card-title,
body.dark-mode .text-primary {
  color: #f8f9fa !important;
}

body.dark-mode .card,
body.dark-mode .modal-content {
  background-color: #1e1e1e;
  color: #f8f9fa;
}

body.dark-mode .navbar,
body.dark-mode footer,
body.dark-mode .site-header {
  background-color: #1e1e1e !important;
  color: #f8f9fa;
}

body.dark-mode .nav-link,
body.dark-mode .navbar-brand {
  color: #f8f9fa !important;
}

body.dark-mode a {
  color: #bb86fc;
}

body.dark-mode #theme-toggle {
  background-color: #333;
}
