/* ===========================================
   Scientific Calculator - Tool Specific Styles
   =========================================== */

/* Tool Layout */
.scicalc-box {
    max-width: 500px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 20px;
}

/* Display Area */
.scicalc-display-area {
    margin-bottom: 20px;
    background: #f9fafb; /* Very Light Gray */
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #e5e7eb;
}

.scicalc-history {
    font-size: 0.9rem;
    color: #6b7280;
    min-height: 18px;
    text-align: right;
    overflow: hidden;
    white-space: nowrap;
}

.scicalc-input {
    width: 100%;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    text-align: right;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    /* Disable default focus outline */
    outline: none; 
}

/* Keypad Grid */
.scicalc-keypad {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 columns for scientific functions + standard buttons */
    gap: 10px;
}

/* Buttons */
.scicalc-btn {
    padding: 15px 5px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1f2937;
}

.scicalc-btn:active {
    transform: scale(0.98);
}

/* Function Buttons (Trig, Log, etc.) - Purple */
.btn-function {
    background: #ede9fe; 
    color: #6d28d9;
}
.btn-function:hover {
    background: #ddd6fe;
}

/* Operation Buttons (+, -, x, /, y^x) - Orange */
.btn-operation {
    background: #ffedd5;
    color: #ea580c;
}
.btn-operation:hover {
    background: #fed7aa;
}

/* Control Buttons (AC, C, =) - Blue/Black */
.btn-control {
    background: #e0f2fe; 
    color: #0ea5e9;
}
.btn-control:hover {
    background: #bae6fd;
}

/* Equals Button (=) - Darker Blue/Full Width */
.btn-equals {
    background: #0ea5e9; 
    color: white;
    grid-column: span 2; /* Span two columns */
    font-size: 1.5rem;
}
.btn-equals:hover {
    background: #0369a1;
}

/* Number/Decimal Buttons - Standard Grey */
.btn-number {
    background: #f3f4f6;
    color: #1f2937;
}
.btn-number:hover {
    background: #e5e7eb;
}

/* Zero button spanning two standard columns (4 columns total) */
.btn-zero {
    grid-column: span 2;
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .scicalc-keypad {
        grid-template-columns: repeat(4, 1fr); /* Reduce to 4 columns on small screens */
    }
    .btn-equals {
        grid-column: span 2;
    }
    .btn-zero {
        grid-column: span 2;
    }
    /* Hide some scientific buttons on small screens if necessary, though 5 columns should fit */
    /* Alternatively, adjust font size */
    .scicalc-input {
        font-size: 2rem;
    }
    .scicalc-btn {
        font-size: 1rem;
        padding: 10px 5px;
        height: 50px;
    }
}