/*
Theme Name: Imdad Portal
Author: Imdad Portal Team
Description: Pakistan's largest government opportunities portal - WordPress theme. Discover scholarships, subsidies, loans, solar programs, BISP, Ehsaas, housing and more. Check eligibility instantly and apply through official channels.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: imdad-portal
Tags: government, portal, schemes, scholarships, pakistan, one-column, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   Base Theme Styles
   ========================================================================== */

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* WordPress alignment classes */
.alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(-50vw + 50%);
}

.alignwide {
  width: 100vw;
  max-width: 80rem;
  margin-left: calc(-40rem + 50%);
}

/* Line clamp utilities */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Intersection Observer animation trigger */
.observe-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.observe-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Marquee Animation
   ========================================================================== */

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

.animate-marquee {
  animation: marquee 30s linear infinite;
}

.animate-marquee:hover {
  animation-play-state: paused;
}

/* ==========================================================================
   Scrollbar Utilities
   ========================================================================== */

.scrollbar-none::-webkit-scrollbar {
  display: none;
}

.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #059669;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #047857;
}

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

/* ==========================================================================
   Glassmorphism
   ========================================================================== */

.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Emerald Gradient Text
   ========================================================================== */

.text-gradient-emerald {
  background: linear-gradient(135deg, #059669, #047857);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================================================
   Safe Area Padding (iOS)
   ========================================================================== */

.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.safe-area-top {
  padding-top: env(safe-area-inset-top, 0px);
}

/* ==========================================================================
   Fade In Up Animation
   ========================================================================== */

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

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

/* ==========================================================================
   Fade In Animation
   ========================================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* ==========================================================================
   Slide In Left Animation
   ========================================================================== */

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-left {
  animation: slideInLeft 0.4s ease-out forwards;
}

/* ==========================================================================
   Slide In Right Animation
   ========================================================================== */

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

.animate-slide-right {
  animation: slideInRight 0.4s ease-out forwards;
}

/* ==========================================================================
   Scale In Animation
   ========================================================================== */

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scale-in {
  animation: scaleIn 0.3s ease-out forwards;
}

/* ==========================================================================
   Pulse Glow Animation
   ========================================================================== */

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(5, 150, 105, 0);
  }
}

.animate-pulse-glow {
  animation: pulse-glow 2s infinite;
}

/* ==========================================================================
   Stagger Children Animation
   ========================================================================== */

.stagger-children > * {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 0.4s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.45s; }
.stagger-children > *:nth-child(11) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(12) { animation-delay: 0.55s; }

/* ==========================================================================
   Hover Lift Effect
   ========================================================================== */

.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* ==========================================================================
   Card Hover Effect
   ========================================================================== */

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

.card-hover:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Scheme Card Icon Scale on Hover
   ========================================================================== */

.scheme-card:hover .scheme-icon {
  transform: scale(1.1);
}

.scheme-icon {
  transition: transform 0.3s ease;
}

/* ==========================================================================
   Counter Animation
   ========================================================================== */

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

/* ==========================================================================
   Mobile Menu Animation
   ========================================================================== */

.mobile-menu-enter {
  animation: mobileMenuEnter 0.3s cubic-bezier(0.04, 0.62, 0.23, 0.98) forwards;
}

.mobile-menu-exit {
  animation: mobileMenuExit 0.2s cubic-bezier(0.04, 0.62, 0.23, 0.98) forwards;
}

@keyframes mobileMenuEnter {
  from {
    opacity: 0;
    height: 0;
  }
  to {
    opacity: 1;
    height: auto;
  }
}

@keyframes mobileMenuExit {
  from {
    opacity: 1;
    height: auto;
  }
  to {
    opacity: 0;
    height: 0;
  }
}

.mobile-menu-item {
  opacity: 0;
  transform: translateX(-16px);
  animation: menuItemSlideIn 0.2s ease-out forwards;
}

@keyframes menuItemSlideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mobile-menu-item:nth-child(1) { animation-delay: 0s; }
.mobile-menu-item:nth-child(2) { animation-delay: 0.05s; }
.mobile-menu-item:nth-child(3) { animation-delay: 0.1s; }
.mobile-menu-item:nth-child(4) { animation-delay: 0.15s; }

/* ==========================================================================
   Bottom Nav Active Indicator
   ========================================================================== */

.bottom-nav-indicator {
  position: absolute;
  top: -1px;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background-color: #059669;
  border-radius: 9999px;
  animation: indicatorScaleIn 0.2s ease-out forwards;
}

@keyframes indicatorScaleIn {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

/* ==========================================================================
   Icon Rotate Animation (Hamburger toggle)
   ========================================================================== */

.icon-rotate-enter {
  animation: iconRotateEnter 0.15s ease-out forwards;
}

@keyframes iconRotateEnter {
  from {
    transform: scale(0.8) rotate(-90deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* ==========================================================================
   Legal Text Expand (Footer)
   ========================================================================== */

.legal-expand {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease-in-out, opacity 0.25s ease-in-out;
}

.legal-expand.expanded {
  max-height: 200px;
  opacity: 1;
}

/* ==========================================================================
   WordPress Specific Overrides
   ========================================================================== */

/* Ensure images in content are responsive */
.entry-content img {
  max-width: 100%;
  height: auto;
}

/* WordPress caption styling */
.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: 0.75rem;
  color: #6b7280;
  text-align: center;
  padding: 0.5rem 0;
}

/* WordPress gallery */
.gallery {
  display: grid;
  gap: 0.5rem;
}

/* Screen reader text */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* WordPress pagination */
.nav-links {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
}

.nav-links .page-numbers {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-links .page-numbers.current {
  background-color: #059669;
  color: white;
}

.nav-links .page-numbers:not(.current):hover {
  background-color: #f3f4f6;
  color: #059669;
}
