/* ==========================================
   1. Reset & Global Styles
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f6f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* ==========================================
   2. Calculator Layout Container
   ========================================== */
.calculator-container {
    background-color: #2b2f36;
    width: 100%;
    max-width: 380px; /* Responsive restraint for desktops */
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.25);
    margin-bottom: 30px;
}

/* ==========================================
   3. Display Screen
   ========================================== */
.calculator-screen {
    width: 100%;
    height: 80px;
    border: none;
    background-color: #1a1f27;
    color: #ffffff;
    font-size: 2.5rem;
    text-align: right;
    padding: 0 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* ==========================================
   4. Buttons Grid & Styling
   ========================================== */
.calculator-keys {
    display: grid;
    /* Creates 4 equal columns */
    grid-template-columns: repeat(4, 1fr); 
    gap: 12px;
}

button {
    height: 60px;
    background-color: #dfe3ea;
    border: none;
    border-radius: 12px;
    color: #222831;
    text-shadow: none;
    font-size: 1.4rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

/* Hover and Active State Effects */
button:hover {
    background-color: #4a5162;
}

button:active {
    transform: scale(0.95); /* Subtle press-down animation */
}

/* Specific styling for Operator buttons (+, -, *, /) */
.operator {
    background-color: #ff9f0a;
}
.operator:hover {
    background-color: #cc7f08;
}

/* Specific styling for Utility functions (C, DEL) */
.fn-btn {
    background-color: #a5a5a5;
    color: #000000;
}
.fn-btn:hover {
    background-color: #8e8e8e;
}

/* Specific styling for the Equals button */
.equal-sign {
    background-color: #30d158;
    grid-column: span 1;
    grid-row: span 2; /* Makes the button span vertically over two spaces */
    height: 132px;    /* Matches the height of two rows + gap */
}
.equal-sign:hover {
    background-color: #24a142;
}

/* Making 0 stretch over 2 columns to align nicely */
.zero-btn {
    grid-column: span 2;
}

/* ==========================================
   5. Educational Info Section Below
   ========================================== */
.learning-section {
    max-width: 500px;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.learning-section h2 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
}
.learning-section ul {
    list-style-type: none;
}
.learning-section li {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.4;
}