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

body {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background: linear-gradient(135deg, #2a3441 0%, #3a4553 50%, #4a5568 100%);
    color: #e2e8f0;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px solid rgba(0, 255, 136, 0.2);
    padding-bottom: 24px;
}

h1 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2.8rem;
    font-weight: 300;
    margin-bottom: 8px;
    color: #00ff88;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}


.subtitle {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.main-content {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.calculator-panel {
    background: linear-gradient(135deg, rgba(12, 18, 32, 0.95), rgba(26, 32, 44, 0.9));
    backdrop-filter: blur(20px);
    border-radius: 8px;
    padding: 28px;
    border: 2px solid rgba(0, 255, 136, 0.2);
    box-shadow: 
        0 0 40px rgba(0, 255, 136, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
}

.calculator-panel::before {
    content: "ENVIRONMENTAL PARAMETERS";
    position: absolute;
    top: -12px;
    left: 16px;
    background: #1a202c;
    padding: 4px 12px;
    font-size: 0.85rem;
    color: #00ff88;
    letter-spacing: 0.1em;
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 4px;
}

.calculator-panel h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 24px;
    color: #00ff88;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    padding-bottom: 8px;
}

.input-group {
    margin-bottom: 24px;
    position: relative;
}

.input-group:first-child {
    margin-top: 16px;
}

.input-group::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #00ff88, transparent);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 1rem;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 12px;
}

input[type="number"], input[type="range"] {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.8);
    color: #00ff88;
    font-size: 16px;
    font-family: 'SF Mono', Monaco, monospace;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

input[type="number"] {
    font-weight: 600;
    text-align: center;
}

input[type="number"]:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 
        0 0 0 2px rgba(0, 255, 136, 0.2),
        inset 0 0 10px rgba(0, 255, 136, 0.05);
    background: rgba(15, 23, 42, 0.95);
}

input[type="range"] {
    height: 8px;
    padding: 0;
    background: rgba(51, 65, 85, 0.6);
    border: 2px solid rgba(0, 255, 136, 0.4);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.2);
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.7);
    transition: all 0.2s ease;
    border: 3px solid #0a0f16;
}

input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.7);
    transform: scale(1.1);
}

.unit-toggle {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.unit-btn {
    flex: 1;
    padding: 10px 18px;
    border: none;
    background: rgba(51, 65, 85, 0.4);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
    font-family: 'SF Mono', Monaco, monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.unit-btn:hover {
    background: rgba(51, 65, 85, 0.6);
}

.unit-btn.active {
    background: #00ff88;
    color: #0a0f16;
    font-weight: 700;
}

.stage-selector {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.stage-btn {
    padding: 14px 10px;
    border: none;
    background: rgba(51, 65, 85, 0.4);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    text-align: center;
    font-weight: 500;
    font-family: 'SF Mono', Monaco, monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stage-btn:hover {
    background: rgba(51, 65, 85, 0.6);
}

.stage-btn.active {
    background: #00ff88;
    color: #0a0f16;
    font-weight: 700;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 12px;
    font-weight: 500;
    color: #cbd5e1;
    font-size: 1rem;
    padding-left: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    margin-bottom: 0;
    accent-color: #00ff88;
    border: 2px solid rgba(0, 255, 136, 0.4);
    border-radius: 3px;
    background: rgba(15, 23, 42, 0.8);
    cursor: pointer;
}

.leaf-temp-controls {
    background: rgba(0, 255, 136, 0.05);
    padding: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 136, 0.2);
    margin-top: 8px;
}

.dli-controls {
    background: rgba(0, 255, 136, 0.05);
    padding: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 136, 0.2);
    margin-top: 8px;
}

.target-controls-active {
    display: block;
    background: rgba(0, 255, 136, 0.05);
    padding: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 136, 0.2);
    margin-top: 8px;
}

.target-section {
    margin-bottom: 24px;
}

/* Spacing for checkboxes in target section */
.target-section .checkbox-label {
    margin-bottom: 16px;
}

.target-section .checkbox-label:last-of-type {
    margin-bottom: 24px;
}

.leaf-temp-info {
    margin-top: 8px;
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
    text-transform: none;
    letter-spacing: normal;
}

.dli-inputs-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.dli-input-group {
    flex: 1;
}

.dli-input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.dli-input-group input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 4px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.9rem;
}

.dli-input-group input:focus {
    outline: none;
    border-color: rgba(0, 255, 136, 0.5);
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.1);
}

.input-info {
    margin-top: 6px;
}

.input-info small {
    color: #94a3b8;
    font-size: 0.8rem;
    font-style: italic;
    display: block;
}

.dli-result {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 255, 136, 0.05));
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    margin: 20px 0 16px 0;
    border: 2px solid rgba(0, 255, 136, 0.3);
    position: relative;
}

.dli-result::before {
    content: "CALCULATED DLI";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #2a3441;
    padding: 4px 12px;
    font-size: 0.85rem;
    color: #00ff88;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.dli-value {
    font-size: 2.4rem;
    font-weight: 300;
    margin-bottom: 12px;
    color: #00ff88;
    font-family: 'SF Mono', Monaco, monospace;
    line-height: 1;
    margin-top: 8px;
}

.dli-unit {
    font-size: 0.95rem;
    color: #94a3b8;
    font-weight: 400;
    margin-top: 2px;
}

.dli-chart-container {
    margin: 20px 0;
    background: rgba(0, 255, 136, 0.03);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 4px;
    padding: 16px;
    text-align: center;
}

.dli-chart-container canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.dli-chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 12px;
    font-size: 0.85rem;
}

.dli-chart-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dli-chart-legend .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.dli-info {
    margin-top: 16px;
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
    text-transform: none;
    letter-spacing: normal;
    padding-left: 12px;
}

.storage-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.storage-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
    font-family: 'SF Mono', Monaco, monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
}

.save-btn {
    background: linear-gradient(135deg, #059669, #00ff88);
    color: #0a0f16;
}

.save-btn:hover {
    background: linear-gradient(135deg, #047857, #00e67a);
    transform: translateY(-1px);
}

.log-btn {
    background: linear-gradient(135deg, #1e3a8a, #3730a3);
    color: #a5b4fc;
    border: 1px solid rgba(165, 180, 252, 0.2);
}

.log-btn:hover {
    background: linear-gradient(135deg, #312e81, #4338ca);
    color: #c7d2fe;
    border-color: rgba(165, 180, 252, 0.4);
    transform: translateY(-1px);
}

.load-btn {
    background: rgba(51, 65, 85, 0.6);
    color: #e2e8f0;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.load-btn:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: rgba(0, 255, 136, 0.3);
}

.clear-btn {
    background: rgba(220, 38, 38, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.clear-btn:hover {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.5);
}

.storage-info {
    margin-top: 8px;
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
    text-transform: none;
    letter-spacing: normal;
    padding-left: 12px;
}

.storage-section {
    margin-top: 20px;
}

.storage-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 1rem;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 0;
}

.target-section {
    margin-top: 20px;
}

.target-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 1rem;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 0;
}

.temp-comparison {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 255, 136, 0.08);
    padding: 14px;
    border-radius: 4px;
    margin: 12px 0;
    font-size: 0.95rem;
    border: 1px solid rgba(0, 255, 136, 0.2);
    font-family: 'SF Mono', Monaco, monospace;
}

.temp-type {
    text-align: center;
}

.temp-value {
    font-weight: 700;
    color: #00ff88;
    font-size: 1rem;
}

.target-info {
    font-size: 1rem;
    margin-top: 12px;
    color: #94a3b8;
    font-family: 'SF Mono', Monaco, monospace;
}

.recommendations {
    background: rgba(15, 23, 42, 0.6);
    padding: 14px;
    border-radius: 4px;
    margin-top: 16px;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.rec-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #00ff88;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rec-option {
    background: rgba(30, 41, 59, 0.5);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(100, 116, 139, 0.2);
    transition: all 0.2s ease;
    font-family: 'SF Mono', Monaco, monospace;
}

.rec-option:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(0, 255, 136, 0.3);
}

.rec-option:last-child {
    margin-bottom: 0;
}

.rec-action {
    font-weight: 500;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.rec-change {
    font-size: 0.85rem;
    color: #00ff88;
    font-weight: 600;
}

.on-target {
    text-align: center;
    color: #00ff88;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.vpd-result {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 255, 136, 0.05));
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    margin-top: 32px;
    border: 2px solid rgba(0, 255, 136, 0.3);
    position: relative;
}

.vpd-result::before {
    content: "CURRENT VPD READING";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a202c;
    padding: 4px 12px;
    font-size: 0.85rem;
    color: #00ff88;
    letter-spacing: 0.1em;
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 4px;
}

.vpd-value {
    font-size: 2.8rem;
    font-weight: 300;
    margin-bottom: 4px;
    color: #00ff88;
    font-family: 'SF Mono', Monaco, monospace;
    letter-spacing: -0.05em;
}

.vpd-value::after {
    content: " kPa";
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 400;
    margin-left: 1em;
    letter-spacing: 0.1em;
}

.vpd-status {
    font-size: 0.9rem;
    padding: 6px 14px;
    border-radius: 4px;
    margin-top: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'SF Mono', Monaco, monospace;
}

.chart-container {
    background: linear-gradient(135deg, rgba(12, 18, 32, 0.95), rgba(26, 32, 44, 0.9));
    backdrop-filter: blur(20px);
    border-radius: 8px;
    padding: 28px;
    border: 2px solid rgba(0, 255, 136, 0.2);
    box-shadow: 
        0 0 40px rgba(0, 255, 136, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
}

.chart-container::before {
    content: "VPD CHART";
    position: absolute;
    top: -12px;
    left: 16px;
    background: #1a202c;
    padding: 4px 12px;
    font-size: 0.85rem;
    color: #00ff88;
    letter-spacing: 0.1em;
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 4px;
}

.chart-container h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 20px;
    color: #00ff88;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    padding-bottom: 8px;
}

#vpdChartDesktop, #vpdChartMobile {
    width: 100%;
    height: 400px;
    border-radius: 4px;
    background: white;
    border: 2px solid rgba(0, 255, 136, 0.3);
    margin-top: 16px;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(30, 41, 59, 0.4);
    border-radius: 4px;
    font-size: 0.75rem;
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
    font-family: 'SF Mono', Monaco, monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.growth-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.stage-card {
    background: linear-gradient(135deg, rgba(12, 18, 32, 0.95), rgba(26, 32, 44, 0.9));
    backdrop-filter: blur(20px);
    border-radius: 8px;
    padding: 24px;
    border: 1px solid rgba(100, 116, 139, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.stage-card:hover {
    border-color: rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
}

.stage-title {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #00ff88;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    padding-bottom: 6px;
}

.stage-card p {
    color: #cbd5e1;
    margin-bottom: 10px;
    line-height: 1.6;
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.stage-card p:last-child {
    margin-bottom: 0;
    font-style: italic;
    color: #94a3b8;
}

.stage-card strong {
    color: #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    font-weight: 600;
}

/* Mobile chart - hidden on desktop, shown on mobile */
.mobile-chart {
    display: none;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .vpd-value {
        font-size: 2.8rem;
    }
    
    /* Hide the main chart container on tablets and mobile */
    .main-content > .chart-container {
        display: none;
    }
    
    /* Show the mobile chart inside calculator panel */
    .mobile-chart {
        display: block;
        margin-top: 24px;
        margin-bottom: 32px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 16px;
        font-size: 14px;
    }
    
    .calculator-panel,
    .chart-container {
        padding: 20px;
    }
    
    .stage-selector {
        grid-template-columns: 1fr;
    }
    
    /* Adjust mobile chart for smaller screens */
    .mobile-chart {
        padding: 16px;
    }
    
    .mobile-chart #vpdChartMobile {
        height: 300px;
    }
    
    /* Fix VPD result label positioning on mobile */
    .mobile-chart .vpd-result {
        margin-top: 70px;
    }
    
    .mobile-chart .vpd-result::before {
        top: -24px;
    }
}

.status-low { 
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
}
.status-optimal { 
    background: linear-gradient(135deg, #059669, #00ff88);
    color: #0a0f16;
}
.status-high { 
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: white;
}
.status-danger { 
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}

/* Footer styles */
.footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid rgba(0, 255, 136, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.footer-content {
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-content p {
    margin: 0;
}

.footer-content a {
    color: #00ff88;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: #4ade80;
    text-decoration: underline;
}

/* Privacy Policy Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: linear-gradient(135deg, #1a202c, #2d3748);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 255, 136, 0.2);
    position: relative;
}

.close {
    color: #94a3b8;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 25px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #00ff88;
}

.modal-content h2 {
    color: #00ff88;
    margin-top: 0;
    font-family: 'SF Mono', Monaco, monospace;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    padding-bottom: 10px;
}

.modal-content h3 {
    color: #e2e8f0;
    margin-top: 20px;
    margin-bottom: 10px;
    font-family: 'SF Mono', Monaco, monospace;
}

.privacy-content p {
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 15px;
}

.privacy-content strong {
    color: #e2e8f0;
}