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

:root {
    --keen-teal: #1bbf9e;
    --keen-teal-hover: #17a689;
    --light-gray: #f5f5f5;
    --dark-text: #333333;
    --card-shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-gray);
    color: var(--dark-text);
    line-height: 1.6;
}

.view {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    min-height: 100vh;
}

.view.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    position: relative;
}

header {
    background-color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 2px 8px var(--card-shadow);
}

#homepage header {
    margin-bottom: 2rem;
}

#glossary-view header {
    margin-bottom: 0;
}

.logo {
    max-width: 250px;
    height: auto;
    margin-bottom: 1rem;
}

h1 {
    color: var(--dark-text);
    font-size: 1.8rem;
    font-weight: 600;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px var(--card-shadow);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 160px;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--keen-teal);
    transition: height 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(27, 191, 158, 0.25);
}

.card:hover::before {
    height: 6px;
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.card h2 {
    color: var(--keen-teal);
    font-size: 1rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
    line-height: 1.2;
}

.card p {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    flex-grow: 1;
}

.card-arrow {
    color: var(--keen-teal);
    font-size: 1.25rem;
    text-align: right;
    font-weight: bold;
    transition: transform 0.3s ease;
    margin-top: auto;
    line-height: 1;
}

.card:hover .card-arrow {
    transform: translateX(6px);
}

.card.coming-soon {
    opacity: 0.7;
    cursor: default;
}

.card.coming-soon:hover {
    transform: none;
    box-shadow: 0 2px 8px var(--card-shadow);
}

.card.coming-soon .card-arrow {
    opacity: 0.5;
}

.coming-soon-badge {
    display: inline-block;
    background: #ffa500;
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.back-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem 1rem;
}

#glossary-view {
    padding-top: 0;
}

.back-button {
    background: var(--keen-teal);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.back-button:hover {
    background: var(--keen-teal-hover);
    transform: translateX(-4px);
}

.glossary-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.glossary-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--card-shadow);
    transition: all 0.3s ease;
}

.glossary-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(27, 191, 158, 0.2);
}

.glossary-item h3 {
    color: var(--keen-teal);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.glossary-item .category {
    display: inline-block;
    background: var(--light-gray);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    color: var(--dark-text);
}

.glossary-item p {
    color: #666;
    line-height: 1.6;
}

.glossary-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 1rem;
}

.glossary-item.clickable {
    cursor: pointer;
    border: 2px solid transparent;
}

.glossary-item.clickable:hover {
    border-color: var(--keen-teal);
    transform: translateY(-6px);
}

.glossary-item .model-info,
.glossary-item .size-info,
.glossary-item .btu-info {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.glossary-item .learn-more {
    color: var(--keen-teal);
    font-weight: 600;
    margin-top: 1rem;
    font-size: 0.95rem;
}

@media (max-width: 992px) {
    .card-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 0.875rem;
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .card-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 1rem 0.875rem;
        min-height: 140px;
    }

    .card h2 {
        font-size: 0.95rem;
    }
    
    .card p {
        font-size: 0.8rem;
    }

    .logo {
        max-width: 200px;
    }

    .glossary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1.5rem 1rem;
    }

    .card-container {
        padding: 0.75rem;
    }

    .glossary-content {
        padding: 1rem;
    }
}

/* Tool View Styles */
.tool-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.tool-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px var(--card-shadow);
}

.tool-description {
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.05rem;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 600px) {
    .input-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.input-group input,
.input-group select {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--keen-teal);
}

.calc-button {
    width: 100%;
    background: var(--keen-teal);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.calc-button:hover {
    background: var(--keen-teal-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 191, 158, 0.3);
}

.results-section {
    background: var(--light-gray);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.results-section h3 {
    color: var(--keen-teal);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    text-align: center;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #ddd;
}

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

.result-item span {
    color: #666;
    font-size: 0.95rem;
}

.result-item strong {
    color: var(--dark-text);
    font-size: 1.1rem;
}

.pdf-button {
    width: 100%;
    background: #4A90E2;
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pdf-button:hover {
    background: #357ABD;
    transform: translateY(-2px);
}

.tip-box {
    background: #FFF3CD;
    border-left: 4px solid #FFC107;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 4px;
    color: #856404;
    font-size: 0.9rem;
    line-height: 1.5;
}

.gauge-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.gauge-bar {
    width: 100%;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.gauge-fill {
    height: 100%;
    transition: width 0.5s ease, background-color 0.3s ease;
    border-radius: 12px;
}

@media (max-width: 600px) {
    .tool-content {
        padding: 1rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }
}

.gauge {
    background: white;
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    display: inline-block;
    min-width: 150px;
}

.gauge:hover {
    border-color: var(--keen-teal);
    box-shadow: 0 4px 12px rgba(27, 191, 158, 0.15);
}

.gauge-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gauge-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--keen-teal);
    margin: 0.5rem 0;
}

.gauge-status {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.result-item.highlight {
    background: #f0f9ff;
    border-left: 4px solid var(--keen-teal);
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
}

@media print {
    header {
        padding: 1rem 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .logo {
        max-width: 180px;
        margin-bottom: 0.5rem;
    }
    
    h1 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }
    
    .back-nav {
        display: none;
    }
    
    .tool-content {
        padding: 0.8rem;
    }
    
    .tool-card {
        padding: 1.2rem;
        margin-bottom: 0;
    }
    
    .tool-description {
        font-size: 0.85rem;
        margin-bottom: 0.8rem;
        line-height: 1.3;
    }
    
    .input-grid {
        gap: 0.6rem;
        margin-bottom: 0.8rem;
    }
    
    .input-group {
        margin-bottom: 0.4rem;
    }
    
    .input-group label {
        font-size: 0.85rem;
        margin-bottom: 0.2rem;
    }
    
    .input-group input,
    .input-group select {
        padding: 0.4rem;
        font-size: 0.9rem;
    }
    
    .input-group small {
        font-size: 0.7rem;
        margin-top: 0.2rem;
    }
    
    .calc-button {
        display: none;
    }
    
    .pdf-button {
        display: none;
    }
    
    .results-section {
        margin-top: 0.8rem;
        padding: 0.8rem;
    }
    
    .results-section h3 {
        font-size: 1.1rem;
        margin-bottom: 0.6rem;
    }
    
    .result-item {
        padding: 0.4rem 0;
        margin: 0.3rem 0;
        font-size: 0.9rem;
    }
    
    .result-item.highlight {
        padding: 0.5rem 0.8rem;
        margin: 0.3rem 0;
    }
    
    .tip-box {
        padding: 0.6rem;
        margin-top: 0.6rem;
        font-size: 0.8rem;
        line-height: 1.4;
    }
    
    .gauge {
        padding: 0.8rem;
        margin: 0.4rem;
        min-width: 120px;
    }
    
    .gauge-label {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }
    
    .gauge-value {
        font-size: 1.5rem;
        margin: 0.3rem 0;
    }
    
    .gauge-status {
        font-size: 0.85rem;
        margin-top: 0.3rem;
    }
    
    table {
        font-size: 0.85rem;
        margin: 0.8rem 0;
    }
    
    table th,
    table td {
        padding: 0.5rem !important;
    }
    
    ul {
        margin: 0.4rem 0;
        padding-left: 1.2rem;
    }
    
    ul li {
        margin: 0.2rem 0;
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    body {
        line-height: 1.4;
    }
}
