* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 800px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(to right, #2c3e50, #4a6491);
    color: white;
    padding: 25px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 30px;
}

.calculator-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group input {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: #4a6491;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 100, 145, 0.2);
}

#calculate-btn {
    background: linear-gradient(to right, #2c3e50, #4a6491);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

#calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.1);
}

.result-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-card {
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.result-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.result {
    font-size: 3rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 10px 0;
}

.unit {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.tips {
    background: #e8f4f8;
    padding: 20px;
    border-radius: 15px;
    border-left: 5px solid #3498db;
}

.tips h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tips ul {
    list-style-type: none;
    padding-left: 0;
}

.tips li {
    padding: 8px 0;
    border-bottom: 1px dashed #bdc3c7;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tips li:before {
    content: "•";
    color: #3498db;
    font-weight: bold;
}

.history-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-top: 20px;
}

.history-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    background: white;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #4a6491;
}

.history-distance, .history-fuel, .history-mileage {
    font-weight: 500;
}

.history-mileage {
    color: #2c3e50;
    font-weight: 600;
}

.clear-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.clear-btn:hover {
    background: #c0392b;
}

footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

footer i {
    color: #e74c3c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-card {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .result {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: 20px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .result {
        font-size: 2rem;
    }
}