/* Base Styles */
:root {
    --primary-color: #1565c0;
    --primary-hover: #0d47a1;
    --secondary-color: #e0e0e0;
    --secondary-hover: #bdbdbd;
    --text-color: #333;
    --light-gray: #f5f7fa;
    --border-color: #ddd;
    --success-color: #388e3c;
    --error-color: #d32f2f;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --radius: 4px;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-gray);
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
header {
    background-color: #fff;
    box-shadow: var(--shadow);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--text-color);
}

.logo svg {
    margin-right: 0.5rem;
}

nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
}

nav a {
    padding: 0.5rem 0;
    position: relative;
}

nav a.active {
    color: var(--primary-color);
}

nav a.active:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* Main Content */
main {
    padding: 2rem 0;
}

.intro-text {
    max-width: 800px;
    margin: 0 auto 2rem;
    text-align: center;
}

/* Calculator Layout */
.calculator-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

@media (min-width: 768px) {
    .calculator-container {
        grid-template-columns: 1fr 1fr;
    }
}

.calculator-form, .calculator-info {
    background-color: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

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

.input-with-unit {
    display: flex;
    align-items: center;
}

input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.unit {
    margin-left: 0.5rem;
    color: #666;
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    min-height: 1.25rem;
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    flex: 1;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

/* Results */
.result-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f0f7ff;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
}

.result-container.hidden {
    display: none;
}

.result-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* How It Works */
ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.formula {
    background-color: #edf7ff;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.formula span {
    font-weight: 600;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

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

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr 2fr;
    }
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo svg {
    margin-bottom: 1rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
}

.footer-column h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #fff;
}

.footer-column ul {
    list-style: none;
    margin: 0;
}

.footer-column li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: #b0bec5;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: #fff;
}

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #b0bec5;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Responsive adjustments */
@media (max-width: 767px) {
    h1 {
        font-size: 1.75rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    nav ul {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    header .logo {
        font-size: 1rem;
    }
    
    nav ul {
        gap: 0.5rem;
        font-size: 0.9rem;
    }
}