/* 
    style.css - Main stylesheet for FinanceMalaysia
    A modern glassmorphism design with eco-minimalist elements
*/

:root {
  /* Primary colors */
  --primary-50: #f0fdf4;
  --primary-100: #dcfce7;
  --primary-200: #bbf7d0;
  --primary-300: #86efac;
  --primary-400: #4ade80;
  --primary-500: #22c55e;
  --primary-600: #16a34a;
  --primary-700: #15803d;
  --primary-800: #166534;
  --primary-900: #14532d;
  
  /* Secondary colors */
  --secondary-50: #eff6ff;
  --secondary-100: #dbeafe;
  --secondary-200: #bfdbfe;
  --secondary-300: #93c5fd;
  --secondary-400: #60a5fa;
  --secondary-500: #3b82f6;
  --secondary-600: #2563eb;
  --secondary-700: #1d4ed8;
  --secondary-800: #1e40af;
  --secondary-900: #1e3a8a;
  
  /* Neutral colors */
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;
  
  /* Background colors */
  --bg-primary: var(--primary-50);
  --bg-secondary: var(--secondary-50);
  --bg-light: rgba(255, 255, 255, 0.8);
  --bg-dark: rgba(0, 0, 0, 0.7);
  
  /* Text colors */
  --text-primary: var(--neutral-800);
  --text-secondary: var(--neutral-600);
  --text-light: #ffffff;
  --text-muted: var(--neutral-500);
  
  /* Border colors */
  --border-light: var(--neutral-200);
  --border-medium: var(--neutral-300);
  
  /* Shadow styles */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  
  /* Transitions */
  --transition-normal: all 0.3s ease;
  --transition-slow: all 0.5s ease;
  --transition-bounce: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  
  /* Border radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
}

/* Base Styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Open Sans', sans-serif;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  transition: var(--transition-normal);
}

.glass-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-5px);
}

/* Buttons */
.btn,
button:not([class]),
input[type="submit"] {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-normal);
  border: none;
}

.btn-primary,
.bg-green-600 {
  background-color: var(--primary-600);
  color: var(--text-light);
}

.btn-primary:hover,
.bg-green-600:hover {
  background-color: var(--primary-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-light);
  border: 2px solid currentColor;
}

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

.btn-outline {
  background-color: transparent;
  color: var(--primary-600);
  border: 2px solid var(--primary-600);
}

.btn-outline:hover {
  background-color: var(--primary-50);
  transform: translateY(-2px);
}

/* Card layouts */
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--bg-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.card-image {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: var(--transition-slow);
  margin: 0 auto;
}

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

.card-content {
  padding: 1.5rem;
  text-align: center;
  width: 100%;
}

/* Team member cards */
.team-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-normal);
  background-color: var(--bg-light);
}

.team-member:hover {
  transform: translateY(-5px);
}

.team-member img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  margin: 0 auto;
}

/* Header Styles */
header {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

header:hover {
  box-shadow: var(--shadow-md);
}

nav ul {
  display: flex;
  justify-content: space-between;
  list-style-type: none;
  margin: 0;
  padding: 0;
}

nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: var(--transition-normal);
}

nav a:hover {
  color: var(--primary-600);
}

/* Mobile Navigation */
#mobile-menu {
  transform: translateY(-10px);
  opacity: 0;
  transition: var(--transition-normal);
  display: none;
}

#mobile-menu.active {
  transform: translateY(0);
  opacity: 1;
  display: block;
}

/* Hero Section */
.hero-section {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../image/hero-finance-malaysia.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 2rem;
  color: var(--text-light);
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-content p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

/* About Section */
.about-section img {
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
}

/* Services Section */
.services-section .card-image {
  height: 250px;
}

/* Case Studies Slider */
.custom-slider {
  position: relative;
  margin: 2rem 0;
}

.slider-container {
  display: flex;
  overflow-x: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 2rem;
  padding: 1rem 0;
}

.slider-container .card {
  scroll-snap-align: start;
}

.slider-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
}

.slider-control:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: var(--shadow-lg);
}

.slider-control.prev {
  left: 15px;
}

.slider-control.next {
  right: 15px;
}

/* Pricing Section */
.pricing-section .card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pricing-section .card.featured {
  transform: scale(1.05);
  z-index: 1;
  border: 2px solid var(--primary-200);
}

.pricing-section .price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-600);
  margin: 1.5rem 0;
}

/* Team/Instructors Section */
.instructors-section .card-image {
  height: 350px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.social-links a {
  color: var(--text-muted);
  transition: var(--transition-normal);
}

.social-links a:hover {
  color: var(--primary-600);
  transform: translateY(-2px);
}

/* Contact Section */
.contact-section form {
  max-width: 800px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.8);
  transition: var(--transition-normal);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
  background-color: white;
}

/* Contact Info Cards */
.contact-info-card {
  background-color: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.contact-info-item svg {
  margin-right: 1rem;
  color: var(--primary-600);
  flex-shrink: 0;
}

/* Footer */
footer {
  background-color: var(--neutral-800);
  color: var(--text-light);
  padding: 3rem 0;
}

footer h3 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: white;
}

footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

footer ul li {
  margin-bottom: 0.75rem;
}

footer a {
  color: var(--neutral-300);
  text-decoration: none;
  transition: var(--transition-normal);
}

footer a:hover {
  color: var(--primary-400);
}

.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.footer-social a {
  padding: 0.5rem;
  display: inline-block;
}

/* Success Page */
.success-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
}

.success-container {
  max-width: 600px;
  padding: 2rem;
}

.success-icon {
  font-size: 4rem;
  color: var(--primary-600);
  margin-bottom: 1.5rem;
}

/* Terms & Privacy Pages */
.terms-page, 
.privacy-page {
  padding-top: 100px;
}

.terms-container,
.privacy-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background-color: var(--bg-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Animation Utilities */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

.fade-in-left {
  animation: fadeInLeft 0.5s ease-in-out;
}

.fade-in-right {
  animation: fadeInRight 0.5s ease-in-out;
}

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

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

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

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

/* Read More Links */
.read-more {
  display: inline-flex;
  align-items: center;
  color: var(--primary-600);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-normal);
  margin-top: 1rem;
}

.read-more:hover {
  color: var(--primary-700);
}

.read-more::after {
  content: "→";
  margin-left: 0.25rem;
  transition: var(--transition-normal);
}

.read-more:hover::after {
  transform: translateX(4px);
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  transition: var(--transition-normal);
}

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

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

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-400);
}

/* Media Queries */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .hero-content p {
    font-size: 1rem;
  }
  
  .card-container {
    grid-template-columns: repeat(1, 1fr);
  }
  
  .slider-control {
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 576px) {
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .card-content {
    padding: 1rem;
  }
  
  .slider-control {
    width: 30px;
    height: 30px;
  }
}

/* Additional JavaScript for functionality */
document.addEventListener('DOMContentLoaded', function() {
  // Mobile Menu Toggle
  const mobileMenuButton = document.getElementById('mobile-menu-button');
  const mobileMenu = document.getElementById('mobile-menu');
  
  if (mobileMenuButton && mobileMenu) {
    mobileMenuButton.addEventListener('click', function() {
      mobileMenu.classList.toggle('active');
    });
  }
  
  // Slider Controls
  const sliderContainer = document.querySelector('.slider-container');
  const prevButton = document.querySelector('.slider-control.prev');
  const nextButton = document.querySelector('.slider-control.next');
  
  if (sliderContainer && prevButton && nextButton) {
    let slideWidth = sliderContainer.querySelector('.card').offsetWidth + 32; // card width + gap
    let currentPosition = 0;
    
    prevButton.addEventListener('click', function() {
      currentPosition = Math.max(currentPosition - slideWidth, 0);
      sliderContainer.style.transform = `translateX(-${currentPosition}px)`;
    });
    
    nextButton.addEventListener('click', function() {
      const maxPosition = sliderContainer.scrollWidth - sliderContainer.clientWidth;
      currentPosition = Math.min(currentPosition + slideWidth, maxPosition);
      sliderContainer.style.transform = `translateX(-${currentPosition}px)`;
    });
    
    // Recalculate on resize
    window.addEventListener('resize', function() {
      slideWidth = sliderContainer.querySelector('.card').offsetWidth + 32;
      currentPosition = 0;
      sliderContainer.style.transform = `translateX(0)`;
    });
  }
  
  // Form Submission
  const contactForm = document.getElementById('contact-form');
  const successModal = document.getElementById('success-modal');
  const closeModal = document.getElementById('close-modal');
  
  if (contactForm) {
    contactForm.addEventListener('submit', function(e) {
      e.preventDefault();
      if (successModal) {
        successModal.style.display = 'flex';
      } else {
        window.location.href = './success.html';
      }
    });
  }
  
  if (closeModal && successModal) {
    closeModal.addEventListener('click', function() {
      successModal.style.display = 'none';
    });
  }
  
  // Animate on scroll
  const animateElements = document.querySelectorAll('.fade-in, .fade-in-up, .fade-in-left, .fade-in-right');
  
  if ('IntersectionObserver' in window && animateElements.length) {
    const observer = new IntersectionObserver((entries) => {
      entries.forEach(entry => {
        if (entry.isIntersecting) {
          entry.target.classList.add('animated');
          observer.unobserve(entry.target);
        }
      });
    }, { threshold: 0.1 });
    
    animateElements.forEach(element => {
      element.style.opacity = '0';
      observer.observe(element);
    });
  }
});