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

html {
    height: 100%;
    width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    background-attachment: fixed;
}

/* Navigation Styles */
.nav-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Section Management */
.section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.section.active {
    display: block;
}

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

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #ff8c00 0%, #ffa500 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

/* Sector Button Styles */
.sector-btn {
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    background: white;
    color: #374151;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 14px;
}

.sector-btn:hover {
    border-color: #ff8c00;
    color: #ff8c00;
    transform: translateY(-1px);
}

.sector-btn.active {
    background: linear-gradient(135deg, #ff8c00 0%, #ffa500 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 6px rgba(255, 140, 0, 0.3);
}

/* Sample Data Button Styles */
.sample-data-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 14px;
}

.sample-data-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Card Styles */
.bg-white {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Input Styles */
input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea {
    transition: all 0.3s ease;
    font-size: 14px;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #ff8c00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

/* Chart Container Styles */
#dashboardChart {
    width: 100% !important;
    height: 400px !important;
    max-height: 400px !important;
    background: white;
    border-radius: 8px;
}

#simulationChart,
#emulatorChart {
    width: 100% !important;
    height: 320px !important;
    max-height: 320px !important;
    background: white;
    border-radius: 8px;
    padding: 16px;
    overflow: hidden;
}

/* Fixed container heights */
.chart-container {
    height: 400px;
    max-height: 400px;
    overflow: hidden;
}

/* Prevent infinite scrolling */
body {
    overflow-x: hidden;
    max-width: 100vw;
}

.container {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

/* Calculation History with fixed height */
#calculationHistory {
    max-height: 384px !important;
    overflow-y: auto;
}

/* Custom Input Builder Styles */
.variable-input {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    margin-bottom: 8px;
}

.variable-input input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
}

.remove-variable {
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.remove-variable:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Calculation History Styles */
.calculation-item {
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    margin-bottom: 8px;
}

.calculation-item h5 {
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.calculation-item p {
    font-size: 14px;
    color: #6b7280;
}

.calculation-result {
    font-weight: 600;
    color: #059669;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .sector-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff8c00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Tooltip Styles */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #000000;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Success/Error States */
.success {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.05) !important;
}

.error {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.05) !important;
}

/* Dashboard Metrics Animation */
.metric-card {
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
