:root {
    --bg-dark: #0a0e17;
    --bg-card: rgba(18, 25, 41, 0.75);
    --border-glow: #34488b;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --secondary: #ec4899;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Background Animations */
.stars-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url(https://www.transparenttextures.com/patterns/stardust.png) repeat top center;
    z-index: -2;
    opacity: 0.3;
}

.twinkling {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: transparent url('https://raw.githubusercontent.com/manolo1188/twinkling/master/twinkling.png') repeat top center;
    z-index: -1;
    animation: move-twink-back 200s linear infinite;
    opacity: 0.2;
}

@keyframes move-twink-back {
    from {background-position: 0 0;}
    to {background-position: -10000px 5000px;}
}

/* Navbar */
.navbar {
    padding: 1.5rem 2rem;
    background: rgba(10, 14, 23, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.logo i {
    color: var(--accent);
}

.highlight {
    background: linear-gradient(to right, var(--accent), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    animation: slideDown 0.8s ease forwards;
}

.hero h1 {
    font-size: 3rem;
    background: linear-gradient(to right, #ffffff, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Calculator Card */
.calculator-card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-glow);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: fadeIn 1s ease forwards;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.input-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    position: relative;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Results Section */
.hidden {
    display: none !important;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeInUp 0.8s ease forwards;
}

.chart-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.summary-card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s;
}

.summary-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.summary-card i {
    font-size: 2.5rem;
    background: linear-gradient(to bottom, var(--secondary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.summary-card h4 {
    font-weight: 500;
    color: var(--text-muted);
}

.summary-card p {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.data-grids {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media(min-width: 900px) {
    .data-grids {
        display: grid;
        grid-template-columns: 3fr 2fr;
    }
}

.data-card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    overflow: hidden;
}

/* South Indian Chart CSS */
.si-chart {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 100px);
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.si-cell {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.si-center {
    grid-column: 2 / 4;
    grid-row: 2 / 4;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.planet-pill {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    font-size: 0.75rem;
}

.ascendant-pill {
    background: rgba(236, 72, 153, 0.2);
    color: #fbcfe8;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(236, 72, 153, 0.3);
    font-size: 0.75rem;
    font-weight: bold;
}

.card-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
}

th {
    background: rgba(0, 0, 0, 0.2);
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

td {
    font-weight: 400;
}

.planet-name {
    font-weight: 600;
    color: #e2e8f0;
}

.sign-badge {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Animations */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

.spinner {
    animation: spin 1s linear infinite;
}

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

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    padding: 0;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.dropdown-list li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-main);
    transition: background 0.2s;
    font-size: 0.9rem;
}

.dropdown-list li:last-child {
    border-bottom: none;
}

.dropdown-list li:hover {
    background: rgba(139, 92, 246, 0.2);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* Horoscope Card */
.horoscope-card {
    background: linear-gradient(145deg, rgba(236, 72, 153, 0.15), rgba(18, 25, 41, 0.8));
    backdrop-filter: blur(15px);
    border: 1px solid var(--secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.horoscope-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}
.horoscope-card p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #f8fafc;
}

/* Insights Card */
.insights-card {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.1), rgba(18, 25, 41, 0.8));
    backdrop-filter: blur(15px);
    border: 1px solid var(--accent);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.insights-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    margin-bottom: 0.25rem;
}
.insights-card .subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.insights-card ul {
    list-style-type: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.insights-card li {
    background: rgba(0,0,0,0.3);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--secondary);
}

/* Tabs */
.tabs-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}
.tab-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main);
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
}
.tab-btn:hover {
    background: rgba(255,255,255,0.1);
}
.tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 350px;
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    z-index: 1000;
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
}
.chat-header {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    padding: 1rem;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
.chat-body {
    display: flex;
    flex-direction: column;
    height: 400px;
    transition: all 0.3s;
}
.chat-body.hidden {
    display: none;
}
.api-key-section {
    padding: 0.75rem;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.api-key-section input {
    width: 100%;
    padding: 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 0.25rem;
    color: white;
    font-family: 'Outfit', sans-serif;
}
.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.msg {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
}
.msg.ai {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-bottom-left-radius: 0;
    align-self: flex-start;
    max-width: 90%;
}
.msg.user {
    background: rgba(236, 72, 153, 0.2);
    border: 1px solid rgba(236, 72, 153, 0.4);
    border-bottom-right-radius: 0;
    align-self: flex-end;
    max-width: 85%;
}
.chat-input-area {
    display: flex;
    padding: 1rem;
    gap: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.chat-input-area input {
    flex: 1;
    padding: 0.5rem 1rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 2rem;
    color: white;
    font-family: 'Outfit', sans-serif;
}
.chat-input-area button {
    background: var(--accent);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-input-area button:hover {
    transform: scale(1.1);
}

/* Plan Toggle */
.plan-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.plan-toggle span {
    opacity: 0.5;
    transition: opacity 0.3s;
}
.plan-toggle span.active {
    opacity: 1;
    font-weight: 700;
}
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.2);
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}
.slider.round {
    border-radius: 24px;
}
.slider.round:before {
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--accent);
}
input:checked + .slider:before {
    transform: translateX(20px);
}

/* Modal & Paywall Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}
.modal-overlay.hidden {
    display: none !important;
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 1rem;
    padding: 2.5rem;
    max-width: 450px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}
.close-modal:hover {
    color: white;
}
.paywall-blur {
    filter: blur(4px) grayscale(50%);
    opacity: 0.7;
    pointer-events: none;
    user-select: none;
}
.paywall-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 23, 0.3);
    z-index: 10;
}
.paywall-overlay button {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.4);
    transition: transform 0.2s;
}
.paywall-overlay button:hover {
    transform: scale(1.05);
}
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Checkout Form Styles */
.btn-back {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    transition: color 0.2s;
    font-family: 'Outfit', sans-serif;
}
.btn-back:hover {
    color: white;
}
.checkout-form label {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--text-muted);
    font-weight: 500;
}
.card-input-wrapper {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}
.card-input-wrapper:focus-within {
    border-color: #6366f1; /* Stripe blurple */
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}
.card-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.card-input-wrapper input {
    background: transparent !important;
    border: none !important;
    padding: 0.75rem 1rem !important;
    color: white !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 1rem !important;
}
.card-input-wrapper input:focus {
    outline: none !important;
    box-shadow: none !important;
}
.card-number {
    flex: 2;
    padding-left: 2.5rem !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.card-expiry {
    flex: 1;
    max-width: 90px;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    text-align: center;
}
.card-cvc {
    flex: 1;
    max-width: 70px;
    text-align: center;
}
.btn-primary.pay-btn {
    background: #6366f1; /* Stripe purplish */
    color: white;
}
.btn-primary.pay-btn:hover {
    background: #4f46e5;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.4);
}
