/* ========================================
   ENHANCED RESPONSIVE DESIGN - FIXED
   ======================================== */

/* ========================================
   BASE RESPONSIVE UTILITIES
   ======================================== */
@media (max-width: 1024px) {
  .nav-links {
    gap: 28px;
  }
  
  .nav-link {
    font-size: 15px;
  }
  
  .logo-text h1 {
    font-size: 18px;
  }
  
  .logo-text p {
    font-size: 12px;
  }
  
  .party-logo {
    width: 55px;
    height: 55px;
  }
}

/* ========================================
   MOBILE NAVIGATION - FIXED & OPTIMIZED
   ======================================== */
@media (max-width: 1024px) {
  
  /* Navbar positioning */
  #navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
  }
  
  /* Navbar Content */
  .nav-content {
    padding: 14px 0;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  /* Logo Section */
  .logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1002;
  }
  
  .party-logo {
    width: 50px;
    height: 50px;
  }
  
  .logo-text h1 {
    font-size: 16px;
    margin: 0;
  }
  
  .logo-text p {
    font-size: 11px;
    margin: 0;
  }
  
  /* Hamburger Menu Toggle - Enhanced */
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    z-index: 1002;
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    position: relative;
  }
  
  .menu-toggle:hover {
    background-color: rgba(79, 70, 229, 0.08);
  }
  
  .menu-toggle:active {
    background-color: rgba(79, 70, 229, 0.15);
  }
  
  .menu-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background-color: #4f46e5;
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
  }
  
  /* Active Hamburger Animation */
  .menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  
  .menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  
  /* Mobile Navigation Links - Full Screen Overlay */
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    
    padding: 100px 24px 40px;
    
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    z-index: 1001;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Active state - shown */
  .nav-links.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  /* Individual Nav Links */
  .nav-link {
    display: block;
    width: 100%;
    max-width: 400px;
    padding: 20px 28px;
    
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: #1e293b;
    
    background: white;
    border-radius: 12px;
    border: 2px solid transparent;
    
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Staggered animation */
    opacity: 0;
    transform: translateX(-30px);
  }
  
  /* Stagger animation delays */
  .nav-links.active .nav-link:nth-child(1) {
    animation: slideInLink 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
  }
  
  .nav-links.active .nav-link:nth-child(2) {
    animation: slideInLink 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.15s forwards;
  }
  
  .nav-links.active .nav-link:nth-child(3) {
    animation: slideInLink 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
  }
  
  .nav-links.active .nav-link:nth-child(4) {
    animation: slideInLink 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.25s forwards;
  }
  
  .nav-links.active .nav-link:nth-child(5) {
    animation: slideInLink 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
  }
  
  .nav-links.active .nav-link:nth-child(6) {
    animation: slideInLink 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.35s forwards;
  }
  
  .nav-links.active .nav-link:nth-child(7) {
    animation: slideInLink 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
  }
  
  @keyframes slideInLink {
    from {
      opacity: 0;
      transform: translateX(-30px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  /* Nav link hover/active states */
  .nav-link:hover,
  .nav-link:focus {
    background: rgba(79, 70, 229, 0.08);
    border-color: #4f46e5;
    color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
  }
  
  .nav-link:active {
    transform: translateY(0);
  }
  
  /* Remove desktop-only pseudo elements */
  .nav-link::after,
  .nav-link::before {
    display: none;
  }
  
  /* Prevent body scroll when menu open */
  body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }
}

/* ========================================
   HERO & CONTENT RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  
  /* Hero Section */
  .hero-section {
    padding: 80px 0 60px;
  }
  
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .hero-title {
    font-size: 32px;
    line-height: 1.3;
  }
  
  .hero-badge {
    font-size: 14px;
    padding: 10px 24px;
  }
  
  .hero-description,
  .hero-vision {
    font-size: 15px;
    line-height: 1.8;
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: 16px;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .stats {
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 24px;
    margin-top: 32px;
  }
  
  .stat-item {
    flex: 1;
    min-width: 100px;
  }
  
  /* Sections */
  .video-section,
  .news-section,
  .action-section,
  .contact-section {
    padding: 60px 0;
  }
  
  .section-title {
    font-size: 32px;
  }
  
  .section-subtitle {
    font-size: 15px;
  }
  
  /* Action Cards */
  .action-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .action-card {
    padding: 40px 24px;
  }
  
  /* Contact Grid */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .contact-info,
  .contact-form {
    padding: 40px 28px;
  }
  
  /* News Carousel */
  .carousel-container {
    height: auto;
    min-height: 480px;
  }
  
  .news-image {
    height: 280px;
  }
  
  .news-content {
    padding: 24px;
  }
  
  .news-content h4 {
    font-size: 22px;
  }
  
  .news-content p {
    font-size: 15px;
  }
  
  .carousel-btn {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  
  .carousel-btn.prev {
    left: 8px;
  }
  
  .carousel-btn.next {
    right: 8px;
  }
  
  /* Container */
  .container {
    padding: 0 20px;
  }
}

/* ========================================
   SMALL MOBILE DEVICES (< 480px)
   ======================================== */
@media (max-width: 480px) {
  
  .nav-content {
    padding: 12px 0;
  }
  
  .logo-section {
    gap: 10px;
  }
  
  .party-logo {
    width: 45px;
    height: 45px;
  }
  
  .logo-text h1 {
    font-size: 14px;
  }
  
  .logo-text p {
    font-size: 10px;
  }
  
  .menu-toggle {
    width: 40px;
    height: 40px;
  }
  
  .menu-toggle span {
    width: 24px;
    height: 2.5px;
  }
  
  .nav-links {
    padding: 90px 20px 30px;
  }
  
  .nav-link {
    padding: 16px 20px;
    font-size: 16px;
  }
  
  .hero-title {
    font-size: 28px;
  }
  
  .hero-badge {
    font-size: 13px;
    padding: 8px 20px;
  }
  
  .stat-number {
    font-size: 32px;
  }
  
  .stat-label {
    font-size: 13px;
  }
  
  .section-title {
    font-size: 28px;
  }
  
  .news-image {
    height: 240px;
  }
  
  .news-content h4 {
    font-size: 20px;
  }
  
  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .action-card {
    padding: 32px 20px;
  }
  
  .action-icon {
    font-size: 52px;
  }
  
  .contact-info,
  .contact-form {
    padding: 32px 20px;
  }
  
  .container {
    padding: 0 16px;
  }
}

/* ========================================
   LANDSCAPE MOBILE
   ======================================== */
@media (max-width: 896px) and (orientation: landscape) {
  
  .nav-links {
    padding: 80px 24px 30px;
  }
  
  .nav-link {
    max-width: 300px;
    padding: 14px 20px;
    font-size: 16px;
  }
  
  .hero-section {
    padding: 40px 0;
  }
}

/* ========================================
   TABLET ADJUSTMENTS (769px - 1024px)
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {
  
  .hero-grid {
    gap: 48px;
  }
  
  .hero-title {
    font-size: 38px;
  }
  
  .stats {
    gap: 32px;
  }
  
  .action-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
  
  .action-card:last-child {
    grid-column: 1 / -1;
    max-width: 500px;
    margin: 0 auto;
  }
}

/* ========================================
   DESKTOP (> 1024px) - Reset Mobile Styles
   ======================================== */
@media (min-width: 1025px) {
  
  /* Ensure menu toggle is hidden */
  .menu-toggle {
    display: none !important;
  }
  
  /* Reset nav links to desktop layout */
  .nav-links {
    position: static;
    display: flex !important;
    flex-direction: row;
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    gap: 32px;
    opacity: 1;
    visibility: visible;
    transform: none;
    overflow: visible;
  }
  
  .nav-link {
    width: auto;
    max-width: none;
    padding: 8px 0;
    font-size: 16px;
    background: transparent;
    border: none;
    box-shadow: none;
    opacity: 1;
    transform: none;
    animation: none;
  }
  
  /* Re-enable desktop hover effects */
  .nav-link::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #4f46e5;
    transition: width 0.3s ease;
  }
  
  .nav-link:hover::after {
    width: 100%;
  }
  
  body.menu-open {
    overflow: auto;
    position: static;
  }
}

/* ========================================
   EXTRA LARGE SCREENS (> 1440px)
   ======================================== */
@media (min-width: 1440px) {
  
  .container {
    max-width: 1400px;
  }
  
  .hero-title {
    font-size: 52px;
  }
  
  .section-title {
    font-size: 44px;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  
  .animated-bg,
  #navbar,
  .menu-toggle,
  .hero-buttons,
  .carousel-btn,
  .action-section,
  .contact-form,
  .footer {
    display: none;
  }
  
  body {
    background: white;
  }
  
  .hero-section,
  .news-section,
  .contact-section {
    padding: 20px 0;
  }
}