/* ================== BASE ================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #f4f6f8;
    color: #1e293b;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

/* ================== HEADING ================== */
h1, h2, h3 {
    font-weight: 600;
    margin-bottom: 15px;
}

h1 {
    text-align: center;
    color: #0b3fc3;
    margin-bottom: 30px;
}

.content-section {
    margin-top: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* ================== CALCULATOR WRAPPER ================== */
.calculator-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-bottom: 50px;
}

/* ================== CALCULATOR ================== */
.calculator {
    background: #0f172a;
    color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    width: 350px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.calculator .mode-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 500;
}

#modeBtn {
    background: #0b3fc3;
    color: #fff;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

#modeBtn:hover {
    background: #0a37a0;
}

.display {
    width: 100%;
    height: 50px;
    background: #1e293b;
    border: none;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 20px;
    color: #fff;
    padding: 10px;
    text-align: right;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

button {
    padding: 15px;
    font-size: 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: #1e293b;
    color: #fff;
    font-weight: 600;
    transition: all 0.2s ease;
}

button:hover {
    background: #0b3fc3;
}

button.operator {
    background: #0b3fc3;
}

button.operator:hover {
    background: #0942a5;
}

button.clear {
    background: #dc2626;
}

button.clear:hover {
    background: #b91c1c;
}

button.equal {
    background: #16a34a;
    grid-column: span 2;
}

button.equal:hover {
    background: #15803d;
}

/* ================== HISTORY ================== */
.history {
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    width: 300px;
    max-height: 450px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.history h2 {
    margin-bottom: 10px;
    color: #0b3fc3;
}

.history-item {
    background: #f1f5f9;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #e2e8f0;
}

/* ================== FAQ & CONTENT ================== */
.content-section p, .content-section li {
    font-size: 16px;
    margin-bottom: 12px;
}

.content-section h3 {
    margin-top: 20px;
    color: #0b3fc3;
}

/* ================== TOOLS DIRECTORY ================== */
.tools-directory a:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* ================== BACK TO TOP ================== */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #0b3fc3;
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

#backToTop:hover {
    background: #0942a5;
}

/* ================== RESPONSIVE ================== */
@media (max-width: 768px) {
    .calculator-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .calculator, .history {
        width: 100%;
        max-width: 400px;
    }
}
