/* === Modern Preloader (faqat #app ichida) === */
#app .placeholder-glow .placeholder {
    display: inline-block;
    height: 1em;
    background-color: #e9ecef;
    border-radius: 0.375rem;
    animation: placeholder-glow 1.4s ease-in-out infinite;
}

#app .placeholder {
    border-radius: 0.5rem;
    background-color: #e9ecef;
}

#app .placeholder-img {
    width: 100px;
    height: 100px;
    border-radius: 0.75rem;
    background-color: #dee2e6;
}

#app .placeholder-line {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 0.25rem;
}

#app .placeholder-line:last-child {
    margin-bottom: 0;
}

@keyframes placeholder-glow {
    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.4;
    }
}

/* === Loader cards layout === */
#app .placeholder-card {
    border-radius: 1rem;
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: 0.3s ease;
    border: 1px solid #f0f0f0;
    padding: 1.25rem;
}

#app .placeholder-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Hidden Vue until ready */
[v-cloak] {
    display: none !important;
}

/* --- General card / layout rules for #app --- */
#app .single-note-item .card {
    border-radius: 1rem;
}

#app .single-note-item .row {
    align-items: center;
}

#app .single-note-item img {
    width: 80px;
    height: 80px;
    border-radius: 0.5rem;
    background-color: #fff;
    object-fit: contain;
}

/* Typography helpers */
#app .fw-semibold {
    font-weight: 600 !important;
}

/* Small badge helper */
#app .badge-soft {
    font-size: 0.85rem;
    line-height: 1;
}

/* Smooth fade helper */
#app .fade-smooth {
    transition: opacity 0.25s ease-in-out;
}

/* Hide elements managed by v-show when false */
#app [v-show="false"] {
    opacity: 0;
    pointer-events: none;
}

/* --- Dropdown style (currency) --- */
#app .dropdown-toggle {
    border-radius: 0.75rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    transition: 0.2s;
}

#app .dropdown-toggle:hover {
    background-color: rgba(1, 16, 37, 0.08);
}

/* Currency dropdown button specifics */
#app .currency-dropdown-btn {
    width: 230px !important;
    justify-content: space-between;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#app .currency-dropdown-btn i {
    flex-shrink: 0;
}

#app .currency-dropdown-btn .text-truncate {
    display: inline-block;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ensure dropdown menu aligns visually with button */
#app .dropdown-menu {
    min-width: 230px !important;
}

/* Buttons / interactive elements consistent look */
#app .card-hover {
    transition: all 0.25s ease;
}

#app .card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* --- Desktop nav pills (kept as in original) --- */
/* The original .nav.nav-pills rules are applied by Bootstrap; we only tweak spacing via container class */
.responsive-nav-rates {
    gap: 0.75rem;
}

/* --- Small adjustments for single-note-item content blocks --- */
.single-note-item .card-body {
    padding: 1rem;
}

/* --- Mobile-specific styles (grouped) --- */
@media (max-width: 767.98px) {

    /* Columns in the card rows should stack and center on mobile */
    #app .col-md-5,
    #app .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
        text-align: center;
    }

    /* Some flex containers should switch to column for compact layout */
    #app .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.75rem;
    }

    #app .card-body {
        padding: 1rem;
    }

    #app .nav.nav-pills {
        flex-direction: column;
    }

    #app .dropdown-toggle {
        width: 100%;
    }

    /* Sorting buttons: make compact */
    .tab-content .btn-group.btn-group-sm button {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.85rem !important;
        gap: 0.35rem !important;
    }

    .tab-content .btn-group.btn-group-sm i {
        font-size: 0.9rem !important;
    }

    /* Compact sorting area */
    .border-bottom .d-flex.flex-wrap.align-items-center {
        flex-wrap: nowrap !important;
        gap: 6px !important;
    }

    /* Hide the desktop-only label */
    .border-bottom .d-none.d-md-flex {
        display: none !important;
    }

    /* Make btn-group fill row on mobile, with small gaps */
    .border-bottom .btn-group {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        justify-content: space-between !important;
        gap: 4px !important;
    }

    .border-bottom .btn-group .btn {
        flex: 1;
        padding: 6px 4px !important;
        font-size: 0.78rem !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
    }

    .border-bottom .btn-group .btn i {
        font-size: 0.9rem !important;
    }
}

/* Slightly broader mobile breakpoint tweaks and mobile filter styles */
@media (max-width: 768px) {
    .responsive-nav-rates {
        padding: 1rem !important;
        gap: 1rem !important;
    }

    /* Currency button becomes full width */
    .currency-dropdown-btn {
        width: 100% !important;
        padding: 10px 12px !important;
        border-radius: 10px !important;
        font-size: 0.9rem !important;
    }

    /* Course source pills scroll horizontally */
    .responsive-nav-rates .nav-link {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
        border-radius: 8px !important;
        white-space: nowrap;
    }

    .responsive-nav-rates .d-flex.flex-wrap {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        gap: 10px;
        padding-bottom: 4px;
    }

    .responsive-nav-rates .d-flex.flex-wrap::-webkit-scrollbar {
        display: none;
    }

    /* Central bank card visual */
    .cbu-mobile-card {
        width: 100%;
        background: #f9fafb;
        border-radius: 12px;
        padding: 12px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .cbu-mobile-card h6 {
        font-size: 0.95rem !important;
        margin-bottom: 4px;
    }

    .cbu-mobile-card small {
        font-size: 0.8rem !important;
    }

    .cbu-mobile-card img {
        width: 28px !important;
        height: 28px !important;
    }

    /* Hide desktop-left border in mobile nav area */
    .responsive-nav-rates .nav-item.ms-auto>div {
        border-left: none !important;
        padding-left: 0 !important;
        justify-content: flex-start !important;
    }

    /* Table compactness on mobile */
    table.table-sm td,
    table.table-sm th {
        padding: 6px 4px !important;
    }

    table.table-sm .small {
        font-size: 0.78rem !important;
    }

    table.table-sm img {
        width: 22px !important;
        height: 22px !important;
    }

    table.table-sm td span {
        display: inline-block;
        line-height: 1;
    }

    /* MOBILE FILTER area styles */
    .mobile-filter {
        padding: 0 5px;
    }

    .mobile-card {
        background: #fff;
        padding: 14px 16px;
        border-radius: 14px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    }

    .mobile-label {
        font-size: 0.8rem;
        font-weight: 600;
        color: #6c757d;
        margin-bottom: 6px;
        display: block;
    }

    /* Generic mobile select (when used) */
    .mobile-select {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        background: #f8f9fc;
        border: 1px solid #e7eaf0;
        border-radius: 12px;
        font-weight: 600;
    }

    .mobile-select:hover {
        background: rgba(1, 16, 37, 0.08);
    }

    /* Segmented control (both currency and rate-type on mobile) */
    .mobile-segment {
        background: #f1f3f7;
        padding: 4px;
        border-radius: 12px;
        display: flex;
        gap: 6px;
    }

    .segment-btn {
        flex: 1;
        background: transparent;
        border: 0;
        padding: 8px;
        border-radius: 10px;
        text-align: center;
        font-size: 1rem;
        color: #6c757d;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }

    .segment-btn.active {
        background: white;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
        color: #011025;
        font-weight: 600;
    }

    .segment-label {
        font-size: 0.65rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        line-height: 1;
    }

    /* CBU visual helpers in mobile */
    .cb-logo {
        width: 26px;
        height: 26px;
        object-fit: contain;
    }

    .rate-line {
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        gap: 6px;
    }
}

/* Utility: keep small table fonts consistent */
.table-small-compact {
    font-size: 0.9rem;
}

/* Dark theme overrides for mobile filter/cards */
[data-bs-theme="dark"] .mobile-card {
    background: #1a2537;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

[data-bs-theme="dark"] .mobile-label {
    color: rgba(255, 255, 255, 0.75);
}

[data-bs-theme="dark"] .mobile-segment {
    background: #1f2a3d;
}

[data-bs-theme="dark"] .segment-btn {
    color: rgba(255, 255, 255, 0.7);
}

[data-bs-theme="dark"] .segment-btn.active {
    background: #24314a;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

[data-bs-theme="dark"] .rate-line {
    color: rgba(255, 255, 255, 0.85);
}

/* Dark theme: sorting button text colors */
[data-bs-theme="dark"] .tab-content .btn-group .btn.btn-outline-primary {
    color: rgba(255, 255, 255, 0.85);
    border-color: var(--bs-primary);
}

[data-bs-theme="dark"] .tab-content .btn-group .btn.btn-outline-primary.active {
    color: #fff;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Dark theme: mobile rates table header */
[data-bs-theme="dark"] .mobile-rates-head {
    --bs-table-bg: var(--bs-primary);
    --bs-table-color: #fff;
}
