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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.calculator-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 900px;
}

h1 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 8px;
    text-align: center;
}

a {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    color: #667eea;
}

a:active {
    opacity: 0.6;
}

a:visited {
    color: #555;
}

.subtitle {
    color: #888;
    text-align: center;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

p:last-child {
    margin-bottom: 0;
}

.text-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.shared-input {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid #e0e0e0;
}

.shared-input label {
    display: block;
    color: #555;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1rem;
    text-align: center;
}

.shared-input input {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
    padding: 12px 15px;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 1.1rem;
    text-align: center;
    font-weight: 600;
}

.columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 25px;
}

.column {
    padding: 25px;
    border-radius: 15px;
    background: #f8f9fa;
}

.column.fuel {
    border-left: 4px solid #e74c3c;
}

.column.electric {
    border-left: 4px solid #27ae60;
}

.column-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.column.fuel .column-title {
    color: #e74c3c;
}

.column.electric .column-title {
    color: #27ae60;
}

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    color: #555;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input.error-input {
    border-color: #e74c3c;
}

.error {
    display: none;
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 4px;
    text-align: center;
}

.optional-hint {
    color: #999;
    font-size: 0.8rem;
    text-align: center;
    margin-top: -10px;
    margin-bottom: 15px;
}

button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 25px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.results {
    display: none;
}

.results.show {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    animation: fadeIn 0.5s ease;
}

.results.show.single-result {
    grid-template-columns: 1fr;
}

.results.show.single-result .savings-box {
    display: none;
}

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

.result-box {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.result-box.fuel {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 2px solid #e74c3c;
}

.result-box.electric {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #27ae60;
}

.result-label {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.result-value {
    color: #333;
    font-size: 1.8rem;
    font-weight: 700;
}

.result-box.fuel .result-value {
    color: #c0392b;
}

.result-box.electric .result-value {
    color: #27ae60;
}

.details {
    margin-top: 15px;
    text-align: left;
    font-size: 0.85rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.detail-row:last-child {
    border-bottom: none;
    font-weight: 600;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 2px solid rgba(0,0,0,0.2);
}

.savings-box {
    grid-column: span 2;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    margin-top: 10px;
}

.savings-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.savings-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.savings-percent {
    font-size: 1.2rem;
    margin-top: 5px;
    opacity: 0.9;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .columns, .results.show {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .savings-box {
        grid-column: span 1;
    }

    .calculator-card {
        padding: 20px;
        border-radius: 15px;
    }

    h1 {
        font-size: 1.4rem;
    }

    .column {
        padding: 15px;
    }

    .shared-input {
        padding: 15px;
    }

    button {
        padding: 12px;
    }

    .result-value {
        font-size: 1.5rem;
    }

    .savings-value {
        font-size: 2rem;
    }
}

@media (max-width: 400px) {
    body {
        padding: 5px;
    }

    .calculator-card {
        padding: 15px;
    }

    h1 {
        font-size: 1.2rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .column-title {
        font-size: 1rem;
    }

    .input-group label {
        font-size: 0.8rem;
    }

    input[type="number"] {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}