

/* It has CSS for Header, Main-Layout (Main-Leftside, Sidebar), and Footer */
/* It also has Universal Colors and Tag Designs */


@import url('https://fonts.googleapis.com/css2?family=Exo+2:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --bg: #f6f8fc;
    --surface: #ffffff;
    --surface-2: #eef3ff;
    --text: #172033;
    --muted: #667085;
    --primary: #5b5bd6;
    --primary-dark: #4646b8;
    --accent: #15b8a6;
    --border: #e5e9f2;
    --shadow: 0 12px 32px rgba(22, 34, 60, 0.08);
    --radius: 20px;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: "Exo 2", sans-serif;
    background:
      radial-gradient(circle at top left, rgba(91,91,214,.10), transparent 35%),
      radial-gradient(circle at top right, rgba(21,184,166,.09), transparent 30%),
      var(--bg);
    color: var(--text);
    min-height: 100vh;
}
button, input, select {
    font: inherit;
    border: 0;
    outline: none;
}
button {
    cursor: pointer;
    border-radius: 10px;
}
a {
    color: inherit;
    text-decoration: none;
}
img {
    display: block;
    overflow: hidden;
}


h3 {
  font-size: 1rem;
}


/* -----   CONTAINER  CONTAINER  CONTAINER  CONTAINER  CONTAINER    ----- */
.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}



/* -----   HEADER   HEADER   HEADER   HEADER   HEADER   ----- */
header {
    padding: 13px 0;
    background: rgba(246, 248, 252, .86);
    backdrop-filter: blur(14px);
    border-bottom: 2px solid rgba(229, 233, 242, .2);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: relative;
}
.nav > *:not(nav) {
    flex: 1;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: .03em;
    color: var(--primary);
}
.web-logo {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid gray;
    box-shadow: 0 8px 18px rgba(91, 91, 214, .25);
}
.web-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    overflow: hidden;
}

nav {
  flex: 1.5;
}
nav ul {
    display: flex;
    justify-content: center;
    gap: 20px;
    list-style: none;
    color: var(--text);
    font-weight: 700;
    font-size: 0.95rem;
}
nav a {
    letter-spacing: 0.4px;
    padding: 5px;
}
nav a:hover {
    color: var(--primary);
}
.nav-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
}
.nav-button {
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: .2s ease;
}
.nav-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ------   TOGGLE NAVIGATION    TOGGLE NAVIGATION   ------ */
.menu-toggle {
    display: none;
    width: 40px;
    height: 38px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.menu-toggle span {
    display: block;
    width: 21px;
    height: 2px;
    margin: 4px auto;
    background: var(--text);
    border-radius: 999px;
    transition: transform .18s ease, opacity .18s ease;
}
.menu-toggle.is-open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}



/* -----   MAIN MAIN MAIN MAIN MAIN   ----- */
main {
    padding: 25px 0;
}
.main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 28px;
}


/* -----   MAIN-LEFTSIDE  MAIN-LEFTSIDE  MAIN-LEFTSIDE   ----- */
.main-heading {
    margin-bottom: 30px;
}
.main-heading h1 {
    margin-bottom: 6px;
    letter-spacing: 0.3px;
    word-spacing: 2px;
    font-weight: 700;
}
.main-heading p {
    line-height: 1.4;
    font-size: 15px;
    font-weight: 500;
}


.sc-calculator {
    max-width: 400px;
    margin: 0 auto;
    padding: 10px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e9f2);
    border-radius: 15px;
    box-shadow: var(--shadow, 0 12px 32px rgba(22, 34, 60, .08));
}


/* -----   CALCULATION HISTORY  CALCULATION HISTORY   ----- */
.sc-history-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 8px;
}
.sc-history-toggle {
    display: inline-flex;
    gap: 5px;
    background: var(--surface-2);
    border: 1px solid rgba(91, 91, 214, .18);
    color: var(--primary);
    letter-spacing: 0.3px;
}
.sc-history-toggle:hover {
    background: rgba(91, 91, 214, .14);
}
.sc-history-toggle span {
    padding: 2px 6px;
    background: var(--primary);
    border-radius: 20px;
    color: #fff;
    font-size: .72rem;
}
.sc-clear-history-button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: #c73849;
}
.sc-clear-history-button:hover {
    background: rgba(199, 56, 73, .08);
    border-color: rgba(199, 56, 73, .25);
}
.sc-history-toggle, .sc-clear-history-button {
    padding: 8px 10px 7px;
    font-size: .85rem;
    font-weight: 800;
}

/* -----   CALCULATION HISTORY PANEL  CALCULATION HISTORY PANEL   ----- */
.sc-saved-history-panel {
    margin-bottom: 10px;
    padding: 10px 5px 10px 10px;
    background: #f8f9fc;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.sc-saved-history-panel[hidden] {
    display: none;
}
.sc-saved-history-head {
    margin-bottom: 10px;
}
.sc-saved-history-head h3 {
    margin-bottom: 4px;
}
.sc-saved-history-head p {
    margin: 0;
    color: var(--muted);
    font-size: .78rem;
}
.sc-saved-history-list {
    display: grid;
    gap: 5px;
    max-height: 247px;
    overflow-y: auto;
}
.sc-saved-history-empty {
    padding: 12px 10px;
    color: var(--muted);
    font-size: .90rem;
    text-align: center;
}
.sc-saved-history-item {
    width: 100%;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    text-align: left;
}
.sc-saved-history-item:hover {
    border-color: rgba(91, 91, 214, .35);
    background: var(--surface-2);
}
.sc-saved-history-expression {
    display: block;
    overflow: hidden;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: .80rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sc-saved-history-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    font-weight: 800;
}
.sc-saved-history-result small {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 600;
}


/* -----   CALCULATOR SCREEN  CALCULATION SCREEN   ----- */
.sc-screen {
    min-height: 95px;
    margin-bottom: 10px;
    padding: 10px 15px 0;
    overflow: hidden;
    background: #f7f8fc;
    border: 1px solid var(--border, #e5e9f2);
    border-radius: 15px;
}
.sc-history {
    min-height: 24px;
    overflow: hidden;
    color: var(--muted, #667085);
    font-size: .95rem;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sc-display {
    overflow-x: auto;
    overflow-y: hidden;
    color: var(--text, #172033);
    font-size: 45px;
    font-weight: 700;
    line-height: 1.18;
    text-align: right;
    white-space: nowrap;
    scrollbar-width: none;
}
.sc-display::-webkit-scrollbar {
    display: none;
}

/* -----   CALCULATOR BUTTONS  CALCULATOR BUTTONS   ----- */
.sc-memory-row, 
.sc-keypad {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
}
.sc-memory-row {
    margin-bottom: 5px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.sc-key {
    min-height: 42px;
    border: 1.3px solid var(--border, #e5e9f2);
    background: #fff;
    color: var(--text, #172033);
    font-size: 0.85rem;
    font-weight: 700;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.sc-key:hover {
    background: var(--surface-2, #eef3ff);
    border-color: rgba(91, 91, 214, .3);
    transform: translateY(-1px);
}
/* Separate DEG/RAD mode controls */
.sc-key:active {
    transform: translateY(0);
}
.sc-mode-key {
    background: var(--surface-2, #eef3ff);
    color: var(--primary, #5b5bd6);
}
.sc-mode-key.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.sc-mode-key.is-active:hover {
    background: var(--primary-dark);
    color: #fff;
}
.sc-number-key {
    font-size: 1.05rem;
}
.sc-operator-key {
    background: rgba(91, 91, 214, .09);
    color: var(--primary, #5b5bd6);
    border-color: rgba(91, 91, 214, .18);
    font-size: 1.35rem;
}
.sc-clear-key {
    background: rgba(210, 54, 73, .08);
    color: #c33447;
    border-color: rgba(210, 54, 73, .17);
}
.sc-answer-key {
    grid-column: span 2;
}
.sc-equals-key {
    grid-column: span 4;
    background: var(--primary, #5b5bd6);
    color: #fff;
    border-color: var(--primary, #5b5bd6);
    font-size: 1.15rem;
}
.sc-equals-key:hover {
    background: var(--primary-dark, #4646b8);
    color: #fff;
}


/* -----   HORIZONTAL AD   HORIZONTAL AD   HORIZONTAL AD   ----- */
.horizontal-ad {
    display: block !important;
    width: 100% !important;
    min-height: 110px !important;
    background: linear-gradient(135deg, rgba(91, 91, 214, .07), rgba(21, 184, 166, .08)), #fff !important;
    border: 1px dashed #b9c2d4 !important;
    opacity: 1 !important;
    margin-top: 50px !important;
    border-radius: 15px !important;
    visibility: visible !important;
    position: relative !important;
}



/* -----   DESCRIPTION AND GUIDELINES   DESCRIPTION AND GUIDELINES   ----- */
#instructions {
    padding: 30px 25px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e9f2);
    border-radius: 20px;
    margin-top: 50px;
}
#instructions h2:not(:first-child) {
    margin-top: 30px;
}
#instructions p {
    margin-top: 12px;
}
#instructions ol, #instructions ul {
    padding-left: 25px;
    margin-top: 10px;
}
#instructions li {
    line-height: 1.8;
}


.sc-function-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 15px;
}
.sc-function-item {
    padding: 15px;
    background: #f8f9fc;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.sc-function-item h3 {
    margin-bottom: 7px;
}
.sc-function-item p {
    margin: 0;
    font-size: .92rem;
    line-height: 1.4;
}


.example-list {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}
.example-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 15px;
    background: #f8f9fc;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.example-list code {
    color: var(--primary);
    font-size: .95rem;
    font-weight: 800;
}
.example-list span {
    color: var(--muted);
    font-size: .9rem;
    text-align: right;
    font-weight: 500;
}


/* -----   DESCRIPTION AND GUIDELINES   DESCRIPTION AND GUIDELINES   ----- */
.faq-questions {
    display: grid;
    gap: 12px;
    margin-top: 15px;
}
.faq-item {
    padding: 15px;
    background: #f8f9fc;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.faq-item h3 {
    margin: 0 0 8px;
}
.faq-item p {
    margin-top: 5px;
    line-height: 1.4;
    font-size: 0.97rem;
}

.note {
    margin-top: 28px !important;
    padding: 10px 15px;
    background: rgba(214, 107, 91, 0.07);
    border-left: 4px solid #c73849;
    border-radius: 10px;
    color: var(--text) !important;
    font-size: .92rem;
    line-height: 1.5;
}

#scStatus.visually-hidden {
    display: none;
}




/* -----   SIDEBAR  SIDEBAR  SIDEBAR  SIDEBAR  SIDEBAR   ----- */
.sidebar-search .tool-search-box {
    display: block;
    padding: 20px 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(22, 34, 60, .045);
}
.sidebar-search .tool-search-label {
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 0.5px;
    word-spacing: 2px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
}
.sidebar-search .tool-search-control {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
    padding: 7px;
    background: #f8f9fc;
    border: 1px solid var(--border);
    border-radius: 15px;
}
.tool-search-control:focus-within {
    border-color: rgba(91, 91, 214, .55);
    box-shadow: 0 0 0 4px rgba(91, 91, 214, .09);
}
.tool-search-icon {
    padding-left: 7px;
    color: var(--muted);
    font-size: 1.8rem;
}
.tool-search-control input {
    min-width: 0;
    padding: 10px 4px;
    background: transparent;
    color: var(--text);
    font-weight: 500;
}
.tool-search-control > button {
    width: 100%;
    grid-column: 1 / -1;
    padding: 10px 0px;
    background: var(--primary);
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.tool-search-control > button:hover {
    background: var(--primary-dark);
}

/* -----   SEARCH RESULTS  SEARCH RESULTS  SEARCH RESULTS   ----- */
.tool-search-results {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    left: 0;
    z-index: 50;
    display: none;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(22, 34, 60, .16);
}
.tool-search-results .tool-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  text-align: left;
}
.tool-search-results .tool-search-result + .tool-search-result {
  margin-top: 4px;
}
.tool-search-result:hover,
.tool-search-result.active {
    background: var(--surface-2);
    border-color: rgba(91, 91, 214, .20);
}
.tool-search-results.show {
    display: block;
}
.tool-search-result strong {
    display: block;
    margin-bottom: 3px;
    font-size: .92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tool-search-result span {
    display: block;
    color: var(--text);
    font-size: .80rem;
}
.tool-search-empty {
    padding: 18px 14px;
    color: var(--muted);
    font-size: .90rem;
    text-align: center;
}



/* -----   SIDEBAR AD   SIDEBAR AD   SIDEBAR AD   ----- */
.sidebar-ad {
    display: block !important;
    width: 100% !important;
    aspect-ratio: 1/1 !important;
    background: linear-gradient(135deg, rgba(91, 91, 214, .07), rgba(21, 184, 166, .08)), #fff !important;
    border: 1px dashed #b9c2d4 !important;
    opacity: 1 !important;
    margin-top: 50px !important;
    border-radius: 15px !important;
    visibility: visible !important;
    position: relative !important;
}



/* -----   RELATED TOOLS   RELATED TOOLS   RELATED TOOLS   ----- */
.related-tools {
    margin-top: 40px;
    padding: 22px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e9f2);
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(22, 34, 60, .045);
}
.related-tools h3 {
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 0.5px;
    word-spacing: 2px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
}
.related-tools a {
    display: block;
    padding: 10px 0;
    text-align: center;
    font-size: .90rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border, #e5e9f2);
}
.related-tools a:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}
.related-tools a:hover {
    color: var(--primary, #5b5bd6);
}



/* -----   FOOTER  FOTTER  FOOTER  FOTTER  FOOTER  FOTTER   ----- */
.footer {
    text-align: center;
    box-shadow: 0 15px 20px rgba(0,0,0,0.35);
    padding: 13px 0 5px;
    background: var(--surface);
    backdrop-filter: blur(14px);
    border-bottom: 2px solid rgba(229, 233, 242, .2);
    border-top: 1px solid rgba(121, 54, 220, 0.8);
}
.footer-social {
    padding-top: 25px;
    display: flex;
    justify-content: center;
    gap: 18px;
}
.footer-social a {
    width: 38px;
    height: 38px;
    background: var(--surface-2);
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    transition: .1s;
}
.footer-social a:hover {
    transform: translateY(-3px);
}
.footer-links {
    margin: 35px 0;
    display: flex;
    justify-content: center;
    gap: 30px;
}
.footer-links a {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
    transition: .1s;
}
.footer-links a:hover {
    color: var(--primary);
}
.footer-bottom {
    border-top: 1px solid var(--muted);
    padding: 15px 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}



@media (max-width: 920px) {
    .main-layout {
      grid-template-columns: 1fr;
    }  
    .main-sidebar {
      width: min(100%, 400px);
      margin: 0 auto;
    }
}


@media (max-width: 880px) {
    header .nav > nav {
        position: absolute;
        top: calc(100% + 15px);
        right: 0;
        left: 0;
        z-index: 60;
        display: none;
        padding: 10px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 15px;
        box-shadow: var(--shadow);
    }
    header .nav > nav.is-open {
        display: block;
    }
    header .nav > nav ul {
        display: flex;
        flex-direction: column;
        gap: 0px;
    }
    header .nav > nav a {
        display: block;
        padding: 10px;
        border-radius: 10px;
    }
    header .nav > nav a:hover {
        background: var(--surface-2);
    }
    .menu-toggle {
        display: inline-block;
    }
}


@media (max-width: 750px) {
    #instructions {
        padding: 20px;
        background: var(--surface, #fff);
        border: 1px solid var(--border, #e5e9f2);
        border-radius: 15px;
        margin-top: 50px;
    }
    #instructions ol, #instructions ul {
        padding-left: 20px;
    }
}


@media (max-width: 650px) {
    .explore-tools-button {
        display: none;
    }
}


@media (max-width: 430px) {
    .container {
        width: min(1120px, calc(100% - 16px));
        margin: 0 auto;
    }

    .main-heading {
        padding: 0 5px;
    }

    /* -----   DESCRIPTION AND GUIDELINES   DESCRIPTION AND GUIDELINES   ----- */
    #instructions {
        padding: 20px 15px;
        border-radius: 10px;
        margin-top: 35px;
    }
    #instructions h2 {
        font-size: 22px;
    }
    #instructions h2:not(:first-child) {
        margin-top: 25px;
    }
    #instructions p {
        font-size: 15px;
    }
    #instructions ol, #instructions ul {
        padding-left: 15px;
        font-size: 15px;
    }
    #instructions li {
        line-height: 1.7;
    }
    .sc-function-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }


    .footer-links {
        flex-direction: column;
        gap: 20px;
    }
    .footer-links a {
        font-size: 16px;
    }

}


