:root {
    --bg-dark: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #22c55e;
    --accent-glow: rgba(34, 197, 94, 0.2);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at top right, #064e3b, var(--bg-dark) 60%);
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1rem;
    gap: 1rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* HEADER STYLES */
.header-panel {
    padding: 1.5rem 2rem 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInDown 0.6s ease-out;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.title-area h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, #4ade80, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title-area .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-top: 0.25rem;
}

.info-section {
    flex: 1;
    max-width: 600px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.info-section strong {
    color: var(--text-main);
}

/* TAB BUTTONS */
.tab-buttons {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    padding: 1rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--accent);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 10px var(--accent-glow);
}

/* MAIN CONTENT */
.content-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
}

.tab-content {
    display: none;
    height: 100%;
    width: 100%;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

/* MAP TAB */
.map-wrapper {
    height: 100%;
    width: 100%;
    overflow: hidden;
    padding: 0;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 16px;
}

/* THEORY TAB */
.theory-wrapper {
    height: 100%;
    width: 100%;
    padding: 2.5rem;
    overflow-y: auto;
}

.theory-wrapper h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-main);
}

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

.theory-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.theory-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.2);
}

.theory-card.full-width {
    grid-column: 1 / -1;
}

.theory-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.theory-card p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.theory-card ul {
    color: var(--text-muted);
    margin-left: 1.5rem;
    line-height: 1.6;
}

/* SIMULATOR WIDGET */
.widget-card {
    border: 1px solid var(--accent);
    background: rgba(15, 23, 42, 0.6);
}

.simulator-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
}

.slider-container input {
    width: 100%;
    margin-top: 0.5rem;
    cursor: pointer;
}

.slider-container label {
    font-weight: 600;
    font-size: 1.1rem;
}

.sim-visuals {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 2rem;
    flex-wrap: wrap;
}

.leaf-container {
    width: 120px;
    height: 120px;
}

.leaf-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5));
    transition: all 0.3s ease;
}

.data-readout {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-family: monospace;
    font-size: 1.1rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed var(--glass-border);
    padding-bottom: 0.5rem;
}

.calc-row {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.final-ndvi {
    margin-top: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
    background: rgba(34, 197, 94, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* ANIMATIONS */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

/* Scrollbar styling for theory tab */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }
