:root {
    --bg-base: #f4f7f6;
    --bg-surface: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --accent-primary: #2e7d32;
    --accent-secondary: #e65100;
    --terminal-bg: #edf2f7;
    --terminal-text: #2d3748;
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--bg-base);
    background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4)), url('bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent-primary);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

nav a:hover, nav a.active {
    color: var(--accent-primary);
}

.nav-highlight {
    color: var(--accent-secondary) !important;
}
.nav-highlight:hover, .nav-highlight.active {
    text-shadow: none;
}

/* SPA Section Logic */
.page-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.page-section.active {
    display: flex;
    flex-direction: column;
}

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

.hero {
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8rem 5%;
    background: transparent;
    min-height: 80vh;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
    color: #ffffff;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.hero p {
    font-size: 1.25rem;
    color: #f8fafc;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.cta-button {
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    padding: 1rem 2.5rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.cta-button:hover {
    background: #1b5e20;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 125, 50, 0.5);
}

.cta-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(46, 125, 50, 0.3);
}

.data-partner-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.data-partner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    background: #ffffff;
}

.data-partner-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.section-header p {
    color: #f8fafc;
    text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

.forecast-section {
    padding: 5rem 5%;
    background: transparent;
    min-height: 80vh;
}

.charts-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.chart-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.chart-card::before {
    display: none;
}

.chart-card:nth-child(2)::before {
    display: none;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.status {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
}

.pulse-status::before {
    animation: pulse 2s infinite;
}

.chart-card:nth-child(2) .status::before {
    background: var(--accent-secondary);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 229, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
}

.price-display {
    font-family: 'Fira Code', monospace;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.currency { color: var(--accent-primary); font-size: 1.5rem; }
.chart-card:nth-child(2) .currency { color: var(--accent-secondary); }
.unit { font-size: 0.9rem; color: var(--text-secondary); font-family: 'Space Grotesk', sans-serif;}

.mock-chart {
    width: 100%;
    height: 150px;
    position: relative;
    margin-bottom: 1.5rem;
}

.svg-chart {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.ml-reasoning {
    background: rgba(46, 125, 50, 0.05);
    border-left: 3px solid var(--accent-primary);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin-top: auto;
}

.chart-card:nth-child(2) .ml-reasoning {
    border-left-color: var(--accent-secondary);
    background: rgba(230, 81, 0, 0.05);
}

.reasoning-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.reasoning-text {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.highlight {
    color: var(--accent-primary);
    font-weight: 700;
}
.chart-card:nth-child(2) .highlight {
    color: var(--accent-secondary);
}

/* Pipeline Terminal Styles */
.pipeline-section {
    padding: 5rem 5%;
    align-items: center;
    min-height: 80vh;
}

.aws-infra-block {
    width: 100%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

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

.infra-card {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.infra-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.infra-status {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 1rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    display: inline-table;
    width: fit-content;
}

.infra-status.error { background: #fed7d7; color: #c53030; }
.infra-status.warning { background: #feebc8; color: #c05621; }
.infra-status.pending { background: #e2e8f0; color: #4a5568; }

.infra-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: auto;
}

.terminal-container {
    width: 100%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-top: 2rem;
}

.terminal-header {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.term-dots {
    display: flex;
    gap: 6px;
    margin-right: 1rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.term-title {
    color: #888;
    font-size: 0.8rem;
    font-family: 'Fira Code', monospace;
}

.terminal-window {
    padding: 1.5rem;
    height: 400px;
    overflow-y: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--terminal-text);
}

.log-line {
    margin-bottom: 0.25rem;
    opacity: 0;
    animation: typeLog 0.1s forwards;
}

.log-timestamp {
    color: #888;
    margin-right: 1rem;
}

.log-level-info { color: #3182ce; font-weight: 600; }
.log-level-warn { color: #d69e2e; font-weight: 600; }
.log-level-error { color: #e53e3e; font-weight: 600; }
.log-level-success { color: #38a169; font-weight: 600; }
@keyframes typeLog {
    to { opacity: 1; }
}

/* Data Grid Styles */
.data-grid-container {
    max-width: 900px;
    margin: 4rem auto 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.data-grid-container h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 700;
}

.apmc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.apmc-table th, .apmc-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.apmc-table th {
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.apmc-table tr:hover td {
    background: rgba(0,0,0,0.02);
}

.trend-up { color: #38a169; font-weight: 600; }
.trend-down { color: #e53e3e; font-weight: 600; }

/* Auth Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-surface);
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalPop 0.3s ease-out forwards;
}

@keyframes modalPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    color: var(--accent-primary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem 1.5rem;
    text-align: center;
}

/* Govt Schemes Scraper Styles */
.schemes-section {
    padding: 5rem 5%;
    align-items: center;
    min-height: 80vh;
}

.scraper-container {
    width: 100%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-top: 2rem;
}

.scraper-header {
    background: #f8fafc;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.scraper-stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
}

.scraper-feed {
    padding: 1.5rem;
    height: 450px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scraper-alert {
    background: #f8fafc;
    border-left: 4px solid var(--accent-primary);
    padding: 1.2rem;
    border-radius: 0 8px 8px 0;
    animation: fadeIn 0.3s ease-out forwards;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.scraper-alert.nafed { border-left-color: #d69e2e; }
.scraper-alert.pmfby { border-left-color: #3182ce; }
.scraper-alert.kisan { border-left-color: #38a169; }

.alert-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}

.alert-body {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Agri-Climate AI Styles */
.climate-section {
    padding: 5rem 5%;
    background: transparent;
    min-height: 80vh;
    align-items: center;
}

.climate-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1000px;
    margin-top: 2rem;
}

.climate-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.climate-card h3 {
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
    font-size: 1.3rem;
}

.climate-card:nth-child(2) h3 {
    color: var(--accent-secondary);
}

.climate-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.climate-stat {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.02);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.coord-input {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0,0,0,0.1);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    flex: 1;
    min-width: 200px;
    outline: none;
    transition: all 0.3s ease;
}

.coord-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
    background: #ffffff;
}

.weather-forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.forecast-day-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 8px;
    padding: 1.2rem;
    text-align: center;
}

.forecast-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.forecast-temp {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'Fira Code', monospace;
}

.forecast-rain {
    font-size: 0.8rem;
    color: #3182ce;
    margin-top: 0.5rem;
    font-weight: 600;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'Fira Code', monospace;
}

.error-text { color: #e53e3e; font-weight: 600;}
.warning-text { color: #d69e2e; font-weight: 600;}

.suitability-matrix {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.05);
}

.matrix-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

.badge-danger { background: #fed7d7; color: #c53030; }
.badge-warning { background: #feebc8; color: #c05621; }
.badge-success { background: #c6f6d5; color: #2f855a; }

.matrix-reasoning {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.about-section {
    padding: 5rem 5%;
    align-items: center;
    min-height: 80vh;
}

.founder-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 3rem;
    border-radius: 12px;
    max-width: 800px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.credential-highlight {
    color: var(--accent-primary);
    font-size: 1.1rem;
    margin: 0.5rem 0 1.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

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

footer {
    text-align: center;
    padding: 3rem 5%;
    border-top: 1px solid rgba(0,0,0,0.05);
    color: var(--text-secondary);
    font-size: 0.9rem;
}
