/* 
==============================================
CALCULATOR STYLES - CREATIVE & ROBUST REBUILD
==============================================
*/

.calculator-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.tab-link {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--subtle-text-color);
    position: relative;
    transition: color 0.3s;
}

.tab-link.active {
    color: var(--primary-color);
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- GENERAL CALCULATOR REBUILD --- */

.calculator-grid {
    display: grid;
    justify-content: center;
    align-content: center;
    grid-template-columns: repeat(4, 1fr); /* Responsive columns */
    grid-template-rows: minmax(120px, auto) repeat(5, 60px); /* Adjusted row height */
    gap: 8px; 
    background-color: #F8C8DC; /* Pink calculator body */
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 320px; /* Adjusted max-width for mobile fit */
    margin: 0 auto; 
}

.calculator-grid .output {
    grid-column: 1 / -1;
    background: #333; /* Dark screen background */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-around;
    padding: 20px;
    word-wrap: break-word;
    word-break: break-all;
    border-radius: 8px;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.7);
    border: 2px solid #222;
}

.previous-operand {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
}

.current-operand {
    color: white;
    font-size: 2.5rem;
}

.calculator-grid > button {
    cursor: pointer;
    font-size: 1.5rem; 
    border: none; 
    outline: none;
    background-color: #000; /* Black keys */
    color: white; /* White numbers/elements */
    border-radius: 8px; /* Rounded corners for buttons */
    transition: all 0.1s ease-in-out;
    font-family: 'Poppins', sans-serif;
    min-height: 60px; /* Ensure buttons are tall enough */
}

.calculator-grid > button:hover {
    background-color: #333; /* Darker black on hover */
}

.calculator-grid > button:active {
    transform: scale(0.95);
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

/* Span specific buttons */
.span-two {
    grid-column: span 2;
}

/* Style operator buttons differently */
[data-operation], [data-equals] {
    background-color: #FF69B4; /* Hot pink for operators/equals */
    color: white;
}

[data-operation]:hover, [data-equals]:hover {
    background-color: #FF3399; /* Darker hot pink on hover */
}

/* Style AC and DEL buttons */
[data-all-clear], [data-delete] {
    background-color: #666; /* Dark grey for AC/DEL */
    color: white;
}

[data-all-clear]:hover, [data-delete]:hover {
    background-color: #888; /* Lighter grey on hover */
}


/* --- Other Calculator Styles --- */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--surface-color);
    border-radius: 8px;
    box-shadow: 0 4px 25px var(--shadow-color);
}

.form-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-container input {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.form-container button {
    width: 100%;
    padding: 14px;
}

.result {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.result p {
    margin: 10px 0;
    font-size: 1.1rem;
}
