@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap');

/* --- General Body Styling --- */
body 
{
    font-family: 'Roboto', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

/* --- Main Calculator Container --- */
.calculator_container 
{
    background-color: #0A1A2F;
    padding: 20px;
    border-radius: 15px;    
    width: 340px;
    max-width: 95%;
    text-align: center;
    height: 90vh;
}

/* --- Display Area --- */
.display_container 
{
    position: relative;
    margin-bottom: 20px;
}

.display_box 
{
    background-color: #ecf0f1;
    color: #2c3e50;
    font-size: 2.8em;
    padding: 20px;
    border-radius: 10px;
    text-align: right;
    word-wrap: break-word;
    min-height: 60px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* --- Button Grid --- */
.buttons_grid 
{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* --- General Button Styling --- */
.btn 
{
    background-color: #152642;
    color: #ecf0f1;
    border: none;
    padding: 20px;
    border-radius: 10px;
    font-size: 1.5em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn:hover 
{
    background-color: rgb(14, 31, 56);
}

.btn:active 
{
    transform: scale(0.97);
}

/* --- Specific Button Types --- */
.zero-btn 
{
    grid-column: span 2;
}

.operator 
{
    background-color: #f39c12;
    color: white;
}

.operator:hover 
{
    background-color: #e67e22;
}

.clear 
{
    background-color: #c0392b;
    color: white;
}

.clear:hover 
{
    background-color: #a13125;
}

.equals 
{
    background-color: #27ae60;
    grid-column: span 4;
    color: white;
}

.equals:hover 
{
    background-color: #1d8046;
}

/* --- Loader and Error Styling --- */
.loader 
{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 5px solid #bdc3c7;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin 
{
    0% 
    { 
        transform: translate(-50%, -50%) rotate(0deg); 
    }
    100% 
    { 
        transform: translate(-50%, -50%) rotate(360deg); 
    }
}

#error-message 
{
    color: #e74c3c;
    min-height: 20px;
    font-weight: 500;
    margin-top: 15px;
}