/* CSS Variables - Cassava AI inspired theme */
:root {
    --primary-green: #22c55e;
    --dark-green: #16a34a;
    --light-green: #86efac;
    --accent-green: #10b981;
    --background-color: #ffffff;
    --surface-color: #f9fafb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --gradient-green: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header Styles */
header {
    text-align: center;
    padding: 60px 20px 40px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 0 0 24px 24px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-green);
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 700px;
    margin: 0 auto;
}

/* Main Layout */
.main-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 32px;
    margin-bottom: 48px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Controls Panel */
.controls-panel {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 20px;
    border: 1px solid var(--border-color);
}

.controls-panel h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.select-input,
.number-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background: white;
    color: var(--text-primary);
    font-family: inherit;
}

.select-input:hover,
.number-input:hover {
    border-color: var(--accent-green);
}

.select-input:focus,
.number-input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.select-input:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-green);
}

/* Cost Calculator Section */
.cost-calculator-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1.5px solid var(--border-color);
}

.cost-calculator-section h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.calculate-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--gradient-green);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
    letter-spacing: 0.01em;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

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

/* Results Panel */
.results-panel {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.results-panel h2 {
    color: var(--text-primary);
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.results-panel h3 {
    color: var(--text-primary);
    font-size: 1.375rem;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 16px;
}

.results-panel h4 {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
}

/* Hardware Info */
.hardware-info {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 28px;
    border-left: 4px solid var(--primary-green);
    border: 1px solid #bbf7d0;
}

.hardware-info h3 {
    color: var(--text-primary);
    margin: 0 0 12px 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.hardware-info p {
    margin: 6px 0;
    color: var(--text-primary);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.metric-card {
    background: white;
    padding: 28px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    border: 1.5px solid var(--border-color);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-green);
}

.metric-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 6px;
}

.metric-unit {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Detailed Info */
.detailed-info {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-green);
    margin-top: 16px;
    border: 1px solid var(--border-color);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: var(--text-primary);
}

.info-value {
    color: var(--primary-green);
    font-weight: 600;
}

.detailed-info p {
    margin: 10px 0;
    color: var(--text-primary);
}

.detailed-info strong {
    color: var(--primary-green);
}

/* Performance Visualization */
.performance-visualization {
    margin-top: 32px;
}

#performance-chart,
#comparison-chart {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-top: 16px;
    width: 100%;
    height: 400px;
    border: 1px solid var(--border-color);
}

/* Cost Info */
.cost-info {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 24px;
    border-radius: 12px;
    border-left: 4px solid #f59e0b;
    margin-top: 16px;
    border: 1px solid #fcd34d;
}

.cost-info h4 {
    color: #92400e;
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(146, 64, 14, 0.1);
}

.cost-row:last-child {
    border-bottom: none;
}

.cost-label {
    font-weight: 500;
    color: var(--text-primary);
}

.cost-value {
    color: #92400e;
    font-weight: 600;
}

.cost-highlight {
    font-size: 1.125rem;
    color: #78350f;
    font-weight: 700;
}

.cost-warning {
    color: #dc2626;
    font-weight: 500;
    padding: 12px;
    background: #fef2f2;
    border-radius: 8px;
    border-left: 3px solid #dc2626;
}

/* Cost Calculation Section */
.cost-calculation-section {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow);
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
}

.cost-calculation-section h2 {
    color: var(--text-primary);
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.cost-inputs-panel {
    background: white;
    padding: 28px;
    border-radius: 12px;
    margin-bottom: 28px;
    border-left: 4px solid var(--primary-green);
    border: 1px solid var(--border-color);
}

.cost-inputs-panel h3 {
    color: var(--text-primary);
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.cost-results-panel {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    padding: 28px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-green);
    min-height: 200px;
    border: 1px solid #bbf7d0;
}

.cost-results-content {
    color: var(--text-primary);
}

.cost-breakdown-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.cost-breakdown-section h4 {
    color: var(--primary-green);
    margin: 0 0 16px 0;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    margin-top: 48px;
    background: var(--surface-color);
    border-radius: 16px 16px 0 0;
    border-top: 1px solid var(--border-color);
}

footer p {
    margin: 8px 0;
    font-size: 0.875rem;
}

footer a {
    color: var(--primary-green);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

footer a:hover {
    color: var(--dark-green);
    text-decoration: underline;
}

/* Tooltip Styles */
.tooltip,
#chart-tooltip {
    position: absolute;
    background: rgba(17, 24, 39, 0.95);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 1000;
    box-shadow: var(--shadow-hover);
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .controls-panel {
        position: static;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        font-size: 0.875rem;
    }
    
    thead th,
    tbody td {
        padding: 10px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s infinite;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-green);
}

/* Additional Cassava-inspired styles */
.line-gradient {
    height: 2px;
    background: var(--gradient-green);
    margin: 32px 0;
    border-radius: 1px;
}

/* Info boxes with green theme */
.info-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-green);
    border: 1px solid #bbf7d0;
}

.info-box h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.info-box p {
    margin: 4px 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}