/* Base Styles */
body {
    background-color: rgba(176, 224, 230, 0.1);
    color: #1c1d1c;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

/* Dark Mode */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .calculator {
    background-color: #2d2d2d;
    border-color: #555;
}

body.dark-mode h1 {
    color: #e0e0e0;
}

body.dark-mode input {
    background-color: #3d3d3d;
    color: #e0e0e0;
    border: 1px solid #555;
}

body.dark-mode .tab-button {
    background-color: #3d3d3d;
    color: #e0e0e0;
}

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

/* Blue Light Filter */
body.blue-filter {
    background-color: #fff5e6;
    color: #3d2b1f;
}

body.blue-filter .calculator {
    background-color: #fff9f0;
    border-color: #d4a574;
}

body.blue-filter h1 {
    color: #3d2b1f;
}

body.blue-filter input {
    background-color: #fffbf5;
    color: #3d2b1f;
    border: 1px solid #d4a574;
}

body.blue-filter button {
    background-color: #d4a574;
}

body.blue-filter .tab-button {
    background-color: #f5e6d3;
    color: #3d2b1f;
}

body.blue-filter .tab-button:hover {
    background-color: #e6d4bb;
}

body.blue-filter .tab-button.active {
    background-color: #d4a574;
    color: white;
}

/* Title */
h1 {
    color: #1c1d1c;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    letter-spacing: -1px;
    margin: 0;
}

/* Theme buttons */
.theme-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.theme-toggle button {
    padding: 8px 15px;
    font-size: 13px;
    border-radius: 5px;
    cursor: pointer;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.tab-button {
    background-color: #ddd;
    color: #1c1d1c;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.tab-button.active {
    background-color: #4CAF50;
    color: white;
}

.tab-button:hover {
    background-color: #bbb;
}

.tab-button.active:hover {
    background-color: #45a049;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Calculator */
.calculator {
    background-color: #f0f8ff;
    border: 2px solid #add8e6;
    border-radius: 10px;
    padding: 20px;
    width: 300px;
    margin: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Larger calculators (e.g., calculus mode) */
#calculus {
    width: 420px;
}

/* Inputs */
.input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#display {
    flex: 1;
}

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

button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
}

.clear {
    background-color: #ff6b6b;
    margin: 0;
}

/* ----------------------------------------- */
/* RESPONSIVE DESIGN                         */
/* ----------------------------------------- */

@media (max-width: 600px) {
    .calculator {
        width: 90%;
        padding: 15px;
    }

    #calculus {
        width: 95%;
    }

    .buttons {
        grid-template-columns: repeat(3, 1fr);
    }

    button {
        padding: 12px 0;
        font-size: 16px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .tab-button {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 400px) {
    .buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    button {
        padding: 10px;
        font-size: 15px;
    }

    .theme-toggle {
        flex-direction: column;
        align-items: center;
    }
}
