body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to right, #ece9e6, #ffffff); /* Light mode gradient */
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background: linear-gradient(to right, #2c3e50, #4a69bd); /* Dark mode gradient */
    color: #eee;
}

.navbar {
    background-color: #343a40 !important;
}

.navbar.dark-mode {
    background-color: #1a252f !important;
}

.hero-section {
    background: linear-gradient(45deg, #007bff, #0056b3); /* Blue gradient */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.hero-section.dark-mode {
    background: linear-gradient(45deg, #4a69bd, #2c3e50); /* Darker blue gradient */
}

.card {
    border: none;
    border-radius: 10px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.card.dark-mode {
    background-color: #343a40;
    color: #eee;
}

.card.dark-mode .card-title {
    color: #fff;
}

/* NAVBAR: animated underline + gradient text on hover */
.navbar .nav-link {
    position: relative;
    overflow: visible;
    color: rgba(255,255,255,0.9);
    transition: color .18s ease;
}
.navbar .nav-link::after{
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    bottom: 0.05rem;
    height: 2px;
    width: 60%;
    background: linear-gradient(90deg,#ff7a18,#af1cff,#3a86ff);
    transform-origin: center;
    transition: transform .22s cubic-bezier(.2,.8,.2,1), opacity .18s ease;
    opacity: 0;
}
.navbar .nav-link:hover::after,
.navbar .nav-link:focus::after{
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
}
/* gradient text on hover */
.navbar .nav-link:hover, .navbar .nav-link:focus {
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    background-image: linear-gradient(90deg,#ff7a18,#af1cff,#3a86ff);
    -webkit-text-fill-color: transparent;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
}

.btn-outline-primary:hover {
    background-color: #007bff;
    color: #fff;
}

.form-control {
    border-radius: 5px;
}

.form-control.dark-mode {
    background-color: #495057;
    color: #fff;
    border-color: #6c757d;
}

.form-control.dark-mode::placeholder {
    color: #ccc;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

.footer {
    background-color: #343a40 !important;
}

.footer.dark-mode {
    background-color: #1a252f !important;
}

/* Social icons in footer */
.social-icons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
}

/* Footer layout: stack small text and social icons vertically on narrow viewports */
.footer .container.text-center{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* On larger screens show two-column layout: left text block and icons on the right */
@media (min-width: 768px) {
    .footer .container.text-center{
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
    .footer .footer-left { text-align: left; }
    .footer .footer-left p { margin: 0; }
    .footer .social-icons { margin-top: 0; }
}

/* small spacing tune for stacked layout */
.footer .container.text-center p { margin-bottom: 6px; }
.social-icons a {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.social-icons a:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Platform color gradients */
.social-facebook { background: linear-gradient(135deg,#1877F2,#0F63D8); }
.social-x { background: linear-gradient(135deg,#1DA1F2,#0E87D3); }
.social-linkedin { background: linear-gradient(135deg,#0A66C2,#004182); }
.social-github { background: linear-gradient(135deg,#333,#111); }
.social-hf { background: linear-gradient(135deg,#FF6B6B,#FFD97D); }

.social-icons svg { width: 20px; height: 20px; }

/* Small scientific calculator widget styles (home hero) */
.calc-widget{
    width: 360px;
    background: linear-gradient(180deg,#f0f8ff 0%, #e6f2fb 100%);
    color: #222;
    border-radius: 8px;
    padding: 12px;
}
.calc-display{
    display:flex;
    flex-direction:column;
    gap:6px;
    padding:6px;
    margin-bottom:10px;
}
/* grid layout */
.calc-top{
    background: linear-gradient(90deg,#0b6fae,#1fa2ff);
    color: #fff;
    border-radius:6px;
    padding:6px 10px;
}
.calc-top .expr{font-size:13px;opacity:0.9;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calc-top .result{font-size:20px;font-weight:600;text-align:right}

.calc-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.calc-grid .btn{padding:8px 6px;border-radius:6px;font-size:13px}
.btn-fn{background:#f5f7fa;color:#111;border:1px solid #d6e6f3}
.btn-op{background:#e9f6ff;color:#0a3a5b;border:1px solid #cfeefc}
.btn-num{background:#dfeefc;color:#062635;border:1px solid #c3e6fb}
.btn-dot{background:#dfeefc;color:#062635;border:1px solid #c3e6fb}
.btn-ac{background:#ffdede;color:#6b0b0b;border:1px solid #ffbdbd}
.btn-eq{background:linear-gradient(90deg,#0b85d8,#035fa3);color:#fff;border:none;padding:10px 12px}
.btn-back{background:#fff8e6;color:#6a4b00;border:1px solid #ffeab0}
.btn-mem{background:#eef7ff;color:#033a5b;border:1px solid #d8f0ff}

@media(max-width:991px){
    .calc-widget{width:100%;max-width:600px}
    .calc-grid{grid-template-columns:repeat(4,1fr)}
}

@media(max-width:991px){
    .calc-widget{width:100%;max-width:420px}
}



/* Smart Calculator theme & layout additions (clean, formatted) */
/* Light / Dark mode containers */
body.light-mode {
    background-color: #e9f1fa;
    color: #000;
    transition: all 0.3s ease;
}

body.dark-mode {
    background-color: #1e1e1e;
    color: #fff;
    transition: all 0.3s ease;
}

.calculator {
    width: 320px;
    max-width: 95vw;
}

.display {
    min-height: 70px;
    text-align: right;
    overflow-x: auto;
}

button {
    font-weight: 600;
    border-radius: 8px !important;
    transition: all 0.2s ease;
}

button:hover {
    transform: scale(1.03);
}

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

/* Dark-mode overrides for calculator */
.dark-mode .calculator {
    background-color: #2b2b2b !important;
    border-color: #444 !important;
}

.dark-mode .display {
    background-color: #004080 !important;
}

.dark-mode .btn-secondary {
    background-color: #555 !important;
    color: #fff !important;
}

.dark-mode .btn-primary {
    background-color: #007acc !important;
}

/* Ensure center alignment helper */
.calculator.mx-auto { margin-left: auto; margin-right: auto; }

/* End Smart Calculator additions */


