body {
    background-color: #2c2c2c;
    color: #f0f0f0;
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    position: relative; /* Ensure relative positioning for the home button */
}

.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 1200px;
}

.clock {
    font-size: 24px;
    color: white;
}

.content-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    align-items: center;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

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

.calculator-container, .alarm-list-container {
    border: 2px solid #005DAA;
    padding: 10px;
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    text-align: center;
    background-color: black;
    box-shadow: 0 4px 8px gainsboro;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.calculator {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.result {
    border: 1px solid #005DAA;
    margin-bottom: 10px;
    border-radius: 5px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #4c4c4c;
}

.result-text {
    font-size: 32px;
    font-weight: bold;
    color: white;
}

.row {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.btn {
    flex: 1;
    background-color: #0033A0;
    background: linear-gradient(145deg, #0033A0, #0055FF);
    border: 1px solid #0033A0;
    height: 40px;
    font-size: 18px;
    color: white;
    border-radius: 5px;
    transition: background-color 0.1s, transform 0.1s, font-weight 0.1s, color 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.operation-btn {
    background-color: #009FDB;
    background: linear-gradient(145deg, #009FDB, #00CCFF);
    color: darkblue;
    font-size: 28px;
}

.btn-clear, .btn-backspace, .btn-toggle, .equal-btn {
    background-color: #FFD100;
    background: linear-gradient(145deg, #FFD100, #FFC300);
    color: #0033A0;
}

.equal-btn {
    font-size: 40px;
    line-height: 1;
}

.btn:hover {
    background: linear-gradient(145deg, #002080, #0033A0);
    transform: scale(1.05);
}

.btn:active,
.btn.active {
    background: linear-gradient(145deg, #001a66, #002080);
    font-weight: bold;
    color: #FFD100;
}

.operation-btn:hover {
    background: linear-gradient(145deg, #007ACC, #009FDB);
}

.operation-btn:active,
.operation-btn.active {
    background: linear-gradient(145deg, #005FAF, #007ACC);
    font-weight: bold;
    color: #FFD100;
}

.btn-clear:hover, .btn-backspace:hover, .btn-toggle:hover, .equal-btn:hover {
    background: linear-gradient(145deg, #FFC300, #FFD100);
}

.btn-clear:active, .btn-backspace:active, .btn-toggle:active, .equal-btn:active,
.btn-clear.active, .btn-backspace.active, .btn-toggle.active, .equal-btn.active {
    background: linear-gradient(145deg, #FFA500, #FFC300);
    font-weight: bold;
    color: white;
}

.main-btns {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.numbers {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.zero-btn {
    flex: 2;
}

.alarm-inputs {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.alarm-btn, .timer-btn {
    background-color: #FFD100;
    background: linear-gradient(145deg, #FFD100, #FFC300);
    color: #0033A0;
    font-size: 18px;
    border: none;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}

.alarm-btn:hover, .timer-btn:hover {
    color: white;
}

.alarm-inputs input {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #005DAA;
    font-size: 16px;
    text-align: center;
}

.alarm-list {
    margin-top: 10px;
    color: white;
    text-align: center;
    flex-grow: 1;
}

.alarm-list h2 {
    margin-bottom: 10px;
}

.alarm-list ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.alarm-list li {
    background-color: #4c4c4c;
    border: 1px solid #005DAA;
    border-radius: 5px;
    margin: 5px 0;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alarm-list button {
    background: none;
    border: none;
    color: #FFD100;
    cursor: pointer;
    font-size: 16px;
}

/* Media query for smaller screens */
@media (max-width: 768px) {
    .content-container {
        flex-direction: column;
        align-items: center;
    }

    .calculator-container, .alarm-list-container {
        width: 100%;
    }

    .btn {
        height: 35px;
        font-size: 16px;
    }

    .equal-btn {
        font-size: 36px;
    }

    .operation-btn {
        font-size: 24px;
    }

    .result-text {
        font-size: 28px;
    }

    .alarm-btn, .timer-btn {
        font-size: 16px;
        padding: 8px;
    }

    .alarm-inputs input {
        font-size: 14px;
    }

    .alarm-list li {
        font-size: 14px;
    }

    .alarm-list button {
        font-size: 14px;
    }
}

.home-button {
    position: fixed;
    top: 10px;
    left: 10px;
    font-size: 24px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-button ion-icon {
    font-size: 24px;
    color: white;
}
