:root {
    --bg-color: #0f172a;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.6);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --danger: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    line-height: 1.6;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.hero {
    padding: 2.5rem;
    text-align: center;
}

.hero h1 {
    font-size: clamp(1.5rem, 7vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    overflow-wrap: anywhere;
    line-height: 1.2;
}

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

.dashboard {
    display: grid;
    grid-template-columns: minmax(0, 350px) minmax(0, 1fr);
    gap: 2rem;
}

.card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.75rem;
}

/* Form Styles */
form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.5rem;
    min-width: 0;
}

label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

input[type="date"], input[type="time"] {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
}

input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-primary {
    background: var(--accent-color);
    color: #0f172a;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.btn-primary:hover {
    background: #7dd3fc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loader */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.error-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: #fca5a5;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
}

.info-box {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #bae6fd;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    text-align: left;
}

.results-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.footnote {
    font-size: 0.7rem;
    line-height: 1.4;
    color: var(--text-secondary, #94a3b8);
    margin-top: 0.75rem;
    margin-bottom: 0;
    text-align: left;
    opacity: 0.85;
}

/* Visualization */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
}

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

.rank-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    background: rgba(56, 189, 248, 0.2);
    color: var(--accent-color);
}

.rank-1 {
    background: rgba(250, 204, 21, 0.2);
    color: #facc15;
}

.rank-2 {
    background: rgba(167, 139, 250, 0.2);
    color: #a78bfa;
}

.rank-3 {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.rank-4 {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
}

.rank-5 {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .app-container {
        padding: 1rem;
        gap: 1.25rem;
    }

    .hero {
        padding: 1.5rem 1rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .card {
        padding: 1.25rem;
        gap: 1rem;
    }

    .horoscopes-container {
        gap: 1rem;
    }

    .chart-box {
        padding: 1rem;
        max-width: 100%;
    }

    table {
        font-size: 0.78rem;
    }

    th, td {
        padding: 0.5rem;
    }
}

/* Autocomplete Styles */
.position-relative {
    position: relative;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    list-style: none;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.suggestions-list li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-primary);
    font-size: 0.9rem;
}

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

.suggestions-list li:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Horoscope Charts Styles */
.horoscopes-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.chart-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.4);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    width: 100%;
    max-width: 280px;
    box-sizing: border-box;
}

.chart-box h3 {
    font-size: 1.1rem;
    color: var(--accent-color);
}

.vedic-chart-svg {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1 / 1;
    stroke: rgba(255, 255, 255, 0.3);
    fill: none;
    stroke-width: 1.5;
}

.vedic-chart-text {
    font-size: 6px;
    font-weight: 500;
    fill: #f8fafc;
    text-anchor: middle;
    dominant-baseline: central;
    letter-spacing: 0.05em;
    font-family: 'Inter', -apple-system, sans-serif;
}

.vedic-chart-text tspan {
    font-size: 6px;
}

.rashi-number {
    font-size: 4px;
    fill: var(--text-secondary);
    text-anchor: middle;
    dominant-baseline: middle;
    stroke: none;
    font-weight: 400;
    opacity: 0.7;
}

.vedic-chart-text.lagna {
    fill: var(--accent-color);
    font-weight: bold;
}

/* Disclaimer Modal */
.disclaimer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.disclaimer-overlay.hidden {
    display: none;
}

.disclaimer-box {
    max-width: 520px;
    width: 100%;
    padding: 2rem;
    max-height: 85vh;
    overflow-y: auto;
}

.disclaimer-box h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.disclaimer-box p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.disclaimer-box .btn-primary {
    width: 100%;
    margin-top: 0.5rem;
}

/* Persistent footer disclaimer */
.site-footer {
    text-align: center;
    padding: 1rem 1.5rem;
}

.site-footer p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.75;
    line-height: 1.5;
    max-width: 760px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .disclaimer-box {
        padding: 1.5rem;
    }
}
