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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f4f4f4;
}

header {
    background: #A3B3A1;
    padding: 1rem 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.header-logo {
    height: 100px;
    width: auto;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.calculators h2 {
    margin-bottom: 2rem;
    text-align: center;
}

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

.calc-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.calc-card h3 {
    margin-bottom: 1rem;
    color: #A3B3A1;
}

.calc-card button {
    background: #A3B3A1;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.calc-card button:hover {
    background: #8FA68E;
}

.calc-form {
    text-align: left;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input,
.input-group select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.input-group input {
    margin-right: 0.5rem;
    width: calc(70% - 0.5rem);
}

.input-group select {
    width: 30%;
}

/* Remove arrows from molecular weight inputs */
#fw1, #fw2, #fw3 {
    -moz-appearance: textfield;
}

#fw1::-webkit-outer-spin-button,
#fw1::-webkit-inner-spin-button,
#fw2::-webkit-outer-spin-button,
#fw2::-webkit-inner-spin-button,
#fw3::-webkit-outer-spin-button,
#fw3::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.calc-card button {
    width: 100%;
    margin-top: 1rem;
}

.result {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    min-height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 2rem;
}

.tab-button {
    padding: 1rem 2rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s ease;
}

.tab-button:hover {
    color: #A3B3A1;
    background: #f8fafc;
}

.tab-button.active {
    color: #A3B3A1;
    border-bottom-color: #A3B3A1;
    background: #f8fafc;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Search Section */
.search-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.search-box {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.search-box:focus {
    outline: none;
    border-color: #A3B3A1;
    box-shadow: 0 0 0 3px rgba(163, 179, 161, 0.1);
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background: #f8fafc;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-name {
    font-weight: bold;
    color: #333;
}

.suggestion-details {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.search-results {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.result-item {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.result-item:hover {
    background: #f8fafc;
}

.result-item:last-child {
    border-bottom: none;
}

.result-name {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

.result-details {
    color: #666;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.result-mw {
    color: #A3B3A1;
    font-weight: bold;
    margin-top: 0.25rem;
}

/* Search button hover effects */
#searchButton:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(163, 179, 161, 0.3);
    background: linear-gradient(135deg, #8FA68E 0%, #7A8A78 100%);
}

#searchButton:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(163, 179, 161, 0.2);
}

/* Sticky banner for selected molecule */
.sticky-banner {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #e5e7eb; /* light gray */
    border-bottom: 1px solid #d1d5db;
}

.sticky-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #374151;
}

#selectedMoleculeName {
    font-weight: 600;
}

.clear-selection-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.clear-selection-btn:hover {
    background: #d1d5db;
    color: #111827;
}