<div style="max-width: 600px; margin: 0 auto; background: white; padding: 30px; border-radius: 10px; box-shadow: 0 0 20px rgba(0,0,0,0.1);">
<div style="background: linear-gradient(135deg, #8FABD4 0%, #4A70A9 100%); padding: 25px; border-radius: 8px; margin-bottom: 30px;">
<p style="color: white; font-size: 26px; margin: 0; text-align: center; font-weight: 600;">Seconds Calculator</p>
</div>
<div style="margin-bottom: 20px;">
<label style="display: block; margin-bottom: 8px; color: #333; font-weight: 500;">Days</label>
<input type="number" id="secDays" min="0" value="0" style="width: 100%; padding: 12px; border: 2px solid #8FABD4; border-radius: 5px; font-size: 16px; box-sizing: border-box;" placeholder="Enter days">
</div>
<div style="margin-bottom: 20px;">
<label style="display: block; margin-bottom: 8px; color: #333; font-weight: 500;">Hours</label>
<input type="number" id="secHours" min="0" value="0" style="width: 100%; padding: 12px; border: 2px solid #8FABD4; border-radius: 5px; font-size: 16px; box-sizing: border-box;" placeholder="Enter hours">
</div>
<div style="margin-bottom: 20px;">
<label style="display: block; margin-bottom: 8px; color: #333; font-weight: 500;">Minutes</label>
<input type="number" id="secMinutes" min="0" value="0" style="width: 100%; padding: 12px; border: 2px solid #8FABD4; border-radius: 5px; font-size: 16px; box-sizing: border-box;" placeholder="Enter minutes">
</div>
<div style="margin-bottom: 25px;">
<label style="display: block; margin-bottom: 8px; color: #333; font-weight: 500;">Seconds</label>
<input type="number" id="secSeconds" min="0" value="0" style="width: 100%; padding: 12px; border: 2px solid #8FABD4; border-radius: 5px; font-size: 16px; box-sizing: border-box;" placeholder="Enter seconds">
</div>
<div style="text-align: center; margin-bottom: 25px;">
<button onclick="calculateSeconds()" style="background: #4A70A9; color: white; border: none; padding: 14px 40px; border-radius: 5px; font-size: 16px; cursor: pointer; margin-right: 10px; font-weight: 600;">Calculate</button>
<button onclick="location.reload()" style="background: #8FABD4; color: white; border: none; padding: 14px 40px; border-radius: 5px; font-size: 16px; cursor: pointer; font-weight: 600;">Reset</button>
</div>
<div id="secResult" style="display: none; background: #f8f9fa; padding: 25px; border-radius: 8px; border-left: 5px solid #4A70A9;">
<div style="margin-bottom: 15px;">
<span style="color: #333; font-weight: 600;">Total Seconds:</span>
<span id="totalSec" style="color: #4A70A9; font-size: 32px; font-weight: 700; margin-left: 10px;"></span>
</div>
<div style="margin-bottom: 10px;">
<span style="color: #333; font-weight: 500;">Total Minutes:</span>
<span id="totalMin" style="color: #333; margin-left: 10px;"></span>
</div>
<div style="margin-bottom: 10px;">
<span style="color: #333; font-weight: 500;">Total Hours:</span>
<span id="totalHrs" style="color: #333; margin-left: 10px;"></span>
</div>
<div>
<span style="color: #333; font-weight: 500;">Total Days:</span>
<span id="totalDys" style="color: #333; margin-left: 10px;"></span>
</div>
</div>
</div>
<script>
function calculateSeconds() {
const days = parseInt(document.getElementById('secDays').value) || 0;
const hours = parseInt(document.getElementById('secHours').value) || 0;
const minutes = parseInt(document.getElementById('secMinutes').value) || 0;
const seconds = parseInt(document.getElementById('secSeconds').value) || 0;
const totalSeconds = (days * 86400) + (hours * 3600) + (minutes * 60) + seconds;
const totalMinutes = totalSeconds / 60;
const totalHours = totalSeconds / 3600;
const totalDays = totalSeconds / 86400;
document.getElementById('totalSec').textContent = totalSeconds.toLocaleString();
document.getElementById('totalMin').textContent = totalMinutes.toFixed(2);
document.getElementById('totalHrs').textContent = totalHours.toFixed(2);
document.getElementById('totalDys').textContent = totalDays.toFixed(2);
document.getElementById('secResult').style.display = 'block';
}
</script>