@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&display=swap');
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Lora", serif;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    flex-direction: column;
}

/* Navbar Styles */
.navbar {
    color: black;
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* .navbar:hover {
    background-color: #143774;
    color: white;
} */

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: black;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: white;
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: white;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Main Content Styles */
main {
    flex: 1;
    max-width: 1200px;
    width: 90%;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.content-section {
    display: flex;
    gap: 2rem;
    min-height: 80vh;
    align-items: center;
}

.text-content {
    flex: 1;
    padding: 2rem;
    color: black;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 1s ease-in-out;
}

.text-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.text-content h1 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.text-content p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.calculator-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: slideIn 1s ease-in-out;
}

/* Calculator Styles */
.calculator {
    background-color: #333;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 350px;
    height: 100%;
    max-height: 600px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.calculator:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.display {
    background-color: #222;
    color: white;
    text-align: right;
    padding: 20px;
    font-size: 28px;
    position: relative;
    height: 100px;
    overflow: hidden;
    flex: 0 0 auto;
}

.display .previous-operand {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    position: absolute;
    top: 5px;
    right: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.display .current-operand {
    position: absolute;
    bottom: 15px;
    right: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 1px;
    background-color: #444;
    flex: 1;
}

button {
    border: none;
    outline: none;
    background-color: #555;
    color: white;
    padding: 12px 16px;
    font-size: 24px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

button:hover {
    background-color: #666;
}

button:active {
    background-color: #777;
    transform: scale(0.95);
}

.operation {
    background-color: #ff9500;
}

.operation:hover {
    background-color: #ffaa33;
}

.operation:active {
    background-color: #ffbb66;
}

.special {
    background-color: #a5a5a5;
    color: #000;
}

.special:hover {
    background-color: #b5b5b5;
}

.special:active {
    background-color: #c5c5c5;
}

.zero {
    grid-column: span 2;
}

.error {
    color: #ff5555;
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: black;
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* footer:hover {
    background-color: #143774;
    color: white;
} */

footer p {
    max-width: 1200px;
    margin: 0 auto;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .content-section {
        flex-direction: column;
        min-height: auto;
    }
    
    .calculator-wrapper {
        margin: 2rem 0;
    }
}

@media (max-width: 400px) {
    .calculator {
        width: 100%;
        max-height: none;
        border-radius: 10px; 
    }
}

@media (max-height: 600px) {
    .display {
        height: 80px;
    }
    
    button {
        font-size: 20px;
    }
}