/* Imperra Energy - Custom Styles */
/* Contact: +91 9558360879 | imperraenergypvtltd@gmail.com */

/* ===== BASE STYLES ===== */

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

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

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #9CD44D, #C6E872);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #8BC43F, #B5D961);
}

/* Selection Colors */
::selection {
  background: #9CD44D;
  color: #0B2A45;
}

/* Focus Visible */
:focus-visible {
  outline: 2px solid #9CD44D;
  outline-offset: 2px;
}

/* ===== HEADER ===== */

.header-scrolled {
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 4px 20px rgba(11, 42, 69, 0.08);
}

/* ===== ANIMATIONS ===== */

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

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes scrollIndicator {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(8px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

.animate-fade-in { animation: fadeIn 1s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.8s ease-out forwards; }
.animate-float { animation: float 6s ease-in-out infinite; }
.animate-spin-slow { animation: spinSlow 30s linear infinite; }
.animate-scroll-indicator { animation: scrollIndicator 1.5s ease-in-out infinite; }

/* ===== COMPONENTS ===== */

/* Loading Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Toast Notifications */
.toast {
  animation: slideUp 0.3s ease-out;
}

/* Calculator Results */
.results-enter {
  animation: slideUp 0.5s ease-out forwards;
}

/* FAQ Accordion Transition */
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-content.open {
  max-height: 500px;
}

/* ===== BUTTONS ===== */

/* Button Hover Shine Effect */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

.btn-shine:hover::before {
  left: 100%;
}

/* ===== CARDS ===== */

/* Card Hover Glow */
.card-glow {
  position: relative;
}

.card-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(156, 212, 77, 0.15),
    transparent 50%
  );
  pointer-events: none;
}

.card-glow:hover::after {
  opacity: 1;
}

/* ===== FORMS ===== */

/* Form Input Focus */
input:focus,
select:focus,
textarea:focus {
  outline: none;
}

/* Improved Select Appearance */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748B' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Error State */
.field-error {
  animation: fadeIn 0.2s ease-out;
}

/* ===== MOBILE IMPROVEMENTS ===== */

/* Tap Targets - Minimum 48px */
@media (max-width: 768px) {
  button,
  a,
  input,
  select,
  textarea {
    min-height: 48px;
  }
  
  /* Prevent zoom on input focus */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Mobile Menu Animation */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

#mobile-menu:not(.hidden) {
  max-height: 500px;
}

/* Safe Area for notched devices */
.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Mobile CTA Bar */
#mobile-cta-bar {
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

#mobile-cta-bar a {
  min-height: 56px;
}

/* ===== UTILITIES ===== */

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #9CD44D 0%, #C6E872 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Line Clamp */
.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;
}

/* Lazy Load Images */
.lazy-image {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.lazy-image.loaded {
  opacity: 1;
}

/* Glass Effect */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== ACCESSIBILITY ===== */

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #0B2A45;
  color: white;
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* ===== PRINT STYLES ===== */

@media print {
  .no-print,
  #mobile-cta-bar,
  header,
  footer {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  a {
    text-decoration: underline;
  }
}

/* ===== HERO SECTION ===== */

.hero-pattern {
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(156, 212, 77, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(198, 232, 114, 0.1) 0%, transparent 50%);
}

/* ===== NUMBER FORMATTING ===== */

.number-counter {
  font-variant-numeric: tabular-nums;
}

/* ===== TOUCH FEEDBACK ===== */

@media (hover: none) {
  .touch-feedback:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
}

/* ===== SCROLLBAR HIDE FOR MOBILE ===== */

@media (max-width: 768px) {
  .hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  
  .hide-scrollbar::-webkit-scrollbar {
    display: none;
  }
}

/* ===== ENHANCED HOVER EFFECTS ===== */

/* Card Hover Effects */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(11, 42, 69, 0.1);
}

/* Button Hover Pulse */
.btn-pulse:hover {
  animation: buttonPulse 0.6s ease;
}

@keyframes buttonPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Icon Bounce on Card Hover */
.group:hover .icon-bounce {
  animation: iconBounce 0.4s ease;
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Link Underline Animation */
.link-underline {
  position: relative;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #9CD44D, #C6E872);
  transition: width 0.3s ease;
}

.link-underline:hover::after {
  width: 100%;
}

/* Image Scale on Hover */
.img-scale {
  transition: transform 0.5s ease;
  overflow: hidden;
}

.img-scale img {
  transition: transform 0.5s ease;
}

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

/* Border Glow Effect */
.border-glow {
  position: relative;
}

.border-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, #9CD44D, #C6E872, #9CD44D);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.border-glow:hover::before {
  opacity: 1;
}

/* Loading States */
.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Form Loading Overlay */
.form-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.form-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
  z-index: 10;
}

/* Breadcrumb Styles */
.breadcrumb-item::after {
  content: '/';
  margin: 0 0.5rem;
  color: #9CD44D;
}

.breadcrumb-item:last-child::after {
  content: '';
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Hardware Acceleration for Animations */
.animate-slide-up,
.animate-fade-in,
.animate-float,
.hover-lift,
.btn-pulse {
  will-change: transform, opacity;
}

/* Reduce motion for performance */
@media (prefers-reduced-motion: reduce) {
  .animate-slide-up,
  .animate-fade-in,
  .animate-float,
  .hover-lift {
    will-change: auto;
  }
}
