/* Import Poppins Font */
body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f2f2f2;
    transition: background 0.3s, color 0.3s;
}

header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 400px;
    white-space: nowrap; /* Fixes title breaking into two lines */
}

h1 {
    font-size: 20px; /* Reduced size to fit in one line */
    margin: 0;
}

#darkModeToggle {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: #ddd;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#darkModeToggle:hover {
    background-color: #bbb;
}

/* General Ad Box Styling */
.ad-box {
    width: 90%;
    max-width: 400px;
    height: 50px; /* Standard size */
    background-color: #f1f1f1;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.ad-box p {
    margin: 0;
}

/* Ad Box Above Calculator */
.top-ad {
    background-color: #f1f1f1; /* Default background */
}

/* Ad Box Below Calculator */
.bottom-ad {
    background-color: #f1f1f1; /* Default background */
}

/* Calculator styling */
.display {
    width: 100%;
    height: 50px;
    font-size: 24px;
    text-align: left;
    padding: 10px; /* Adjusted padding */
    margin-bottom: 20px;
    border: 2px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
    overflow: hidden; /* Prevents content overflow */
}

/* Calculator Container */
.calculator {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: background 0.3s, color 0.3s;
}

/* Buttons */
.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

button {
    font-size: 20px;
    padding: 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    outline: none;
    user-select: none;
}

button:active {
    transform: scale(0.9);
}

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

.equal {
    background-color: #4CAF50;
    color: white;
}

.clear {
    background-color: #ff6347;
    color: white;
}

/* Dark Mode */
.dark-mode {
    background-color: #222;
    color: white;
}

.dark-mode .calculator {
    background-color: #333;
}

/* Keep "=" and "C" buttons the same in dark mode */
.dark-mode button {
    background-color: #444;
    color: white;
}

.dark-mode button:hover {
    background-color: #555;
}

.dark-mode .display {
color: #ffffff;
}

.dark-mode .equal {
    background-color: #4CAF50; /* Keep green */
}

.dark-mode .clear {
    background-color: #ff6347; /* Keep red */
}

.dark-mode #darkModeToggle {
    background-color: #444;
    color: white;
}

.dark-mode #darkModeToggle:hover {
    background-color: #666;
}

/* Footer margin */
footer {
    margin-top: 20px;
    font-size: 14px;
    color: #777;
    text-align: center;
    width: 100%;
}
