/* =========================================================
   QuickToolee - Main Stylesheet
   ========================================================= */

:root {
    --primary: #6C4AB6;
    --primary-dark: #51358F;
    --primary-light: #F3EEFF;

    --background: #F8F9FC;
    --white: #FFFFFF;
    --text: #202124;
    --secondary: #6B7280;
    --border: #E5E7EB;
    --danger: #DC2626;
    --success: #16A34A;

    --sidebar-width: 250px;
    --sidebar-collapsed: 76px;
    --topbar-height: 72px;

    --shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    --radius: 14px;
}

/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
    display: block;
}

/* =========================================================
   APP LAYOUT
   ========================================================= */

.app {
    min-height: 100vh;
}

.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary);
    color: var(--white);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.25s ease;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.logo {
    font-size: 23px;
    font-weight: 700;
    color: var(--white);
    white-space: nowrap;
}

.sidebar-collapse {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    font-size: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-collapse:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-nav {
    padding: 16px 12px 30px;
}

.nav-section {
    margin-bottom: 12px;
}

.nav-section-title {
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.6);
}

.nav-link,
.nav-dropdown-toggle {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    text-align: left;
    font-size: 14px;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
}

.nav-link.active {
    background: var(--white);
    color: var(--primary);
    font-weight: 700;
}

.nav-icon {
    width: 22px;
    min-width: 22px;
    text-align: center;
    font-size: 17px;
}

.nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-dropdown-toggle {
    justify-content: space-between;
}

.nav-dropdown-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    padding: 4px 0 4px 34px;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
}

.nav-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-dropdown-menu a.active {
    background: rgba(255, 255, 255, 0.18);
    color: var(--white);
    font-weight: 700;
}

/* =========================================================
   COLLAPSED DESKTOP SIDEBAR
   ========================================================= */

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .logo,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .dropdown-arrow {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .nav-link,
.sidebar.collapsed .nav-dropdown-toggle {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .nav-dropdown-left {
    justify-content: center;
}

.sidebar.collapsed .nav-dropdown-menu {
    display: none !important;
}

.main-wrapper.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed);
}

/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 28px;
    z-index: 900;
    backdrop-filter: blur(10px);
}

.mobile-menu-button {
    display: none;
    width: 40px;
    height: 40px;
    border: 0;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 9px;
    font-size: 21px;
}

.search-wrapper {
    flex: 1;
    max-width: 520px;
    position: relative;
}

.search-input {
    width: 100%;
    height: 42px;
    padding: 0 16px 0 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: var(--background);
    color: var(--text);
}

.search-input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(108, 74, 182, 0.1);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: none;
    z-index: 1000;
}

.search-result-item {
    display: block;
    padding: 11px 15px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.search-result-item:last-child {
    border-bottom: 0;
}

.search-result-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-button {
    height: 40px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--white);
    color: var(--text);
    font-size: 14px;
}

.settings-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* =========================================================
   MOBILE SIDEBAR
   ========================================================= */

.mobile-sidebar-close {
    display: none;
}

.sidebar-overlay {
    display: none;
}

/* =========================================================
   PAGE CONTENT
   ========================================================= */

.page-content {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 20px;
    padding: 42px;
    color: var(--white);
    margin-bottom: 28px;
}

.hero-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 8px;
}

.hero h1 {
    font-size: 34px;
    line-height: 1.2;
    margin-bottom: 12px;
}

.hero p {
    max-width: 680px;
    opacity: 0.9;
    font-size: 16px;
}

.section {
    margin-bottom: 34px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
}

.section-description {
    color: var(--secondary);
    font-size: 14px;
}

/* =========================================================
   TOOL GRID
   ========================================================= */

.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.tool-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: rgba(108, 74, 182, 0.35);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.tool-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 15px;
}

.tool-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.tool-card p {
    color: var(--secondary);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.tool-card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 13px;
    border-radius: 8px;
    background: var(--primary);
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
}

.tool-card-button:hover {
    background: var(--primary-dark);
}

/* =========================================================
   CURRENCY FEATURE
   ========================================================= */

.currency-feature {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 26px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.currency-feature-content h3 {
    font-size: 20px;
    margin-bottom: 6px;
}

.currency-feature-content p {
    color: var(--secondary);
    font-size: 14px;
}

.primary-button {
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 9px;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
}

.primary-button:hover {
    background: var(--primary-dark);
}

/* =========================================================
   AD PLACEHOLDER
   ========================================================= */

.ad-placeholder {
    min-height: 90px;
    border: 1px dashed #D1D5DB;
    border-radius: 12px;
    background: #FCFCFD;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin: 20px 0;
}

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    margin-top: 40px;
    padding: 25px 0;
    border-top: 1px solid var(--border);
    color: var(--secondary);
    font-size: 13px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-links a:hover {
    color: var(--primary);
}

/* =========================================================
   CALCULATOR PAGE
   ========================================================= */

.qt-page-heading {
    margin-bottom: 24px;
}

.qt-page-heading-label {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.qt-page-heading h1 {
    font-size: 30px;
    line-height: 1.25;
    margin-bottom: 7px;
}

.qt-page-heading p {
    color: var(--secondary);
    font-size: 15px;
}

/* =========================================================
   CALCULATOR CARD
   ========================================================= */

.qt-calculator-card {
    width: 100%;
    max-width: 760px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 26px;
}

.qt-calculator-card h2 {
    font-size: 21px;
    margin-bottom: 24px;
}

/* =========================================================
   CALCULATOR FORM
   ========================================================= */

.qt-calculator-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.qt-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qt-form-group label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.qt-form-group input,
.qt-form-group select {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    background: var(--white);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.qt-form-group input:hover,
.qt-form-group select:hover {
    border-color: #C9C1DD;
}

.qt-form-group input:focus,
.qt-form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 74, 182, 0.1);
}

/* =========================================================
   CALCULATOR ACTION BUTTONS
   ========================================================= */

.qt-calculator-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.qt-calculate-button,
.qt-reset-button {
    min-height: 44px;
    padding: 0 22px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.qt-calculate-button {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: var(--white);
}

.qt-calculate-button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.qt-reset-button {
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
}

.qt-reset-button:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* =========================================================
   CALCULATOR RESULT
   ========================================================= */

.qt-result {
    margin-top: 24px;
    padding: 20px;
    border-radius: 11px;
    background: var(--primary-light);
    border: 1px solid #E4D9FF;
    color: var(--primary-dark);
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    display: none;
}

.qt-result.show {
    display: block;
}

.qt-result-error {
    background: #FEF2F2;
    border-color: #FECACA;
    color: var(--danger);
}

/* =========================================================
   INFORMATION CARD
   ========================================================= */

.qt-info-card {
    width: 100%;
    max-width: 760px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 26px;
    box-shadow: var(--shadow);
    margin-bottom: 26px;
}

.qt-info-card h2 {
    font-size: 19px;
    margin-bottom: 13px;
}

.qt-info-card p {
    color: var(--secondary);
    font-size: 14px;
    margin-bottom: 13px;
}

.qt-info-card p:last-child {
    margin-bottom: 0;
}

.qt-formula {
    display: block;
    padding: 15px;
    border-radius: 9px;
    background: #F8F7FC;
    border: 1px solid var(--border);
    color: var(--primary-dark);
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    margin: 14px 0;
    overflow-x: auto;
}

/* =========================================================
   RESPONSIVE - TABLET
   ========================================================= */

@media (max-width: 1100px) {

    .tool-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .page-content {
        padding: 26px;
    }
}

/* =========================================================
   RESPONSIVE - MOBILE
   ========================================================= */

@media (max-width: 768px) {

    :root {
        --topbar-height: 64px;
    }

    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.15);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: 280px;
    }

    .sidebar.collapsed .logo,
    .sidebar.collapsed .nav-label,
    .sidebar.collapsed .nav-section-title,
    .sidebar.collapsed .dropdown-arrow {
        display: initial;
    }

    .sidebar.collapsed .sidebar-header {
        justify-content: space-between;
        padding: 0 18px;
    }

    .sidebar.collapsed .nav-link,
    .sidebar.collapsed .nav-dropdown-toggle {
        justify-content: initial;
        padding: 10px 12px;
    }

    .sidebar.collapsed .nav-dropdown-left {
        justify-content: initial;
    }

    .sidebar-collapse {
        display: none;
    }

    .mobile-sidebar-close {
        display: flex;
        width: 34px;
        height: 34px;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 9px;
        background: rgba(255, 255, 255, 0.12);
        color: var(--white);
        font-size: 21px;
    }

    .main-wrapper,
    .main-wrapper.sidebar-collapsed {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 950;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .topbar {
        padding: 0 15px;
        gap: 10px;
    }

    .mobile-menu-button {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .search-wrapper {
        max-width: none;
    }

    .search-input {
        height: 40px;
    }

    .settings-button {
        width: 40px;
        padding: 0;
        font-size: 0;
    }

    .settings-button::before {
        content: "⚙";
        font-size: 18px;
    }

    .page-content {
        padding: 20px 15px;
    }

    .hero {
        padding: 28px 22px;
        border-radius: 16px;
    }

    .hero h1 {
        font-size: 27px;
    }

    .hero p {
        font-size: 14px;
    }

    .tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .tool-card {
        padding: 16px;
    }

    .tool-card h3 {
        font-size: 15px;
    }

    .currency-feature {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .qt-page-heading h1 {
        font-size: 26px;
    }

    .qt-calculator-card,
    .qt-info-card {
        padding: 21px;
    }

    .qt-calculator-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .qt-calculator-actions {
        width: 100%;
    }

    .qt-calculate-button,
    .qt-reset-button {
        flex: 1;
        padding: 0 15px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================================
   RESPONSIVE - SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .tool-grid {
        grid-template-columns: 1fr;
    }

    .search-wrapper {
        min-width: 0;
    }

    .search-input {
        padding-left: 36px;
        font-size: 13px;
    }

    .topbar {
        gap: 7px;
    }

    .page-content {
        padding: 16px 12px;
    }

    .qt-calculator-card,
    .qt-info-card {
        padding: 17px;
        border-radius: 13px;
    }

    .qt-page-heading h1 {
        font-size: 23px;
    }

    .qt-calculator-actions {
        gap: 9px;
    }

    .qt-calculate-button,
    .qt-reset-button {
        min-height: 43px;
        padding: 0 12px;
        font-size: 13px;
    }

    .ad-placeholder {
        min-height: 70px;
    }
}