/* Custom CSS for Puskesmas Wara Website */

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

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: #333;
}

/* Custom Colors */
:root {
  --primary-color: #2c5aa0;
  --secondary-color: #1e3a5f;
  --accent-color: #4caf50;
  --light-bg: #f8f9fa;
  --dark-bg: #212529;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
}

/* Navigation Styles */
.navbar {
  transition: all 0.3s ease;
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 600;
}

.navbar-nav .nav-link {
  font-weight: 500;
  margin: 0 0.5rem;
  transition: color 0.3s ease;
  position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary-color) !important;
}

.navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 50%;
  background-color: var(--primary-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
  width: 100%;
}

/* Hero Section - Full Width */
.hero-section-fullwidth {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  margin-top: 76px; /* Account for fixed navbar */
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgb(50 70 99 / 49%) 0%, rgba(30, 58, 95, 0.7) 100%);
  z-index: 2;
}

.hero-content-overlay {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}

.hero-content-overlay h1 {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease-out;
}

.hero-content-overlay p {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-content-overlay .btn {
  animation: fadeInUp 1s ease-out 0.4s both;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Legacy Hero Section (keep for other pages) */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
}

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

.hero-image img {
  max-width: 100%;
  height: auto;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Button Styles */
.btn {
  border-radius: 50px;
  font-weight: 500;
  padding: 12px 30px;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(45deg, var(--primary-color), #3d6bb3);
  border: none;
  box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(45deg, #1e3a5f, var(--primary-color));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(44, 90, 160, 0.4);
}

.btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: white;
  transform: translateY(-2px);
}

/* Card Styles */
.card {
  border-radius: 15px;
  transition: all 0.3s ease;
  border: none;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}

.card-img-top {
  border-radius: 15px 15px 0 0;
  height: 200px;
  object-fit: cover;
}

/* Service Cards */
.service-card {
  background: white;
  border-radius: 15px;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.service-icon {
  transition: all 0.3s ease;
}

.service-card:hover .service-icon i {
  transform: scale(1.1);
  color: var(--accent-color) !important;
}

/* Icon Box */
.icon-box {
  transition: all 0.3s ease;
}

.card:hover .icon-box i {
  transform: scale(1.1);
  color: var(--accent-color) !important;
}

/* Section Spacing */
section {
  padding: 80px 0;
}

/* Background Variations */
.bg-light {
  background-color: var(--light-bg) !important;
}

/* Typography */
.display-4,
.display-5 {
  font-weight: 700;
}

.lead {
  font-size: 1.1rem;
  font-weight: 400;
}

/* Footer */
footer {
  background: var(--dark-bg) !important;
}

footer a:hover {
  color: var(--primary-color) !important;
  transition: color 0.3s ease;
}

.social-links a {
  display: inline-block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.social-links a:hover {
  background: var(--primary-color);
  color: white !important;
  transform: translateY(-2px);
}

/* Animations */
.fade-in {
  animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Lightbox Styles */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  transform: scale(0.8);
  transition: transform 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.lightbox-overlay.active .lightbox-content {
  transform: scale(1);
}

.lightbox-image {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: block;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: -40px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10000;
}

.lightbox-close:hover {
  background: white;
  transform: scale(1.1);
}

.lightbox-title {
  position: absolute;
  bottom: -50px;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  font-size: 16px;
  font-weight: 500;
  padding: 10px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10000;
}

.lightbox-nav:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: -60px;
}

.lightbox-next {
  right: -60px;
}

.lightbox-counter {
  position: absolute;
  top: -40px;
  left: 0;
  color: white;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.7);
  padding: 5px 10px;
  border-radius: 4px;
}

/* Lightbox Scrollbar Styling */
.lightbox-content::-webkit-scrollbar {
  width: 8px;
}

.lightbox-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.lightbox-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.lightbox-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Responsive Lightbox */
@media (max-width: 768px) {
  .lightbox-content {
    max-width: 95%;
    max-height: 85%;
  }
  
  .lightbox-close {
    top: -30px;
    right: -10px;
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
  
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .lightbox-prev {
    left: -50px;
  }
  
  .lightbox-next {
    right: -50px;
  }
  
  .lightbox-title {
    bottom: -40px;
    font-size: 14px;
  }
  
  .lightbox-counter {
    top: -30px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .lightbox-content {
    max-width: 98%;
    max-height: 80%;
  }
  
  .lightbox-close {
    top: -25px;
    right: -5px;
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
  
  .lightbox-nav {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }
  
  .lightbox-prev {
    left: -40px;
  }
  
  .lightbox-next {
    right: -40px;
  }
  
  .lightbox-title {
    bottom: -35px;
    font-size: 12px;
    padding: 8px;
  }
}

/* Lightbox Image Hover Effect */
.lightbox-image:hover {
  transform: scale(1.02);
  transition: transform 0.3s ease;
}

/* Loading Animation for Lightbox */
.lightbox-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 18px;
}

.lightbox-loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-left: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section {
    text-align: center;
    padding: 100px 0 50px;
  }

  .hero-section-fullwidth {
    margin-top: 56px; /* Smaller navbar on mobile */
  }

  .hero-content-overlay {
    padding: 1rem 0;
  }

  .hero-content-overlay h1 {
    font-size: 2.5rem;
  }

  .hero-content-overlay p {
    font-size: 1rem;
    margin-bottom: 2rem !important;
  }

  .display-4 {
    font-size: 2.5rem;
  }

  .btn-lg {
    padding: 10px 25px;
    font-size: 1rem;
  }

  section {
    padding: 60px 0;
  }

  .card-img-top {
    height: 180px;
  }
}

@media (max-width: 576px) {
  .hero-content-overlay h1 {
    font-size: 2rem;
  }

  .hero-content-overlay .btn {
    width: 100%;
    margin-bottom: 1rem;
  }

  .hero-content-overlay .d-flex {
    flex-direction: column;
  }

  .display-4 {
    font-size: 2rem;
  }

  .hero-section {
    padding: 80px 0 40px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  section {
    padding: 40px 0;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Loading Animation */
.loading {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.loading.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Utility Classes */
.text-primary {
  color: var(--primary-color) !important;
}

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

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

/* Image Hover Effects */
.img-hover {
  transition: all 0.3s ease;
  overflow: hidden;
  border-radius: 15px;
}

.img-hover img {
  transition: all 0.3s ease;
}

.img-hover:hover img {
  transform: scale(1.05);
}

/* Shadow Utilities */
.shadow-custom {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

.shadow-hover {
  transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15) !important;
}
