<!DOCTYPE html>
<html lang="te">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AstroTelugu - మీ భవిష్యత్తు, మీ భాషలో!</title>
    <meta name="description" content="వాస్తవ ఖచ్చితమైన తెలుగులో జ్యోతిషం, ఉచిత జాతకం, పంచాంగం, రాశి ఫలాలు - AstroTelugu.com">
    <meta name="keywords" content="తెలుగు జ్యోతిషం, జాతకం, పంచాంగం, రాశి ఫలాలు, వివాహ పొరుత్తం, ప్రత్యక్ష జ్యోతిషి">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Telugu:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <style>
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }
      
      body {
        font-family: 'Noto Sans Telugu', sans-serif;
        line-height: 1.6;
        color: #333;
        background: linear-gradient(135deg, #4a148c 0%, #7b1fa2 50%, #c2185b 100%);
        min-height: 100vh;
      }
      
      .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
      }
      
      /* Header */
      .header {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        padding: 1rem 0;
        position: sticky;
        top: 0;
        z-index: 100;
        box-shadow: 0 2px 20px rgba(0,0,0,0.1);
      }
      
      .nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
      }
      
      .logo {
        font-size: 1.8rem;
        font-weight: 700;
        color: #4a148c;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 0.5rem;
      }
      
      .nav-links {
        display: flex;
        list-style: none;
        gap: 2rem;
        flex-wrap: wrap;
      }
      
      .nav-links a {
        color: #333;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s ease;
        padding: 0.5rem 1rem;
        border-radius: 25px;
        transition: all 0.3s ease;
      }
      
      .nav-links a:hover {
        background: #4a148c;
        color: white;
      }
      
      .mobile-menu {
        display: none;
        background: #4a148c;
        color: white;
        border: none;
        padding: 0.5rem 1rem;
        border-radius: 5px;
        cursor: pointer;
      }
      
      /* Hero Section */
      .hero-section {
        text-align: center;
        padding: 4rem 0;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 20px;
        margin-bottom: 3rem;
        backdrop-filter: blur(10px);
      }
      
      .hero-title {
        font-size: 3.5rem;
        font-weight: 700;
        color: white;
        margin-bottom: 1rem;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
      }
      
      .hero-subtitle {
        font-size: 1.3rem;
        color: rgba(255, 255, 255, 0.9);
        margin-bottom: 2rem;
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
      }
      
      .cta-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        margin-top: 2rem;
      }
      
      .cta-btn {
        background: linear-gradient(135deg, #ff6f00, #ff8f00);
        color: white;
        padding: 15px 25px;
        border: none;
        border-radius: 50px;
        font-size: 1.1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        text-decoration: none;
        display: inline-block;
        box-shadow: 0 4px 15px rgba(255, 111, 0, 0.3);
      }
      
      .cta-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 111, 0, 0.4);
      }
      
      /* Section Styles */
      .section {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 20px;
        padding: 2rem;
        margin-bottom: 2rem;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
      }
      
      .section-title {
        color: #4a148c;
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 1.5rem;
        text-align: center;
        border-bottom: 3px solid #ff6f00;
        padding-bottom: 0.5rem;
        display: inline-block;
        width: 100%;
      }
      
      /* Panchangam Widget */
      .panchangam-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
        gap: 1rem;
      }
      
      .city-selector {
        padding: 0.5rem 1rem;
        border: 2px solid #4a148c;
        border-radius: 25px;
        background: white;
        color: #4a148c;
        font-weight: 500;
        cursor: pointer;
      }
      
      .panchangam-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
        margin-top: 1rem;
      }
      
      .panchangam-card {
        background: linear-gradient(135deg, #4a148c, #7b1fa2);
        color: white;
        padding: 1.5rem;
        border-radius: 15px;
        text-align: center;
        box-shadow: 0 5px 15px rgba(74, 20, 140, 0.3);
        transition: transform 0.3s ease;
      }
      
      .panchangam-card:hover {
        transform: translateY(-5px);
      }
      
      .panchangam-card h4 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        color: #ff6f00;
      }
      
      .panchangam-card p {
        font-size: 1rem;
        font-weight: 500;
      }
      
      /* Horoscope Carousel */
      .horoscope-carousel {
        display: flex;
        overflow-x: auto;
        gap: 1rem;
        padding: 1rem 0;
        scrollbar-width: thin;
        scrollbar-color: #4a148c #f0f0f0;
      }
      
      .horoscope-card {
        min-width: 200px;
        background: white;
        border: 2px solid #4a148c;
        border-radius: 15px;
        padding: 1.5rem;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
      }
      
      .horoscope-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(74, 20, 140, 0.2);
      }
      
      .horoscope-card .icon {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
      }
      
      .horoscope-card h4 {
        color: #4a148c;
        font-weight: 600;
        margin-bottom: 0.5rem;
      }
      
      .horoscope-card p {
        color: #666;
        font-size: 0.9rem;
      }
      
      /* Form Styles */
      .form-section {
        background: linear-gradient(135deg, #f8f9fa, #e9ecef);
        border-radius: 15px;
        padding: 2rem;
        margin-top: 1rem;
      }
      
      .form-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
      }
      
      .form-group {
        display: flex;
        flex-direction: column;
      }
      
      .form-group label {
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: #4a148c;
      }
      
      .form-group input,
      .form-group select {
        padding: 0.8rem;
        border: 2px solid #ddd;
        border-radius: 8px;
        font-size: 1rem;
        transition: border-color 0.3s ease;
      }
      
      .form-group input:focus,
      .form-group select:focus {
        outline: none;
        border-color: #4a148c;
      }
      
      /* Astrologer Cards */
      .astrologer-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
        margin-top: 1rem;
      }
      
      .astrologer-card {
        background: white;
        border-radius: 15px;
        padding: 1.5rem;
        text-align: center;
        box-shadow: 0 8px 25px rgba(0,0,0,0.1);
        transition: all 0.3s ease;
        border: 2px solid transparent;
      }
      
      .astrologer-card:hover {
        transform: translateY(-5px);
        border-color: #4a148c;
      }
      
      .astrologer-avatar {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        background: linear-gradient(135deg, #4a148c, #7b1fa2);
        margin: 0 auto 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2rem;
        color: white;
      }
      
      .astrologer-card h4 {
        color: #4a148c;
        margin-bottom: 0.5rem;
      }
      
      .astrologer-card p {
        color: #666;
        margin-bottom: 0.5rem;
      }
      
      .rating {
        color: #ff6f00;
        font-size: 1.2rem;
        margin: 0.5rem 0;
      }
      
      .availability {
        font-weight: bold;
        margin-bottom: 1rem;
      }
      
      .available {
        color: #10b981;
      }
      
      .busy {
        color: #f59e0b;
      }
      
      /* Festival Timeline */
      .festival-timeline {
        display: flex;
        overflow-x: auto;
        gap: 1rem;
        padding: 1rem 0;
      }
      
      .festival-card {
        min-width: 200px;
        background: linear-gradient(135deg, #ff6f00, #ff8f00);
        color: white;
        padding: 1.5rem;
        border-radius: 15px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 5px 15px rgba(255, 111, 0, 0.3);
      }
      
      .festival-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(255, 111, 0, 0.4);
      }
      
      .festival-card h4 {
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
      }
      
      .festival-card p {
        font-size: 0.9rem;
        opacity: 0.9;
      }
      
      /* Blog Section */
      .blog-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
        margin-top: 1rem;
      }
      
      .blog-card {
        background: white;
        border-radius: 15px;
        overflow: hidden;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        transition: all 0.3s ease;
        cursor: pointer;
      }
      
      .blog-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.15);
      }
      
      .blog-card img {
        width: 100%;
        height: 200px;
        object-fit: cover;
      }
      
      .blog-card-content {
        padding: 1.5rem;
      }
      
      .blog-card h4 {
        color: #4a148c;
        margin-bottom: 0.5rem;
      }
      
      .blog-card p {
        color: #666;
        font-size: 0.9rem;
        line-height: 1.4;
      }
      
      /* Footer */
      .footer {
        background: #4a148c;
        color: white;
        padding: 3rem 0 1rem;
        margin-top: 3rem;
      }
      
      .footer-content {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 2rem;
        margin-bottom: 2rem;
      }
      
      .footer-section h4 {
        margin-bottom: 1rem;
        color: #ff6f00;
      }
      
      .footer-section a {
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        display: block;
        margin-bottom: 0.5rem;
        transition: color 0.3s ease;
      }
      
      .footer-section a:hover {
        color: white;
      }
      
      .footer-bottom {
        text-align: center;
        padding-top: 2rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        color: rgba(255, 255, 255, 0.8);
      }
      
      /* Mobile Responsive */
      @media (max-width: 768px) {
        .hero-title {
          font-size: 2.5rem;
        }
        
        .hero-subtitle {
          font-size: 1.1rem;
        }
        
        .nav-links {
          display: none;
        }
        
        .mobile-menu {
          display: block;
        }
        
        .cta-buttons {
          flex-direction: column;
          align-items: center;
        }
        
        .cta-btn {
          width: 100%;
          max-width: 300px;
        }
        
        .section {
          padding: 1.5rem;
        }
        
        .section-title {
          font-size: 1.5rem;
        }
        
        .panchangam-header {
          flex-direction: column;
          text-align: center;
        }
        
        .panchangam-grid {
          grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        }
        
        .astrologer-grid {
          grid-template-columns: 1fr;
        }
        
        .blog-grid {
          grid-template-columns: 1fr;
        }
      }
      
      /* Loading Animation */
      .loading {
        display: inline-block;
        animation: pulse 1.5s infinite;
      }
      
      @keyframes pulse {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.5; }
      }
    </style>
  </head>
  <body>
    <!-- Header -->
    <div class="header">
      <div class="container">
        <nav class="nav">
          <a href="/" class="logo">⭐ AstroTelugu</a>
          <ul class="nav-links">
            <li><a href="#panchangam">పంచాంగం</a></li>
            <li><a href="#jathakam">జాతకం</a></li>
            <li><a href="#horoscopes">రాశి ఫలాలు</a></li>
            <li><a href="#marriage">పెళ్లి పొరుతం</a></li>
            <li><a href="#consultation">ప్రత్యక్ష జ్యోతిషి</a></li>
            <li><a href="#blog">బ్లాగ్</a></li>
          </ul>
          <button class="mobile-menu" onclick="toggleMobileMenu()">☰</button>
        </nav>
      </div>
    </div>

    <div class="container">
      <!-- Hero Section with Complete Panchang Details -->
      <div class="hero-section">
        <h1 class="hero-title">🌟 సంపూర్ణ పంచాంగం</h1>
        <p class="hero-subtitle">వాస్తవ ఖచ్చితమైన తెలుగులో జ్యోతిషం - <span id="currentDate"></span></p>
        
        <!-- City Selector -->
        <div style="text-align: center; margin: 2rem 0;">
          <select class="city-selector" id="citySelector" onchange="updatePanchang()">
            <option value="Hyderabad,17.3850,78.4867">హైదరాబాద్</option>
            <option value="Vijayawada,16.5062,80.6480">విజయవాడ</option>
            <option value="Visakhapatnam,17.7231,83.3012">విశాఖపట్నం</option>
            <option value="Tirupati,13.6288,79.4192">తిరుపతి</option>
            <option value="Guntur,16.3067,80.4365">గుంటూర్</option>
            <option value="Warangal,17.9689,79.5941">వరంగల్</option>
          </select>
        </div>
        
        <!-- Main Panchang Elements -->
        <div class="panchangam-grid">
          <div class="panchangam-card">
            <h4>📅 తిథి</h4>
            <p id="tithi-data" class="loading">లోడ్ చేస్తున్నాం...</p>
            <small id="tithi-completion" style="color: #ff6f00; font-weight: bold;"></small>
          </div>
          <div class="panchangam-card">
            <h4>⭐ నక్షత్రం</h4>
            <p id="nakshatra-data" class="loading">లోడ్ చేస్తున్నాం...</p>
            <small id="nakshatra-lord" style="color: #ff6f00;"></small>
          </div>
          <div class="panchangam-card">
            <h4>🔮 యోగం</h4>
            <p id="yoga-data" class="loading">లోడ్ చేస్తున్నాం...</p>
            <small id="yoga-effect" style="color: #ff6f00;"></small>
          </div>
          <div class="panchangam-card">
            <h4>🌙 కరణం</h4>
            <p id="karana-data" class="loading">లోడ్ చేస్తున్నాం...</p>
            <small id="karana-nature" style="color: #ff6f00;"></small>
          </div>
        </div>
        
        <!-- Sun & Moon Timings -->
        <div class="section" style="background: rgba(255, 255, 255, 0.1); margin-top: 2rem; color: white;">
          <h3 style="color: #ff6f00; text-align: center; margin-bottom: 1rem;">☀️ 🌙 సూర్య చంద్రుల సమయాలు</h3>
          <div class="panchangam-grid">
            <div class="panchangam-card">
              <h4>🌅 సూర్యోదయం</h4>
              <p id="sunrise-data" class="loading">లోడ్ చేస్తున్నాం...</p>
            </div>
            <div class="panchangam-card">
              <h4>🌇 సూర్యాస్తమయం</h4>
              <p id="sunset-data" class="loading">లోడ్ చేస్తున్నాం...</p>
            </div>
            <div class="panchangam-card">
              <h4>🌙 చంద్రోదయం</h4>
              <p id="moonrise-data" class="loading">లోడ్ చేస్తున్నాం...</p>
            </div>
            <div class="panchangam-card">
              <h4>🌑 చంద్రాస్తమయం</h4>
              <p id="moonset-data" class="loading">లోడ్ చేస్తున్నాం...</p>
            </div>
          </div>
        </div>
        
        <!-- Auspicious & Inauspicious Timings -->
        <div class="section" style="background: rgba(255, 255, 255, 0.1); margin-top: 2rem; color: white;">
          <h3 style="color: #ff6f00; text-align: center; margin-bottom: 1rem;">⏰ శుభ & అశుభ సమయాలు</h3>
          <div class="panchangam-grid">
            <div class="panchangam-card" style="background: linear-gradient(135deg, #d32f2f, #f44336);">
              <h4>🚫 రాహు కాలం</h4>
              <p id="rahu-kaal-data" class="loading">లోడ్ చేస్తున్నాం...</p>
              <small style="color: #ffeb3b;">అశుభ కాలం</small>
            </div>
            <div class="panchangam-card" style="background: linear-gradient(135deg, #388e3c, #4caf50);">
              <h4>💎 అభిజిత్ ముహూర్తం</h4>
              <p id="abhijit-data" class="loading">లోడ్ చేస్తున్నాం...</p>
              <small style="color: #ffeb3b;">అత్యంత శుభ</small>
            </div>
            <div class="panchangam-card" style="background: linear-gradient(135deg, #7b1fa2, #9c27b0);">
              <h4>🌟 బ్రహ్మ ముహూర్తం</h4>
              <p id="brahma-data" class="loading">లోడ్ చేస్తున్నాం...</p>
              <small style="color: #ffeb3b;">ఆధ్యాత్మిక కాలం</small>
            </div>
            <div class="panchangam-card" style="background: linear-gradient(135deg, #f57c00, #ff9800);">
              <h4>💫 అమృత కాలం</h4>
              <p id="amrit-kaal-data" class="loading">లోడ్ చేస్తున్నాం...</p>
              <small style="color: #ffeb3b;">అమృత సమయం</small>
            </div>
            <div class="panchangam-card" style="background: linear-gradient(135deg, #d32f2f, #f44336);">
              <h4>🐍 యమగండం</h4>
              <p id="yamaganda-data" class="loading">లోడ్ చేస్తున్నాం...</p>
              <small style="color: #ffeb3b;">అశుభ కాలం</small>
            </div>
            <div class="panchangam-card" style="background: linear-gradient(135deg, #d32f2f, #f44336);">
              <h4>🔥 గులికాకాలం</h4>
              <p id="gulika-data" class="loading">లోడ్ చేస్తున్నాం...</p>
              <small style="color: #ffeb3b;">అశుభ కాలం</small>
            </div>
          </div>
        </div>
        
        <!-- Additional Panchang Info -->
        <div class="section" style="background: rgba(255, 255, 255, 0.1); margin-top: 2rem; color: white;">
          <h3 style="color: #ff6f00; text-align: center; margin-bottom: 1rem;">📚 అదనపు వివరాలు</h3>
          <div class="panchangam-grid">
            <div class="panchangam-card">
              <h4>🗓️ శక సంవత్సరం</h4>
              <p id="shaka-samvat" class="loading">లోడ్ చేస్తున్నాం...</p>
            </div>
            <div class="panchangam-card">
              <h4>📅 విక్రమ సంవత్సరం</h4>
              <p id="vikram-samvat" class="loading">లోడ్ చేస్తున్నాం...</p>
            </div>
            <div class="panchangam-card">
              <h4>🌙 చాంద్రమాన మాసం</h4>
              <p id="lunar-month" class="loading">లోడ్ చేస్తున్నాం...</p>
            </div>
            <div class="panchangam-card">
              <h4>📆 వారం</h4>
              <p id="weekday" class="loading">లోడ్ చేస్తున్నాం...</p>
            </div>
          </div>
        </div>
        
        <!-- Action Buttons -->
        <div class="cta-buttons" style="margin-top: 2rem;">
          <button onclick="openKundliCalculator()" class="cta-btn">🎯 ఉచిత జాతకం పొందండి</button>
          <button onclick="openConsultation()" class="cta-btn">💬 జ్యోతిషితో మాట్లాడండి</button>
          <button onclick="showDetailedPanchang()" class="cta-btn">📖 వివరమైన పంచాంగం</button>
        </div>
      </div>

      <!-- Horoscope Section -->
      <div class="section" id="horoscopes">
        <h2 class="section-title">🌟 రాశి ఫలాలు</h2>
        <div class="horoscope-carousel">
          <div class="horoscope-card" onclick="showHoroscope('మేషం')">
            <div class="icon">♈</div>
            <h4>మేషం</h4>
            <p>ఈ రోజు మీకు కొత్త అవకాశాలు...</p>
          </div>
          <div class="horoscope-card" onclick="showHoroscope('వృషభం')">
            <div class="icon">♉</div>
            <h4>వృషభం</h4>
            <p>ఆర్థిక విషయాలలో జాగ్రత్త...</p>
          </div>
          <div class="horoscope-card" onclick="showHoroscope('మిథునం')">
            <div class="icon">♊</div>
            <h4>మిథునం</h4>
            <p>సంబంధాలలో మంచి మార్పులు...</p>
          </div>
          <div class="horoscope-card" onclick="showHoroscope('కర్కాటకం')">
            <div class="icon">♋</div>
            <h4>కర్కాటకం</h4>
            <p>కుటుంబంలో ఆనందకర సంఘటనలు...</p>
          </div>
          <div class="horoscope-card" onclick="showHoroscope('సింహం')">
            <div class="icon">♌</div>
            <h4>సింహం</h4>
            <p>కెరీర్‌లో గొప్ప విజయాలు...</p>
          </div>
          <div class="horoscope-card" onclick="showHoroscope('కన్య')">
            <div class="icon">♍</div>
            <h4>కన్య</h4>
            <p>ఆరోగ్య విషయాలలో జాగ్రత్త...</p>
          </div>
          <div class="horoscope-card" onclick="showHoroscope('తుల')">
            <div class="icon">♎</div>
            <h4>తుల</h4>
            <p>పార్టనర్‌షిప్‌లలో లాభాలు...</p>
          </div>
          <div class="horoscope-card" onclick="showHoroscope('వృశ్చిక')">
            <div class="icon">♏</div>
            <h4>వృశ్చిక</h4>
            <p>రహస్య విషయాలు వెలుగులోకి...</p>
          </div>
          <div class="horoscope-card" onclick="showHoroscope('ధను')">
            <div class="icon">♐</div>
            <h4>ధను</h4>
            <p>విదేశీ అనుబంధాలలో అవకాశాలు...</p>
          </div>
          <div class="horoscope-card" onclick="showHoroscope('మకర')">
            <div class="icon">♑</div>
            <h4>మకర</h4>
            <p>కష్టాలను అధిగమించి విజయం...</p>
          </div>
          <div class="horoscope-card" onclick="showHoroscope('కుంభ')">
            <div class="icon">♒</div>
            <h4>కుంభ</h4>
            <p>స్నేహితుల మద్దతు లభించనుండి...</p>
          </div>
          <div class="horoscope-card" onclick="showHoroscope('మీన')">
            <div class="icon">♓</div>
            <h4>మీన</h4>
            <p>ఆధ్యాత్మిక అనుభవాలు పెరుగుతాయి...</p>
          </div>
        </div>
      </div>

      <!-- Blog Articles Section -->
      <div class="section" id="blog">
        <h2 class="section-title">📚 జ్యోతిష్య వ్యాసాలు</h2>
        <div style="text-align: center; margin-bottom: 2rem;">
          <p style="color: #666; font-size: 1.1rem; line-height: 1.6;">
            రాశుల లక్షణాలు, వ్యక్తిత్వ విశ్లేషణ మరియు వేద జ్యోతిష్య జ్ఞానం గురించి వివరమైన తెలుగు వ్యాసాలు
          </p>
        </div>
        <div id="blog-articles-preview" class="horoscope-carousel">
          <!-- Blog articles will be loaded here -->
        </div>
        <div style="text-align: center; margin-top: 2rem;">
          <a href="blog.html" class="cta-btn">అన్ని వ్యాసాలు చూడండి</a>
        </div>
      </div>

      <!-- Instant Jathakam Section -->
      <div class="section" id="jathakam">
        <h2 class="section-title">🎯 తక్షణ జాతకం జనరేటర్</h2>
        <div class="form-section">
          <div style="text-align: center; padding: 3rem 2rem;">
            <div style="background: linear-gradient(135deg, #4a148c, #7b1fa2); color: white; padding: 2rem; border-radius: 20px; margin-bottom: 2rem;">
              <h3 style="color: #ff6f00; margin-bottom: 1rem; font-size: 1.5rem;">మీ పూర్తి జాతక వివరాలు పొందండి</h3>
              <p style="font-size: 1.1rem; line-height: 1.6; margin-bottom: 2rem;">
                మీ జన్మ వివరాలను ఇవ్వండి, మేము మీకు సంపూర్ణ జాతక విశ్లేషణ అందిస్తాం. లగ్నం, రాశి, నక్షత్రం, దశలు మరియు అన్ని వివరాలతో.
              </p>
              <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2rem;">
                <div style="background: rgba(255,255,255,0.1); padding: 1rem; border-radius: 10px;">
                  <strong>✨ లగ్న విశ్లేషణ</strong>
                </div>
                <div style="background: rgba(255,255,255,0.1); padding: 1rem; border-radius: 10px;">
                  <strong>🌙 చంద్ర రాశి ఫలాలు</strong>
                </div>
                <div style="background: rgba(255,255,255,0.1); padding: 1rem; border-radius: 10px;">
                  <strong>⭐ నక్షత్ర వివరాలు</strong>
                </div>
                <div style="background: rgba(255,255,255,0.1); padding: 1rem; border-radius: 10px;">
                  <strong>🔮 దశా విశ్లేషణ</strong>
                </div>
              </div>
            </div>
            <button onclick="window.location.href='horoscope-generator.html'" class="cta-btn" style="font-size: 1.2rem; padding: 15px 40px;">
              Generate Horoscope
            </button>
            <p style="margin-top: 1rem; color: #666; font-size: 0.9rem;">పూర్తి జాతక వివరాలు తెలుగులో పొందండి</p>
          </div>
        </div>
      </div>

      <!-- Marriage Match Section -->
      <div class="section" id="marriage">
        <h2 class="section-title">💑 పెళ్లి పొరుతం</h2>
        <div style="text-align: center; padding: 3rem 2rem;">
          <div style="background: linear-gradient(135deg, #4a148c, #7b1fa2); color: white; padding: 2rem; border-radius: 20px; margin-bottom: 2rem;">
            <h3 style="color: #ff6f00; margin-bottom: 1rem; font-size: 1.5rem;">జాతక మిలన పరిశీలన</h3>
            <p style="font-size: 1.1rem; line-height: 1.6; margin-bottom: 2rem;">
              వర మరియు వధువు వివరాలతో 36 గుణాల మిలన పరిశీలన. అష్టకూట గుण మిలనం, నాడీ దోషం, భకూట దోషం వంటి అన్ని అంశాలను పరిశీలిస్తాం.
            </p>
            <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2rem;">
              <div style="background: rgba(255,255,255,0.1); padding: 1rem; border-radius: 10px;">
                <strong>🌟 36 గుణాల మిలనం</strong>
              </div>
              <div style="background: rgba(255,255,255,0.1); padding: 1rem; border-radius: 10px;">
                <strong>💫 దోష పరిహారాలు</strong>
              </div>
              <div style="background: rgba(255,255,255,0.1); padding: 1rem; border-radius: 10px;">
                <strong>💍 పెళ్లి ముహూర్తం</strong>
              </div>
              <div style="background: rgba(255,255,255,0.1); padding: 1rem; border-radius: 10px;">
                <strong>🎯 వివరాలు సలహా</strong>
              </div>
            </div>
          </div>
          <button onclick="window.location.href='marriage-compatibility.html'" class="cta-btn" style="font-size: 1.2rem; padding: 15px 40px;">
            జాతక మిలన చేయండి
          </button>
          <p style="margin-top: 1rem; color: #666; font-size: 0.9rem;">వర వధువుల పూర్తి వివరాలతో గుణ మిలనం</p>
        </div>
      </div>

      <!-- Live Consultation Section -->
      <div class="section" id="consultation">
        <h2 class="section-title">💬 ప్రత్యక్ష జ్యోతిషి సంప్రదింపు</h2>
        <div class="astrologer-grid">
          <div class="astrologer-card">
            <div class="astrologer-avatar">👨‍🦳</div>
            <h4>పండిత రాజేష్ శర్మ</h4>
            <p>వేద జ్యోతిషం, వాస్తు శాస్త్రం</p>
            <div class="rating">⭐⭐⭐⭐⭐ (4.9)</div>
            <p class="availability available">అందుబాటులో</p>
            <button class="cta-btn" style="margin-top: 1rem; font-size: 0.9rem; padding: 10px 20px;">ఇప్పుడే మాట్లాడండి</button>
          </div>
          <div class="astrologer-card">
            <div class="astrologer-avatar">👩‍🦳</div>
            <h4>పండిత లక్ష్మీ దేవి</h4>
            <p>కుండలి మిలన, గృహ జ్యోతిషం</p>
            <div class="rating">⭐⭐⭐⭐⭐ (4.8)</div>
            <p class="availability busy">5 నిమిషాలలో</p>
            <button class="cta-btn" style="margin-top: 1rem; font-size: 0.9rem; padding: 10px 20px;">వేచి ఉండండి</button>
          </div>
          <div class="astrologer-card">
            <div class="astrologer-avatar">👨‍🦲</div>
            <h4>పండిత సురేష్ గుప్తా</h4>
            <p>కెరీర్ గైడెన్స్, ప్రశ్న జ్యోతిషం</p>
            <div class="rating">⭐⭐⭐⭐☆ (4.7)</div>
            <p class="availability available">అందుబాటులో</p>
            <button class="cta-btn" style="margin-top: 1rem; font-size: 0.9rem; padding: 10px 20px;">ఇప్పుడే మాట్లాడండి</button>
          </div>
        </div>
      </div>

      <!-- Festival Calendar Section -->
      <div class="section">
        <h2 class="section-title">🎉 పండుగలు మరియు శుభ ముహూర్తాలు</h2>
        <div class="festival-timeline">
          <div class="festival-card">
            <h4>కృష్ణ జన్మాష్టమి</h4>
            <p>ఆగస్టు 26, 2025</p>
            <p>పూర్తి వివరాలు →</p>
          </div>
          <div class="festival-card">
            <h4>గణేశ్ చతుర్థి</h4>
            <p>సెప్టెంబర్ 7, 2025</p>
            <p>పూర్తి వివరాలు →</p>
          </div>
          <div class="festival-card">
            <h4>దసరా</h4>
            <p>అక్టోబర్ 3, 2025</p>
            <p>పూర్తి వివరాలు →</p>
          </div>
          <div class="festival-card">
            <h4>దీపావళి</h4>
            <p>అక్టోబర్ 21, 2025</p>
            <p>పూర్తి వివరాలు →</p>
          </div>
        </div>
      </div>

      <!-- Blog Section -->
      <div class="section" id="blog">
        <h2 class="section-title">📝 జ్యోతిష్య వార్తలు మరియు వీడియోలు</h2>
        <div class="blog-grid">
          <div class="blog-card" onclick="readTeluguArticle('weekly-horoscope')">
            <div style="background: linear-gradient(135deg, #4a148c, #7b1fa2); height: 150px; display: flex; align-items: center; justify-content: center; color: white; font-size: 2rem;">📚</div>
            <div class="blog-card-content">
              <h4>ఈ వారం రాశి ఫలాలు</h4>
              <p>అన్ని రాశుల వారికి ఈ వారం ఎలా గడుస్తుంది? వివరాలు తెలుసుకోండి...</p>
            </div>
          </div>
          <div class="blog-card" onclick="readTeluguArticle('saturn-effects')">
            <div style="background: linear-gradient(135deg, #ff6f00, #ff8f00); height: 150px; display: flex; align-items: center; justify-content: center; color: white; font-size: 2rem;">🎥</div>
            <div class="blog-card-content">
              <h4>శని దశ ప్రభావాలు</h4>
              <p>శని దశలో ఎలాంటి ఫలితాలు ఉంటాయి? పరిహారాలు ఏమిటి? వీడియోలో చూడండి...</p>
            </div>
          </div>
          <div class="blog-card" onclick="readTeluguArticle('rahu-ketu-transit')">
            <div style="background: linear-gradient(135deg, #c2185b, #e91e63); height: 150px; display: flex; align-items: center; justify-content: center; color: white; font-size: 2rem;">💫</div>
            <div class="blog-card-content">
              <h4>రాహు కేతు రవాణా ప్రభావాలు</h4>
              <p>రాహు కేతువుల రవాణా వల్ల మీ రాశిపై ఎలాంటి ప్రభావాలు ఉంటాయి...</p>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- Footer -->
    <div class="footer">
      <div class="container">
        <div class="footer-content">
          <div class="footer-section">
            <h4>త్వరిత లింక్లు</h4>
            <a href="#panchangam" onclick="document.getElementById('panchangam').scrollIntoView({behavior: 'smooth'}); return false;">పంచాంగం</a>
            <a href="#jathakam" onclick="document.getElementById('jathakam').scrollIntoView({behavior: 'smooth'}); return false;">జాతకం</a>
            <a href="#horoscopes" onclick="document.getElementById('horoscopes').scrollIntoView({behavior: 'smooth'}); return false;">రాశి ఫలాలు</a>
            <a href="#marriage" onclick="document.getElementById('marriage').scrollIntoView({behavior: 'smooth'}); return false;">పెళ్లి పొరుతం</a>
            <a href="#consultation" onclick="document.getElementById('consultation').scrollIntoView({behavior: 'smooth'}); return false;">ప్రత్యక్ష జ్యోతిషి</a>
          </div>
          <div class="footer-section">
            <h4>సామాజిక మాధ్యమాలు</h4>
            <a href="#">📘 Facebook</a>
            <a href="#">📷 Instagram</a>
            <a href="#">🐦 Twitter</a>
            <a href="#">📺 YouTube</a>
          </div>
          <div class="footer-section">
            <h4>సంప్రదింపు</h4>
            <a href="mailto:support@astrotelugu.com">📧 support@astrotelugu.com</a>
            <a href="tel:+919876543210">📞 +91 9876543210</a>
            <a href="#">💬 వాట్సాప్ సహాయం</a>
          </div>
          <div class="footer-section">
            <h4>మా సేవలు</h4>
            <a href="#">వేద జ్యోతిషం</a>
            <a href="#">కుండలి మిలన</a>
            <a href="#">వాస్తు శాస్త్రం</a>
            <a href="#">రత్న సిఫార్సులు</a>
          </div>
        </div>
        <div class="footer-bottom">
          <p>&copy; 2025 AstroTelugu.com - అన్ని హక్కులు మేం భద్రపరచారు</p>
        </div>
      </div>
    </div>

    <!-- Include existing modal and script functionality -->
    <script>
      // Initialize Telugu-specific Google Analytics
      const GA_MEASUREMENT_ID = 'G-4WEEFM6FMG';
      
      // Load Google Analytics
      const script1 = document.createElement('script');
      script1.async = true;
      script1.src = `https://www.googletagmanager.com/gtag/js?id=${GA_MEASUREMENT_ID}`;
      document.head.appendChild(script1);

      const script2 = document.createElement('script');
      script2.innerHTML = `
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', '${GA_MEASUREMENT_ID}', {
          page_title: 'Telugu Astrology Services',
          custom_map: {'dimension1': 'domain'}
        });
        gtag('event', 'page_view', {
          'domain': 'astrotelugu.com',
          'language': 'Telugu'
        });
      `;
      document.head.appendChild(script2);

      // Load today's panchang data automatically
      document.addEventListener('DOMContentLoaded', function() {
        setCurrentDate();
        loadTodayPanchang();
        loadBlogArticlesPreview();
      });

      function setCurrentDate() {
        const today = new Date();
        const options = { 
          year: 'numeric', 
          month: 'long', 
          day: 'numeric',
          weekday: 'long' 
        };
        const dateString = today.toLocaleDateString('te-IN', options);
        if (document.getElementById('currentDate')) {
          document.getElementById('currentDate').textContent = dateString;
        }
      }

      function loadTodayPanchang() {
        const citySelector = document.getElementById('citySelector');
        if (!citySelector) return;
        
        const selectedCity = citySelector.value.split(',');
        
        if (selectedCity.length === 3) {
          const [city, lat, lon] = selectedCity;
          const today = new Date().toISOString().split('T')[0];
          
          // Use the same API endpoint as Telugu Jyotishyam platform
          fetch('/api/panchang/daily', {
            method: 'POST',
            headers: {
              'Content-Type': 'application/json',
            },
            body: JSON.stringify({
              date: today,
              latitude: parseFloat(lat),
              longitude: parseFloat(lon),
              timezone: 'Asia/Kolkata'
            })
          })
            .then(response => response.json())
            .then(data => {
              if (data.success && data.data) {
                const panchang = data.data;
                
                // Update main panchang elements
                if (document.getElementById('tithi-data')) {
                  document.getElementById('tithi-data').textContent = panchang.tithi || 'N/A';
                }
                if (document.getElementById('tithi-completion')) {
                  document.getElementById('tithi-completion').textContent = ''; // Not available in current API
                }
                if (document.getElementById('nakshatra-data')) {
                  document.getElementById('nakshatra-data').textContent = panchang.nakshatra || 'N/A';
                }
                if (document.getElementById('nakshatra-lord')) {
                  document.getElementById('nakshatra-lord').textContent = ''; // Not available in current API
                }
                if (document.getElementById('yoga-data')) {
                  document.getElementById('yoga-data').textContent = panchang.yog || 'N/A';
                }
                if (document.getElementById('yoga-effect')) {
                  document.getElementById('yoga-effect').textContent = '';
                }
                if (document.getElementById('karana-data')) {
                  document.getElementById('karana-data').textContent = panchang.karan || 'N/A';
                }
                if (document.getElementById('karana-nature')) {
                  document.getElementById('karana-nature').textContent = '';
                }
                
                // Update sun & moon timings
                if (document.getElementById('sunrise-data')) {
                  document.getElementById('sunrise-data').textContent = panchang.sunrise || 'N/A';
                }
                if (document.getElementById('sunset-data')) {
                  document.getElementById('sunset-data').textContent = panchang.sunset || 'N/A';
                }
                if (document.getElementById('moonrise-data')) {
                  document.getElementById('moonrise-data').textContent = panchang.moonrise || 'N/A';
                }
                if (document.getElementById('moonset-data')) {
                  document.getElementById('moonset-data').textContent = panchang.moonset || 'N/A';
                }
                
                // Update rahu kaal (only available timing in current API)
                if (document.getElementById('rahu-kaal-data')) {
                  document.getElementById('rahu-kaal-data').textContent = panchang.rahu_kal || 'N/A';
                }
                
                // Update additional info (use available data)
                if (document.getElementById('weekday')) {
                  document.getElementById('weekday').textContent = panchang.day || 'N/A';
                }
                if (document.getElementById('surya-rashi')) {
                  document.getElementById('surya-rashi').textContent = panchang.surya_rashi || 'N/A';
                }
                if (document.getElementById('chandra-rashi')) {
                  document.getElementById('chandra-rashi').textContent = panchang.chandra_rashi || 'N/A';
                }
                
                // Remove loading class
                document.querySelectorAll('.loading').forEach(el => el.classList.remove('loading'));
              } else {
                console.error('Panchang API error:', data.error);
                document.querySelectorAll('.loading').forEach(el => {
                  el.textContent = 'లోడ్ చేయడంలో లోపం';
                  el.classList.remove('loading');
                });
              }
            })
            .catch(error => {
              console.error('Error loading panchang:', error);
              document.querySelectorAll('.loading').forEach(el => {
                el.textContent = 'లోడ్ చేయడంలో లోపం';
                el.classList.remove('loading');
              });
            });
        }
      }

      function updatePanchang() {
        loadTodayPanchang();
      }

      function viewTodayPanchang() {
        document.getElementById('panchangam').scrollIntoView({ behavior: 'smooth' });
      }

      function openConsultation() {
        document.getElementById('consultation').scrollIntoView({ behavior: 'smooth' });
      }

      function showHoroscope(rashi) {
        alert(`${rashi} రాశి ఫలాలు:\n\nఈ రోజు మీకు మంచి అవకాశాలు వచ్చే అవకాశం ఉంది. వివరాలు తెలుసుకోవాలంటే మా జ్యోతిషితో మాట్లాడండి.`);
      }

      function openKundliCalculator() {
        window.location.href = 'horoscope-generator.html';
      }

      function openMatchMakingCalculator() {
        window.location.href = 'marriage-compatibility.html';
      }

      function openPanchangCalculator() {
        // For now, keep the modal for panchang since it's working well
        // Can be converted to page later if needed
        alert('పంచాంగం వివరాలు త్వరలో అందుబాటులో ఉంటాయి');
      }

      function toggleMobileMenu() {
        const navLinks = document.querySelector('.nav-links');
        navLinks.style.display = navLinks.style.display === 'flex' ? 'none' : 'flex';
      }

      function showDetailedPanchang() {
        // Show detailed panchang information
        alert('వివరమైన పంచాంగం:\n\n✨ చోఘడియా కాలాలు\n⭐ నవగ్రహ స్థానాలు\n🌙 తిథి వివరాలు\n📅 శుభ మరియు అశుభ కాలాలు\n\nఈ వివరాలు త్వరలో అందుబాటులో ఉంటాయి...');
      }

      function readTeluguArticle(articleId) {
        // Create a Telugu article content based on the articleId
        let articleContent = '';
        let articleTitle = '';
        
        switch(articleId) {
          case 'weekly-horoscope':
            articleTitle = 'ఈ వారం రాశి ఫలాలు';
            articleContent = `
              <div style="background: white; padding: 2rem; border-radius: 15px; margin: 1rem 0;">
                <h3 style="color: #4a148c; margin-bottom: 1rem;">${articleTitle}</h3>
                <div style="line-height: 1.8; color: #333;">
                  <p><strong>మేషం రాశి:</strong> ఈ వారం మీకు కెరీర్‌లో మంచి అవకాశాలు వస్తాయి. ఆర్థిక విషయాలలో జాగ్రత్త వహించండి.</p>
                  <p><strong>వృషభం రాశి:</strong> కుటుంబ సంబంధాలలో సామరస్యం నెలకొంటుంది. ఆరోగ్య విషయాలపై దృష్టి పెట్టండి.</p>
                  <p><strong>మిథునం రాశి:</strong> వ్యాపార రంగంలో లాభాలు పొందే అవకాశం ఉంది. ప్రయాణాలు శుభకరంగా ఉంటాయి.</p>
                  <p style="margin-top: 1.5rem; padding: 1rem; background: #f8f9fa; border-radius: 8px;">
                    <strong>మా జ్యోతిషితో వ్యక్తిగత సలహా కోసం:</strong> మీ రాశికి సంబంధించిన వివరమైన ఫలితాలు తెలుసుకోవాలంటే మా నిపుణులతో మాట్లాడండి.
                  </p>
                </div>
                <div style="text-align: center; margin-top: 1.5rem;">
                  <button onclick="openConsultation()" style="background: #4a148c; color: white; padding: 12px 25px; border: none; border-radius: 25px; font-weight: 600; cursor: pointer;">ప్రత్యక్ష సంప్రదింపు</button>
                  <button onclick="closeArticle()" style="background: #666; color: white; padding: 12px 25px; border: none; border-radius: 25px; margin-left: 10px; cursor: pointer;">మూసివేయండి</button>
                </div>
              </div>
            `;
            break;
          case 'saturn-effects':
            articleTitle = 'శని దశ ప్రభావాలు';
            articleContent = `
              <div style="background: white; padding: 2rem; border-radius: 15px; margin: 1rem 0;">
                <h3 style="color: #4a148c; margin-bottom: 1rem;">${articleTitle}</h3>
                <div style="line-height: 1.8; color: #333;">
                  <p>శని దశ అనేది జీవితంలో అత్యంత ముఖ్యమైన కాలంలో ఒకటి. ఈ కాలంలో వ్యక్తి ఎదుర్కొనే సవాళ్లు మరియు అవకాశాలు:</p>
                  <ul style="margin: 1rem 0; padding-left: 2rem;">
                    <li>కెరీర్‌లో మార్పులు మరియు కొత్త బాధ్యతలు</li>
                    <li>కుటుంబ సంబంధాలలో పరిణామాలు</li>
                    <li>ఆరోగ్య విషయాలలో జాగ్రత్త అవసరం</li>
                    <li>ఆర్థిక నిర్వహణలో వివేకం అవసరం</li>
                  </ul>
                  <p><strong>పరిహారాలు:</strong></p>
                  <ul style="margin: 1rem 0; padding-left: 2rem;">
                    <li>శనివారాలు హనుమాన్ చాలీసా పఠనం</li>
                    <li>నల్లని సమాన, తిల్లలు దానం చేయడం</li>
                    <li>శని మంత్రం జపం చేయడం</li>
                  </ul>
                  <p style="margin-top: 1.5rem; padding: 1rem; background: #f8f9fa; border-radius: 8px;">
                    <strong>వ్యక్తిగత శని దశ విశ్లేషణ కోసం:</strong> మీ జాతకంలో శని స్థానం మరియు దశ ప్రभावాలు తెలుసుకోవాలంటే మా నిపుణులతో సంప్రదించండి.
                  </p>
                </div>
                <div style="text-align: center; margin-top: 1.5rem;">
                  <button onclick="openConsultation()" style="background: #4a148c; color: white; padding: 12px 25px; border: none; border-radius: 25px; font-weight: 600; cursor: pointer;">ప్రత్యక్ష సంప్రదింపు</button>
                  <button onclick="closeArticle()" style="background: #666; color: white; padding: 12px 25px; border: none; border-radius: 25px; margin-left: 10px; cursor: pointer;">మూసివేయండి</button>
                </div>
              </div>
            `;
            break;
          case 'rahu-ketu-transit':
            articleTitle = 'రాహు కేతు రవాణా ప్రభావాలు';
            articleContent = `
              <div style="background: white; padding: 2rem; border-radius: 15px; margin: 1rem 0;">
                <h3 style="color: #4a148c; margin-bottom: 1rem;">${articleTitle}</h3>
                <div style="line-height: 1.8; color: #333;">
                  <p>రాహు కేతువుల రవాణా జీవితంలో గణనీయమైన మార్పులను తెస్తుంది. ప్రస్తుత రవాణా ప్రభావాలు:</p>
                  <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; margin: 1.5rem 0;">
                    <div style="background: #f8f9fa; padding: 1rem; border-radius: 8px;">
                      <h4 style="color: #4a148c;">రాహు ప్రభావాలు</h4>
                      <ul style="margin: 0.5rem 0; padding-left: 1.5rem;">
                        <li>అనూహ్య అవకాశాలు</li>
                        <li>విదేశీ అనుబంధాలు</li>
                        <li>సాంకేతిక రంగంలో పురోగతి</li>
                      </ul>
                    </div>
                    <div style="background: #f8f9fa; padding: 1rem; border-radius: 8px;">
                      <h4 style="color: #4a148c;">కేతు ప్రభావాలు</h4>
                      <ul style="margin: 0.5rem 0; padding-left: 1.5rem;">
                        <li>ఆధ్యాత్మిక వృద్ధి</li>
                        <li>అంతర్దృష్టి అభివృద్ధి</li>
                        <li>పాత సంబంధాలలో మార్పులు</li>
                      </ul>
                    </div>
                  </div>
                  <p><strong>రాశివారీ ప్రభావాలు:</strong> ప్రతి రాశికి రాహు కేతువుల ప్రభావం వేరుగా ఉంటుంది. మీ రాశికి సంబంధించిన వివరాలు తెలుసుకోండి.</p>
                  <p style="margin-top: 1.5rem; padding: 1rem; background: #f8f9fa; border-radius: 8px;">
                    <strong>వ్యక్తిగత రవాణా ప్రభావాలు:</strong> మీ జాతకంలో రాహు కేతువుల స్థానం మరియు రవాణా ప్రభావాలు తెలుసుకోవాలంటే మా నిపుణులతో మాట్లాడండి.
                  </p>
                </div>
                <div style="text-align: center; margin-top: 1.5rem;">
                  <button onclick="openConsultation()" style="background: #4a148c; color: white; padding: 12px 25px; border: none; border-radius: 25px; font-weight: 600; cursor: pointer;">ప్రత్యక్ష సంప్రదింపు</button>
                  <button onclick="closeArticle()" style="background: #666; color: white; padding: 12px 25px; border: none; border-radius: 25px; margin-left: 10px; cursor: pointer;">మూసివేయండి</button>
                </div>
              </div>
            `;
            break;
        }
        
        // Create article modal
        const articleModal = document.createElement('div');
        articleModal.id = 'articleModal';
        articleModal.style.cssText = `
          position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
          background: rgba(0,0,0,0.8); z-index: 1000; 
          display: flex; justify-content: center; align-items: center;
          padding: 20px; box-sizing: border-box;
        `;
        
        const articleContainer = document.createElement('div');
        articleContainer.style.cssText = `
          max-width: 800px; width: 100%; max-height: 90vh; 
          overflow-y: auto; border-radius: 15px;
          background: linear-gradient(135deg, #4a148c 0%, #7b1fa2 50%, #c2185b 100%);
          padding: 20px;
        `;
        
        articleContainer.innerHTML = articleContent;
        articleModal.appendChild(articleContainer);
        document.body.appendChild(articleModal);
      }

      function closeArticle() {
        const articleModal = document.getElementById('articleModal');
        if (articleModal) {
          articleModal.remove();
        }
      }

      // Include all existing calculator functions from the original file
      function openKundliCalculator() {
        document.getElementById('kundliModal').style.display = 'flex';
        document.getElementById('kundliDate').value = new Date().toISOString().split('T')[0];
      }

      function openPanchangCalculator() {
        document.getElementById('panchangModal').style.display = 'flex';
        document.getElementById('panchangDate').value = new Date().toISOString().split('T')[0];
      }

      function openMatchMakingCalculator() {
        document.getElementById('matchMakingModal').style.display = 'flex';
      }

      function closeModal(modalId) {
        document.getElementById(modalId).style.display = 'none';
      }

      // Auto-refresh panchang every hour
      setInterval(loadTodayPanchang, 3600000);
    </script>

    <!-- Calculator Modals -->
    <div id="kundliModal" style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; justify-content: center; align-items: center;">
      <div style="background: white; border-radius: 15px; padding: 30px; max-width: 500px; width: 90%; max-height: 90vh; overflow-y: auto;">
        <h3 style="color: #4a148c; margin-bottom: 20px; text-align: center;">🎯 జాతకం రూపొందించండి</h3>
        <form id="kundliForm">
          <div style="margin-bottom: 15px;">
            <label style="display: block; margin-bottom: 5px; font-weight: bold;">పేరు</label>
            <input type="text" id="kundliName" style="width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px;" placeholder="మీ పేరు రాయండి" required>
          </div>
          <div style="margin-bottom: 15px;">
            <label style="display: block; margin-bottom: 5px; font-weight: bold;">జన్మ తేదీ</label>
            <input type="date" id="kundliDate" style="width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px;" required>
          </div>
          <div style="margin-bottom: 15px;">
            <label style="display: block; margin-bottom: 5px; font-weight: bold;">జన్మ సమయం</label>
            <input type="time" id="kundliTime" style="width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px;" required>
          </div>
          <div style="margin-bottom: 15px;">
            <label style="display: block; margin-bottom: 5px; font-weight: bold;">జన్మ స్థలం</label>
            <select id="kundliLocation" style="width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px;" required>
              <option value="">నగరం ఎంచుకోండి</option>
              <option value="Hyderabad,17.3850,78.4867">హైదరాబాద్</option>
              <option value="Vijayawada,16.5062,80.6480">విజయవాడ</option>
              <option value="Visakhapatnam,17.7231,83.3012">విశాఖపట్నం</option>
              <option value="Tirupati,13.6288,79.4192">తిరుపతి</option>
              <option value="Guntur,16.3067,80.4365">గుంటూర్</option>
              <option value="Karimnagar,18.4386,79.1288">కరీంనగర్</option>
              <option value="Warangal,17.9689,79.5941">వరంగల్</option>
              <option value="Nellore,14.4426,79.9865">నెల్లూరు</option>
            </select>
          </div>
          <div style="display: flex; gap: 10px; justify-content: center;">
            <button type="submit" style="background: linear-gradient(135deg, #ff6f00, #ff8f00); color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer;">జాతకం రూపొందించండి</button>
            <button type="button" onclick="closeModal('kundliModal')" style="background: #666; color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer;">మూసివేయండి</button>
          </div>
        </form>
        <div id="kundliResult" style="margin-top: 20px; display: none;"></div>
      </div>
    </div>

    <div id="panchangModal" style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; justify-content: center; align-items: center;">
      <div style="background: white; border-radius: 15px; padding: 30px; max-width: 500px; width: 90%; max-height: 90vh; overflow-y: auto;">
        <h3 style="color: #4a148c; margin-bottom: 20px; text-align: center;">📅 పంచాంగం చూడండి</h3>
        <form id="panchangForm">
          <div style="margin-bottom: 15px;">
            <label style="display: block; margin-bottom: 5px; font-weight: bold;">తేదీ</label>
            <input type="date" id="panchangDate" style="width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px;" required>
          </div>
          <div style="margin-bottom: 15px;">
            <label style="display: block; margin-bottom: 5px; font-weight: bold;">స్థలం</label>
            <select id="panchangLocation" style="width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px;" required>
              <option value="">నగరం ఎంచుకోండి</option>
              <option value="Hyderabad,17.3850,78.4867">హైదరాబాద్</option>
              <option value="Vijayawada,16.5062,80.6480">విజయవాడ</option>
              <option value="Visakhapatnam,17.7231,83.3012">విశాఖపట్నం</option>
              <option value="Tirupati,13.6288,79.4192">తిరుపతి</option>
              <option value="Guntur,16.3067,80.4365">గుంటూర్</option>
              <option value="Karimnagar,18.4386,79.1288">కరీంనగర్</option>
              <option value="Warangal,17.9689,79.5941">వరంగల్</option>
              <option value="Nellore,14.4426,79.9865">నెల్లూరు</option>
            </select>
          </div>
          <div style="display: flex; gap: 10px; justify-content: center;">
            <button type="submit" style="background: linear-gradient(135deg, #ff6f00, #ff8f00); color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer;">పంచాంగం చూడండి</button>
            <button type="button" onclick="closeModal('panchangModal')" style="background: #666; color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer;">మూసివేయండి</button>
          </div>
        </form>
        <div id="panchangResult" style="margin-top: 20px; display: none;"></div>
      </div>
    </div>

    <div id="matchMakingModal" style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; justify-content: center; align-items: center;">
      <div style="background: white; border-radius: 15px; padding: 30px; max-width: 600px; width: 90%; max-height: 90vh; overflow-y: auto;">
        <h3 style="color: #4a148c; margin-bottom: 20px; text-align: center;">💑 జాతక మిలన చేయండి</h3>
        <form id="matchMakingForm">
          <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px;">
            <div>
              <h4 style="color: #4a148c; margin-bottom: 10px;">వర వివరాలు</h4>
              <div style="margin-bottom: 10px;">
                <label style="display: block; margin-bottom: 5px; font-weight: bold;">పేరు</label>
                <input type="text" id="groomName" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 5px;" placeholder="వర పేరు" required>
              </div>
              <div style="margin-bottom: 10px;">
                <label style="display: block; margin-bottom: 5px; font-weight: bold;">జన్మ తేదీ</label>
                <input type="date" id="groomDate" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 5px;" required>
              </div>
              <div style="margin-bottom: 10px;">
                <label style="display: block; margin-bottom: 5px; font-weight: bold;">జన్మ సమయం</label>
                <input type="time" id="groomTime" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 5px;" required>
              </div>
              <div style="margin-bottom: 10px;">
                <label style="display: block; margin-bottom: 5px; font-weight: bold;">జన్మ స్థలం</label>
                <select id="groomLocation" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 5px;" required>
                  <option value="">నగరం ఎంచుకోండి</option>
                  <option value="Hyderabad,17.3850,78.4867">హైదరాబాద్</option>
                  <option value="Vijayawada,16.5062,80.6480">విజయవాడ</option>
                  <option value="Visakhapatnam,17.7231,83.3012">విశాఖపట్నం</option>
                  <option value="Tirupati,13.6288,79.4192">తిరుపతి</option>
                </select>
              </div>
            </div>
            <div>
              <h4 style="color: #4a148c; margin-bottom: 10px;">వధువు వివరాలు</h4>
              <div style="margin-bottom: 10px;">
                <label style="display: block; margin-bottom: 5px; font-weight: bold;">పేరు</label>
                <input type="text" id="brideName" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 5px;" placeholder="వధువు పేరు" required>
              </div>
              <div style="margin-bottom: 10px;">
                <label style="display: block; margin-bottom: 5px; font-weight: bold;">జన్మ తేదీ</label>
                <input type="date" id="brideDate" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 5px;" required>
              </div>
              <div style="margin-bottom: 10px;">
                <label style="display: block; margin-bottom: 5px; font-weight: bold;">జన్మ సమయం</label>
                <input type="time" id="brideTime" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 5px;" required>
              </div>
              <div style="margin-bottom: 10px;">
                <label style="display: block; margin-bottom: 5px; font-weight: bold;">జన్మ స్థలం</label>
                <select id="brideLocation" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 5px;" required>
                  <option value="">నగరం ఎంచుకోండి</option>
                  <option value="Hyderabad,17.3850,78.4867">హైదరాబాద్</option>
                  <option value="Vijayawada,16.5062,80.6480">విజయవాడ</option>
                  <option value="Visakhapatnam,17.7231,83.3012">విశాఖపట్నం</option>
                  <option value="Tirupati,13.6288,79.4192">తిరుపతి</option>
                </select>
              </div>
            </div>
          </div>
          <div style="display: flex; gap: 10px; justify-content: center;">
            <button type="submit" style="background: linear-gradient(135deg, #ff6f00, #ff8f00); color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer;">జాతక మిలన చేయండి</button>
            <button type="button" onclick="closeModal('matchMakingModal')" style="background: #666; color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer;">మూసివేయండి</button>
          </div>
        </form>
        <div id="matchMakingResult" style="margin-top: 20px; display: none;"></div>
      </div>
    </div>

    <script>
      // Form submission handlers
      document.getElementById('kundliForm').addEventListener('submit', async function(e) {
        e.preventDefault();
        
        const locationData = document.getElementById('kundliLocation').value.split(',');
        const formData = {
          name: document.getElementById('kundliName').value,
          date: document.getElementById('kundliDate').value,
          time: document.getElementById('kundliTime').value,
          location: locationData[0],
          latitude: parseFloat(locationData[1]),
          longitude: parseFloat(locationData[2]),
          timezone: 'Asia/Kolkata'
        };

        try {
          const response = await fetch('/api/generate-kundli', {
            method: 'POST',
            headers: { 'Content-Type': 'application/json' },
            body: JSON.stringify(formData)
          });

          const result = await response.json();
          const resultDiv = document.getElementById('kundliResult');
          
          if (result.success) {
            resultDiv.innerHTML = `
              <h4 style="color: #4a148c; margin-bottom: 10px;">జాతక వివరాలు</h4>
              <div style="background: #f8f9fa; padding: 15px; border-radius: 8px;">
                <p><strong>లగ్నం:</strong> ${result.ascendant}</p>
                <p><strong>చంద్ర రాశి:</strong> ${result.moonSign}</p>
                <p><strong>సూర్య రాశి:</strong> ${result.sunSign}</p>
                <p><strong>జన్మ నక్షత్రం:</strong> ${result.nakshatras && result.nakshatras.length > 0 ? result.nakshatras[0].name : 'N/A'}</p>
              </div>
            `;
          } else {
            resultDiv.innerHTML = `<div style="color: red; padding: 10px; background: #ffe6e6; border-radius: 5px;">లోపం: ${result.error}</div>`;
          }
          
          resultDiv.style.display = 'block';
        } catch (error) {
          document.getElementById('kundliResult').innerHTML = `<div style="color: red; padding: 10px; background: #ffe6e6; border-radius: 5px;">లోపం: ${error.message}</div>`;
          document.getElementById('kundliResult').style.display = 'block';
        }
      });

      document.getElementById('panchangForm').addEventListener('submit', async function(e) {
        e.preventDefault();
        
        const locationData = document.getElementById('panchangLocation').value.split(',');
        const date = document.getElementById('panchangDate').value;

        try {
          const response = await fetch('/api/panchang/daily', {
            method: 'POST',
            headers: {
              'Content-Type': 'application/json',
            },
            body: JSON.stringify({
              date: date,
              latitude: locationData[1],
              longitude: locationData[2],
              timezone: 'Asia/Kolkata'
            })
          });
          const result = await response.json();
          const resultDiv = document.getElementById('panchangResult');
          
          if (result.success) {
            resultDiv.innerHTML = `
              <h4 style="color: #4a148c; margin-bottom: 10px;">పంచాంగ వివరాలు</h4>
              <div style="background: #f8f9fa; padding: 15px; border-radius: 8px;">
                <p><strong>తేదీ:</strong> ${result.data.date}</p>
                <p><strong>వారం:</strong> ${result.data.day}</p>
                <p><strong>తిథి:</strong> ${result.data.tithi}</p>
                <p><strong>నక్షత్రం:</strong> ${result.data.nakshatra}</p>
                <p><strong>యోగ:</strong> ${result.data.yog}</p>
                <p><strong>కరణ:</strong> ${result.data.karan}</p>
                <p><strong>సూర్యోదయం:</strong> ${result.data.sunrise}</p>
                <p><strong>సూర్యాస్తమయం:</strong> ${result.data.sunset}</p>
                <p><strong>చంద్రోదయం:</strong> ${result.data.moonrise}</p>
                <p><strong>రాహు కాలం:</strong> ${result.data.rahu_kal}</p>
                <p><strong>సూర్య రాశి:</strong> ${result.data.surya_rashi}</p>
                <p><strong>చంద్ర రాశి:</strong> ${result.data.chandra_rashi}</p>
              </div>
            `;
          } else {
            resultDiv.innerHTML = `<div style="color: red; padding: 10px; background: #ffe6e6; border-radius: 5px;">లోపం: ${result.error}</div>`;
          }
          
          resultDiv.style.display = 'block';
        } catch (error) {
          document.getElementById('panchangResult').innerHTML = `<div style="color: red; padding: 10px; background: #ffe6e6; border-radius: 5px;">లోపం: ${error.message}</div>`;
          document.getElementById('panchangResult').style.display = 'block';
        }
      });

      document.getElementById('matchMakingForm').addEventListener('submit', async function(e) {
        e.preventDefault();
        
        const groomLocationData = document.getElementById('groomLocation').value.split(',');
        const brideLocationData = document.getElementById('brideLocation').value.split(',');
        
        const formData = {
          groom: {
            name: document.getElementById('groomName').value,
            date: document.getElementById('groomDate').value,
            time: document.getElementById('groomTime').value,
            location: groomLocationData[0],
            latitude: parseFloat(groomLocationData[1]),
            longitude: parseFloat(groomLocationData[2])
          },
          bride: {
            name: document.getElementById('brideName').value,
            date: document.getElementById('brideDate').value,
            time: document.getElementById('brideTime').value,
            location: brideLocationData[0],
            latitude: parseFloat(brideLocationData[1]),
            longitude: parseFloat(brideLocationData[2])
          }
        };

        try {
          const response = await fetch('/api/match-making', {
            method: 'POST',
            headers: { 'Content-Type': 'application/json' },
            body: JSON.stringify(formData)
          });

          const result = await response.json();
          const resultDiv = document.getElementById('matchMakingResult');
          
          if (result.success) {
            resultDiv.innerHTML = `
              <h4 style="color: #4a148c; margin-bottom: 10px;">జాతక మిలన ఫలితాలు</h4>
              <div style="background: #f8f9fa; padding: 15px; border-radius: 8px;">
                <p><strong>మొత్తం గుణలు:</strong> ${result.totalScore}/36</p>
                <p><strong>పొరుత్తం:</strong> ${result.compatibility}</p>
                <p><strong>వర రాశి:</strong> ${result.groomMoonSign}</p>
                <p><strong>వధువు రాశి:</strong> ${result.brideMoonSign}</p>
                <p><strong>మంగల దోషం:</strong> ${result.mangalDosha ? 'ఉంది' : 'లేదు'}</p>
              </div>
            `;
          } else {
            resultDiv.innerHTML = `<div style="color: red; padding: 10px; background: #ffe6e6; border-radius: 5px;">లోపం: ${result.error}</div>`;
          }
          
          resultDiv.style.display = 'block';
        } catch (error) {
          document.getElementById('matchMakingResult').innerHTML = `<div style="color: red; padding: 10px; background: #ffe6e6; border-radius: 5px;">లోపం: ${error.message}</div>`;
          document.getElementById('matchMakingResult').style.display = 'block';
        }
      });

      // Close modal when clicking outside
      window.onclick = function(event) {
        const modals = ['kundliModal', 'panchangModal', 'matchMakingModal'];
        modals.forEach(modalId => {
          const modal = document.getElementById(modalId);
          if (event.target === modal) {
            closeModal(modalId);
          }
        });
      }

      // Update panchang when city changes
      function updatePanchang() {
        loadTodayPanchang();
      }

      // Open functions for buttons
      function openKundliCalculator() {
        window.location.href = 'horoscope-generator.html';
      }

      function openConsultation() {
        window.location.href = '#consultation';
      }

      function openPanchangCalculator() {
        // For now, just show current data. Can be expanded later
        alert('పంచాంగ వివరాలు చూపబడ్డాయి');
      }

      // Load blog articles preview for homepage
      async function loadBlogArticlesPreview() {
        try {
          const response = await fetch('/api/blog/telugu');
          const data = await response.json();
          
          if (data.success && data.articles) {
            displayBlogArticlesPreview(data.articles.slice(0, 4)); // Show first 4 articles
          }
        } catch (error) {
          console.error('Error loading blog articles preview:', error);
        }
      }

      function displayBlogArticlesPreview(articles) {
        const previewContainer = document.getElementById('blog-articles-preview');
        if (!previewContainer) return;
        
        previewContainer.innerHTML = articles.map(article => `
          <div class="horoscope-card" onclick="window.location.href='article.html?slug=${article.slug}'" style="min-width: 280px; cursor: pointer;">
            <div style="background: linear-gradient(135deg, #ff6f00, #ff8f00); height: 60px; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.5rem; margin-bottom: 1rem; border-radius: 10px;">
              📚
            </div>
            <h4 style="color: #4a148c; font-weight: 600; margin-bottom: 0.5rem; font-size: 1rem; line-height: 1.3;">
              ${article.title}
            </h4>
            <p style="color: #666; font-size: 0.85rem; line-height: 1.4;">
              ${article.metaDescription.length > 80 ? article.metaDescription.substring(0, 80) + '...' : article.metaDescription}
            </p>
            <div style="margin-top: 0.8rem; display: flex; justify-content: space-between; align-items: center;">
              <span style="background: #e3f2fd; color: #1976d2; padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.7rem; font-weight: 500;">
                ${article.category}
              </span>
              <span style="color: #888; font-size: 0.7rem;">
                ${article.readTime}
              </span>
            </div>
          </div>
        `).join('');
      }
    </script>
  </body>
</html>