/* ============================================================
   CalculateMaster — Component CSS
   ============================================================
   Clean CSS classes for shared components (header, sidebar,
   footer). These complement style.css and replace inline styles
   that were previously copy-pasted across 50+ HTML files.
   ============================================================ */

/* ---- HEADER LAYOUT ---- */
.header__container {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-bottom: 10px;
    flex-wrap: nowrap;
    position: relative;
}

.header-logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    order: 1;
    flex-shrink: 0;
}

.header-logo-img {
    width: 28px;
    height: 28px;
    margin-left: 9px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* ---- LOGO TEXT ---- */
.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 2px;
}

.logo-calc {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    letter-spacing: 1px;
    font-size: 0.75rem;
    color: var(--text-main);
    line-height: 1;
    padding-bottom: 1px;
    text-transform: uppercase;
}

.logo-master {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    letter-spacing: 2px;
    font-size: 0.65rem;
    color: #d8b461;
    line-height: 1.4;
    text-transform: uppercase;
}

/* ---- DESKTOP NAV ---- */
.desktop-only-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    order: 3;
}

/* ---- ACTION BUTTONS ---- */
.header__actions {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 12px;
    order: 4;
    flex-shrink: 0;
    margin-left: 30px;
}

/* ---- INSTALL ICON STACK (clean two-icon badge) ---- */
.btn-luxury {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.install-icon-stack {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.install-icon-bg {
    font-size: 1.15rem !important;
    color: inherit !important;
    line-height: 1 !important;
}

.install-icon-fg {
    font-size: 0.5rem !important;
    position: absolute !important;
    bottom: -2px !important;
    right: -4px !important;
    background: var(--bg-card, #fff) !important;
    color: #38a169 !important;
    border-radius: 50% !important;
    width: 10px !important;
    height: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 0 0 1.5px var(--border, #e2e8f0) !important;
    line-height: 1 !important;
}

[data-theme="dark"] .install-icon-fg {
    background: var(--bg-card, #1e293b) !important;
    box-shadow: 0 0 0 1.5px var(--border, #334155) !important;
}

/* ---- HEADER-ACTION VISIBILITY HELPERS ---- */
.header-action-desktop {
    display: flex !important;
}

.header-action-mobile {
    display: none !important;
}

@media screen and (max-width: 1024px) {
    .header-action-desktop {
        display: none !important;
    }
    .header-action-mobile {
        display: flex !important;
    }
}

/* ---- PWA INSTALL BUTTONS (RESPONSIVE VISIBILITY) ---- */
#install-app-btn, #install-app-btn-mob {
    display: none !important;
}

/* Desktop install button: only show if window width > 1024px and has active state classes */
@media screen and (min-width: 1025px) {
    #install-app-btn.state-installable,
    #install-app-btn.state-installed {
        display: flex !important;
    }
}

/* Mobile install button: only show if window width <= 1024px and has active state classes */
@media screen and (max-width: 1024px) {
    #install-app-btn-mob.state-installable,
    #install-app-btn-mob.state-installed {
        display: flex !important;
    }
}

/* ---- MOBILE MORE MENU (three-dots dropdown) ---- */
.mobile-more-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    z-index: 100000;
    display: none;
    flex-direction: column;
    gap: 4px;
    min-width: 170px;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transition: opacity 0.2s cubic-bezier(0.4,0,0.2,1), transform 0.2s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
}

.mobile-more-menu.open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.mobile-more-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 11px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    width: 100%;
    text-align: left;
}

.mobile-more-item:hover {
    background: var(--bg-search);
    color: var(--secondary);
}

.mobile-more-item > i {
    font-size: 1.1rem;
    color: #d8b461;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.install-icon-stack i {
    width: auto !important;
    height: auto !important;
    font-size: inherit !important;
}

/* Keep the install item hidden by default, JS reveals it */
#install-app-btn-mob[style*="display: none"] {
    display: none !important;
}

/* ---- MOBILE CATEGORY CHEVRONS ---- */
.cat-chevron {
    font-size: 0.65rem;
}

/* ---- SIDEBAR TITLE ---- */
.sidebar__title {
    padding-left: 15px;
    padding-bottom: 5px;
    margin-left: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* ---- SIDEBAR ITEM SPACING ---- */
.sidebar__item {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;         /* icon ↔ name gap (generous and professional) */
    padding: 10px 16px !important; /* taller rows for professional breathing room */
    margin-bottom: 6px !important; /* spacing between names */
    border-radius: 10px !important;
    font-size: 0.93rem !important;
    font-weight: 600 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sidebar__item i {
    min-width: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* ---- SIDEBAR LINK FIX ---- */
a.sidebar__item {
    display: flex !important;
    align-items: center !important;
    text-decoration: none;
    color: var(--text-main);
}

/* ---- SELECT DROPDOWN ARROWS ----
   Previously duplicated as inline <style> in every HTML file */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23a0aec0%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 14px top 50%;
    background-size: 12px auto;
    padding-right: 35px;
}

.custom-date-wrapper select {
    background-position: right 5px top 50%;
    padding-right: 22px;
}

[data-theme="dark"] select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23cbd5e1%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
}

/* ---- FOOTER LOGO ---- */
.footer-logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
    margin-bottom: 15px;
}

.footer-logo-link .header-logo-img {
    margin-left: 0;
}

/* ---- FOOTER STYLES ----
   Previously duplicated as inline <style> in static pages */
.cm-footer-wrap {
    background-color: var(--bg-main, #0f172a);
    border-top: 1px solid var(--border, #1e293b);
    padding-top: 60px;
    font-family: inherit;
}

.cm-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.cm-footer-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
    align-items: start;
}

.cm-brand-col {
    display: flex;
    flex-direction: column;
}

.cm-brand-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.08);
    margin: 25px 0;
    max-width: 320px;
}

.cm-footer-heading {
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cm-footer-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
    max-width: 320px;
}

.cm-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cm-link-list a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.cm-link-list a:hover {
    color: var(--primary, #d8b461);
}

.cm-suggest-btn {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--text-muted);
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 400;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    margin-top: 5px;
}

.cm-suggest-btn:hover {
    background: transparent;
    border-color: var(--secondary, #d8b461);
    color: var(--secondary, #d8b461);
}

.cm-footer-bottom {
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.05));
    padding: 25px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---- MODAL STYLES ---- */
.cm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.cm-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cm-modal-content {
    background: var(--bg-card, #1a202c);
    border: 1px solid var(--border, #2d3748);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 550px;
    position: relative;
    transform: translateY(30px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    max-height: 90vh;
    overflow-y: auto;
}

.cm-modal-overlay.active .cm-modal-content {
    transform: translateY(0);
}

.cm-close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cm-close-btn:hover {
    color: var(--text-main);
}

.cm-modal-title {
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: 800;
}

.cm-modal-label {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
}

.cm-modal-input {
    width: 100%;
    background: var(--bg-main, #0f172a);
    border: 1px solid var(--border, #2d3748);
    color: var(--text-main, #fff);
    padding: 12px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    margin-top: 8px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.cm-modal-input:focus {
    outline: none;
    border-color: var(--primary, #d8b461);
}

.cm-modal-textarea {
    min-height: 100px;
    resize: vertical;
}

.cm-modal-submit-btn {
    width: 100%;
    background: #1a202c;
    color: #ffffff;
    border: none;
    padding: 15px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cm-modal-submit-btn:hover {
    opacity: 0.9;
}

/* ---- RESPONSIVE FOOTER ---- */
@media screen and (max-width: 900px) {
    .cm-footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media screen and (max-width: 500px) {
    .cm-brand-top {
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
    .cm-footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 16px;
    }
    .cm-brand-col {
        grid-column: span 2;
    }
    .cm-footer-bottom {
        flex-direction: column;
        text-align: center;
        justify-content: center;
        padding: 20px 10px;
        gap: 4px;
    }
    .cm-footer-bottom-links {
        display: block;
        text-align: center;
        margin-top: 4px;
    }
    .cm-footer-bottom-links a {
        font-size: 0.8rem;
    }
}

/* Force overflow visible on datepicker containers so popups show */
.premium-date-wrapper {
    overflow: visible !important;
    position: relative !important;
}
.calc-body .input-group {
    overflow: visible !important;
}

/* ---- PREMIUM DATEPICKER DROPDOWN ---- */
.premium-datepicker-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 99999;
    width: 280px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: none;
    font-family: inherit;
    color: var(--text-main, #2d3748);
    overflow: hidden;
    user-select: none;
    animation: fadeInDropdown 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.premium-datepicker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: var(--bg-card, #ffffff);
    position: relative;
    z-index: 2;
}

.premium-datepicker-header button {
    background: transparent !important;
    border: none !important;
    color: var(--text-main, #2d3748) !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    padding: 5px !important;
    transition: color 0.2s, transform 0.1s !important;
    box-shadow: none !important;
}

.premium-datepicker-header button:hover {
    color: var(--secondary, #d8b461) !important;
}

.premium-datepicker-header button:active {
    transform: scale(0.9) !important;
}

.premium-datepicker-title {
    display: flex;
    gap: 6px;
    align-items: center;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.2s;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main, #2d3748);
}

.premium-datepicker-title:hover {
    background: var(--bg-search, #eef1f4);
}

.premium-datepicker-grid-wrapper {
    padding: 10px;
    transition: opacity 0.2s;
}

.premium-datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-muted, #718096);
    margin-bottom: 8px;
}

.premium-datepicker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.premium-datepicker-day {
    padding: 8px 0;
    text-align: center;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-main, #2d3748);
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
}

.premium-datepicker-day:hover:not(.empty) {
    background: var(--bg-search, #eef1f4);
}

.premium-datepicker-day.today {
    color: var(--secondary, #d8b461) !important;
    font-weight: 800;
    border: 1px solid var(--secondary, #d8b461) !important;
}

.premium-datepicker-day.selected {
    background: var(--secondary, #d8b461) !important;
    color: var(--bg-card, #ffffff) !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(216, 180, 97, 0.3);
}

div.premium-datepicker-years.year-picker-overlay {
    display: none !important;
    position: absolute;
    top: 55px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card, #ffffff);
    z-index: 10;
    padding: 15px;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    overflow-y: auto;
}

div.premium-datepicker-years.year-picker-overlay.show {
    display: grid !important;
}

.premium-datepicker-year {
    padding: 8px 0;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    background: var(--bg-main, #f6f8fa);
    color: var(--text-main, #2d3748);
    border: 1px solid var(--border, #e2e8f0);
    transition: all 0.2s;
}

.premium-datepicker-year:hover {
    border-color: var(--secondary, #d8b461);
    color: var(--secondary, #d8b461);
}

.premium-datepicker-year.active {
    background: var(--secondary, #d8b461) !important;
    color: var(--bg-card, #ffffff) !important;
    font-weight: 700;
    border-color: var(--secondary, #d8b461) !important;
    box-shadow: 0 4px 10px rgba(216, 180, 97, 0.2);
}

/* ---- MOBILE HEADER CATEGORY ROW & BOXES ---- */
@media screen and (max-width: 1024px) {
    /* Make header relative and transparent so category row floats over body background without sticking */
    .header {
        position: relative !important;
        background: transparent !important;
        box-shadow: none !important;
        border-bottom: none !important;
        height: auto !important;
        min-height: auto !important;
        padding: 0 !important;
    }
    
    .header__container {
        padding: 0 !important;
    }
    
    /* Hide desktop action buttons on mobile */
    #install-app-btn.state-installable,
    #install-app-btn.state-installed,
    #theme-toggle,
    #theme-toggle.btn-icon {
        display: none !important;
    }
    
    /* Solid background on top row only and make it fixed/sticky */
    .header-top-row {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
        background: var(--bg-card) !important;
        box-shadow: rgba(0, 0, 0, 0.04) 0px 4px 20px !important;
        border-bottom: 1px solid var(--border) !important;
        padding: 8px 12px !important;
        box-sizing: border-box !important;
    }
    
    .mobile-category-row {
        background: transparent !important;
        border-top: none !important;
        border-bottom: none !important;
        padding: 12px 12px !important;
        margin-top: 54px !important; /* Push down to clear fixed header-top-row */
    }
    
    .mobile-dropdown-panel {
        display: none;
    }
    
    /* Stylize category boxes as distinct cards floating on the body background */
    .cat-box {
        background: var(--bg-card) !important;
        border: 1px solid var(--border) !important;
        color: var(--text-muted) !important;
        padding: 8px 18px !important;
        border-radius: 10px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02) !important;
        font-weight: 600 !important;
    }
    
    .cat-box.active-box,
    .cat-box:hover {
        background: var(--bg-card) !important;
        border-color: var(--secondary) !important;
        color: var(--secondary) !important;
        box-shadow: 0 4px 12px rgba(216, 180, 97, 0.1) !important;
    }
}

/* ---- HOME DASHBOARD CARDS & ALIGNMENT ---- */
.home-calc-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 15px !important;
}

.dash-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    padding: 16px 20px 18px 20px !important;
    text-decoration: none !important;
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02) !important;
    position: relative !important;
    overflow: hidden !important;
}

.dash-card:hover {
    transform: translateY(-4px) !important;
    border-color: var(--secondary) !important;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="dark"] .dash-card:hover {
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25) !important;
}

.dash-card-header {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 8px !important;
}

.home-calc-grid .dash-card .dash-card-header .dash-icon-box {
    margin-bottom: 0 !important;
    width: 38px !important;
    height: 38px !important;
    font-size: 1.05rem !important;
    border-radius: 8px !important;
}

.dash-icon-box,
.home-calc-grid .dash-card .dash-icon-box {
    width: 44px !important;
    height: 44px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.2rem !important;
    margin-bottom: 16px !important;
    transition: transform 0.3s ease !important;
    flex-shrink: 0 !important;
}

.dash-icon-box i,
.home-calc-grid .dash-card .dash-icon-box i {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dash-card:hover .dash-icon-box {
    transform: scale(1.1) !important;
}

/* ---- SEARCH CONTAINER MOBILE WIDTH & SPACING ---- */
@media screen and (max-width: 1024px) {
    #animated-search {
        margin-left: 10px !important;
        margin-right: 10px !important;
        max-width: none !important;
    }
}

/* ---- SIDEBAR ITEM SPACING & ICON GAP (PC/Desktop) ---- */
.sidebar__item {
    padding: 8px 12px !important;
    margin-bottom: 4px !important;
    gap: 11px !important;
}

.sidebar__item i {
    width: 20px !important;
    text-align: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

/* ---- MAIN CONTENT & CALCULATOR BOX TOP SPACING ---- */
/* PC/Desktop spacing */
#main-content {
    margin-top: 35px !important;
}

.calc-panel {
    margin-top: 0 !important;
}

/* Mobile/Tablet spacing */
@media screen and (max-width: 1024px) {
    #main-content {
        margin-top: 10px !important;
    }
    
    .calc-panel {
        margin-top: 0 !important;
    }
}

/* ---- CURRENCY CONVERTER DROPDOWN POPUP ---- */
.cc-dropdown {
    display: none;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10000 !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
    padding: 6px 0 !important;
    margin: 4px 0 0 0 !important;
    list-style: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

[data-theme="dark"] .cc-dropdown {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
}

.cc-dropdown li {
    list-style: none !important;
    transition: background 0.2s, color 0.2s !important;
}

.cc-dropdown li:hover,
.cc-dropdown li.active {
    background: var(--bg-search) !important;
}

/* ---- APPLE-STYLE SWAP BUTTONS & PERFECT ALIGNMENT ---- */
.swap-btn-inline,
#uc-swap-btn,
#cc-swap {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 50% !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
    padding: 0 !important;
    margin: 0 !important;
}

.swap-btn-inline:hover,
#uc-swap-btn:hover,
#cc-swap:hover {
    color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    box-shadow: 0 4px 12px rgba(216, 180, 97, 0.15) !important;
    transform: scale(1.05) !important;
}

.swap-btn-inline:active,
#uc-swap-btn:active,
#cc-swap:active {
    transform: scale(0.95) !important;
}

/* Ensure the icon inside is also flex-centered */
.swap-btn-inline i,
#uc-swap-btn i,
#cc-swap i {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.9rem !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* Align containers on desktop */
@media screen and (min-width: 769px) {
    .swap-wrapper {
        height: 45px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .cc-swap-btn-container {
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding-bottom: 0 !important;
        margin: 0 !important;
    }
}

/* Center mobile vertical float offset dynamically */
@media screen and (max-width: 768px) {
    #currency-calc .cc-convert-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0px !important;
        position: relative !important;
    }
    
    #currency-calc .cc-convert-row .cc-from-group {
        margin-bottom: 28px !important;
    }
    
    #currency-calc .cc-convert-row .cc-to-group {
        margin-top: 0px !important;
    }
    
    #currency-calc .cc-convert-row .cc-swap-btn-container {
        position: absolute !important;
        left: 50% !important;
        top: 88px !important;
        transform: translate(-50%, -50%) !important;
        z-index: 100 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 38px !important;
        height: 38px !important;
    }
    
    #currency-calc .cc-convert-row #cc-swap {
        transform: rotate(90deg) !important;
    }
}

#currency-calc .calc-header .header-text h1 {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
