* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    min-height: 100vh;
}

nav {
    background: linear-gradient(135deg, #66c18e 0%, #45825d 100%);
    padding: 30px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto; 
    display: flex;
    align-items: center;
    justify-content: center; /* Keep centered for the title */
    gap: 50px;
    position: relative; /* Added for absolute positioning of logo */
}

.nav-content h1 {
    color: white;
    font-size: 30px;
    font-weight: 700;
    text-align: center;
}

.nav-home {
    color: #66c18e;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-home:hover {
    color: #7dd4a3;
}

.logo {
    position: absolute; /* Position logo absolutely */
    left: 0; /* Place it on the left */
    width: 90px;
    height: 90px;
}


/* Home Page Styles */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    text-align: center;
}

.home-title {
    color: white;
    font-size: 42px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.home-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 18px;
    margin-bottom: 50px;
}

/* Button Container for Home Page */
.button-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1700px;
    margin: 0 auto;
    padding: 300px;
}

/* Home Page Buttons */
.nav-button {
    background: white;
    color: #1a231c;
    border: none;
    padding: 20px 15px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.nav-button:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    background-color: #f8f9fa;
}

.button-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.nav-button h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #1a231c;
}

.nav-button p {
    font-size: 14px;
    color: #45825d;
    line-height: 1.5;
}

/* Home Footer */
.home-footer {
    text-align: center;
    padding: 30px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

/* Page 2 Layout - Slimmer Sidebar */
.page2-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
}

.main-content {
    flex: 1;
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
    background-color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: visible; /* Added - allows tooltips to extend beyond sidebar */
    position: relative; /* Added for tooltip positioning context */
}


/* Graph Container */
.graph-container {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#graphCanvas {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background-color: white;
    cursor: crosshair;
    max-width: 100%;
    height: auto;
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    background-color: #66c18e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.control-btn:hover {
    background-color: #45825d;
}

/* Reset button in sidebar */
.reset-btn {
    width: 100%;
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.reset-btn:hover {
    background-color: #c0392b;
}

/* Sidebar Styles */
.sidebar h2 {
    color: #1a231c;
    margin-bottom: 15px;
    font-size: 20px;
    border-bottom: 2px solid #66c18e;
    padding-bottom: 8px;
}

.sidebar h3 {
    color: #1a231c;
    margin-top: 15px;
    margin-bottom: 8px;
    font-size: 16px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: #1a231c;
    font-weight: 500;
    font-size: 14px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.3s;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #66c18e;
}

.sidebar button {
    width: 100%;
    background-color: #45825d;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
    transition: background-color 0.3s;
}

/* Reset button in sidebar - make this more specific */
.sidebar .reset-btn,
#resetBtn {
    width: 100%;
    background-color: #e74c3c !important; /* Added !important to ensure it takes precedence */
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.sidebar .reset-btn:hover,
#resetBtn:hover {
    background-color: #c0392b !important;
}

.sidebar button:hover {
    background-color: #356647;
}

/* Calculation buttons in grid */
.calc-btn {
    padding: 10px;
    font-size: 13px;
}

.result-box {
    background-color: #e8f5ee;
    border-left: 4px solid #45825d;
    padding: 12px;
    margin-top: 15px;
    border-radius: 6px;
}

.result-box h4 {
    color: #45825d;
    margin-bottom: 8px;
    font-size: 15px;
}

.result-box p {
    color: #1a231c;
    line-height: 1.6;
    margin: 4px 0;
    font-size: 13px;
}

.info-box {
    background-color: #e8f5ee;
    border-left: 4px solid #66c18e;
    padding: 12px;
    margin-top: 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #45825d;
}

.point-list {
    list-style: none;
    padding: 0;
}

.point-list li {
    background-color: #f5f5f5;
    padding: 6px 10px;
    margin: 4px 0;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.point-list button {
    background-color: #1a231c;
    padding: 4px 8px;
    font-size: 11px;
    width: auto;
    margin: 0;
}

.point-list button:hover {
    background-color: #2d3a30;
}

/* Input tooltip styling - improved positioning */
.input-tooltip {
    position: relative;
    display: inline-block;
}

.input-tooltip .tooltiptext {
    visibility: hidden;
    width: 240px; /* Increased from 220px */
    background-color: white;
    color: #1a231c;
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: fixed; /* Changed from absolute to fixed */
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 2px solid #66c18e;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none; /* Prevents tooltip from interfering with mouse */
}

.input-tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 20px;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #66c18e transparent;
}

.input-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.tooltiptext strong {
    color: #45825d;
    display: block;
    margin-bottom: 4px;
}

/* Loading Screen Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #66c18e 0%, #45825d 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.progress-bar-container {
    width: 300px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: white;
    border-radius: 10px;
    width: 0%;
    animation: loading 2s ease-in-out forwards;
}

@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page2-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: none;
    }
    
    #graphCanvas {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 768px) {
    .home-title {
        font-size: 32px;
    }
    
    .button-container {
        grid-template-columns: 1fr;
    }
    
    .nav-content h1 {
        font-size: 18px;
    }

    
}