#energy-converter {
    max-width: 600px;
    margin: 20px auto;
    font-family: Arial, sans-serif;
    background-color: white;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #20483F;
    box-sizing: border-box;
}

#energy-converter h2 {
    text-align: center;
    color: #20483F;
    font-size: 2em;
    margin-bottom: 20px;
}

#energy-converter-form {
    display: flex;
    flex-direction: column;
    padding: 0;
}

#energy-converter label {
    margin-top: 10px;
    font-size: 0.9em;
    color: #20483F;
}

#energy-converter input[type="text"] {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border-radius: 4px;
    border: 1px solid #20483F;
    font-size: 1em;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#energy-converter input[type="text"]:focus {
    border-color: #3a7a6d;
    box-shadow: 0 0 0 2px rgba(32, 72, 63, 0.2);
}

#joule-input {
    font-family: monospace;
    letter-spacing: 1px;
    background-color: white;
}

#joule-input::placeholder {
    color: #999;
    opacity: 1;
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

#energy-converter .action-buttons button {
    width: 48%;
    padding: 10px;
    border-radius: 20px;
    cursor: pointer;
    background-color: white;
    color: #20483F;
    border: 1px solid #20483F;
    font-size: 1em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#energy-converter .action-buttons button.inactive {
    background-color: white !important;
    color: #20483F !important;
    border: 1px solid #20483F !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

#energy-converter .action-buttons button:hover:not(.inactive) {
    background-color: #20483F;
    color: white;
    border: 1px solid #20483F;
}

#energy-converter .action-buttons button.active {
    background-color: #20483F !important;
    color: white !important;
    border: 1px solid #20483F !important;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    border-radius: 25px;
    border: 0.3px solid #ddd;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.result-table th, .result-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 0.3px solid #ddd;
}

.result-table th {
    background-color: #20483F;
    color: white;
    font-weight: bold;
}

.result-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.result-table tr:nth-child(odd) {
    background-color: white;
}

details summary {
    cursor: pointer;
    color: #20483F;
    margin-top: 10px;
    font-size: 1em;
}

details[open] {
    margin-bottom: 10px;
}

.dial-pad-container {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    border-top: 1px solid #20483F;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.2s ease-in-out;
}

.dial-pad-visible {
    transform: translateY(0);
}

.dial-pad-hidden {
    transform: translateY(100%);
}

.dial-pad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    background-color: #20483F;
    color: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    font-size: 0.9em;
    touch-action: manipulation;
}

.dial-pad-toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 5px;
    touch-action: manipulation;
}

.dial-pad-content {
    padding: 10px;
}

.dial-pad-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.dial-pad-btn {
    width: 30%;
    padding: 10px;
    background-color: #F3F3ED;
    border: none;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    font-size: 1em;
    color: #20483F;
    transition: background-color 0.1s ease, transform 0.05s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.dial-pad-btn:active {
    background-color: #20483F;
    color: white;
    transform: scale(0.95);
}

@media (min-width: 768px) {
    .dial-pad-container {
        display: none !important;
    }
}

@media (max-width: 768px) {
    #energy-converter {
        margin: 20px auto;
        padding: 15px;
    }
    #energy-converter input[type="text"] {
        padding: 6px;
        font-size: 14px;
    }
    .action-buttons button {
        padding: 6px;
        font-size: 14px;
    }
    .result-table th,
    .result-table td {
        font-size: 0.85em;
        padding: 8px;
    }
}

html, body {
    overflow-x: hidden;
}