/**
 * Visual Account Selector Component CSS
 * Modern, card-based financial account picker with bank logos, live balance chips,
 * and high-end interactive states.
 */

.account-picker-wrapper {
    width: 100%;
    margin-bottom: 0.75rem;
}

/* Optional Quick Filter Toolbar */
.account-picker-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.account-picker-filter-tabs {
    display: inline-flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 9999px;
    gap: 2px;
}

.account-filter-tab {
    border: none;
    background: transparent;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    border-radius: 9999px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.account-filter-tab:hover {
    color: #1e293b;
}

.account-filter-tab.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.account-picker-search {
    position: relative;
    max-width: 200px;
    min-width: 140px;
}

.account-picker-search input {
    width: 100%;
    padding: 4px 10px 4px 28px;
    font-size: 0.8rem;
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-picker-search input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.account-picker-search i {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.8rem;
    pointer-events: none;
}

/* Card Grid Layout */
.account-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
    max-height: 480px;
    overflow-y: auto;
    padding: 2px 2px 6px 2px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.account-picker-grid::-webkit-scrollbar {
    width: 6px;
}
.account-picker-grid::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 9999px;
}

/* Compact Mode (Modals & Narrow Forms) */
.account-picker-grid.is-compact {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.5rem;
    max-height: 280px;
}

/* Account Card Tile */
.account-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0.95rem;
    border-radius: 0.875rem;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    text-align: left;
    outline: none;
}

.account-card:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 8px 18px -4px rgba(37, 99, 235, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
}

.account-card:focus-visible {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

/* Active / Selected State */
.account-card.is-selected {
    border-color: #2563eb;
    background: linear-gradient(to bottom, #ffffff 0%, #f0f7ff 100%);
    box-shadow: 0 0 0 2px #2563eb, 0 8px 20px -4px rgba(37, 99, 235, 0.18);
}

/* Special Auto Card */
.account-card.is-auto-card {
    border-style: dashed;
    border-width: 1.5px;
    background: #f8fafc;
}
.account-card.is-auto-card:hover {
    border-color: #818cf8;
    background: #f5f3ff;
}
.account-card.is-auto-card.is-selected {
    border-style: solid;
    border-color: #6366f1;
    background: linear-gradient(to bottom, #ffffff 0%, #eef2ff 100%);
    box-shadow: 0 0 0 2px #6366f1, 0 8px 20px -4px rgba(99, 102, 241, 0.18);
}

/* Account Avatar / Emblem */
.account-card-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.account-card-avatar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(0,0,0,0.05) 100%);
    pointer-events: none;
}

/* Bank Brand Palettes & Emblems */
.brand-cash {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}
.brand-ziraat {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
}
.brand-garanti {
    background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
}
.brand-isbank {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
}
.brand-yapikredi {
    background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 100%);
}
.brand-akbank {
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%);
}
.brand-vakifbank {
    background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
}
.brand-halkbank {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
}
.brand-qnb {
    background: linear-gradient(135deg, #701a75 0%, #c026d3 100%);
}
.brand-denizbank {
    background: linear-gradient(135deg, #075985 0%, #0284c7 100%);
}
.brand-enpara {
    background: linear-gradient(135deg, #581c87 0%, #a855f7 100%);
}
.brand-kuveyt {
    background: linear-gradient(135deg, #065f46 0%, #059669 100%);
}
.brand-pos {
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
}
.brand-cc {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}
.brand-auto {
    background: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 100%);
}
.brand-default {
    background: linear-gradient(135deg, #334155 0%, #64748b 100%);
}

.account-card-avatar .monogram {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Card Body Content */
.account-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.account-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    line-height: 1.25;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.account-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
}

.account-type-badge.type-cash {
    background: #d1fae5;
    color: #065f46;
}
.account-type-badge.type-bank {
    background: #dbeafe;
    color: #1e40af;
}
.account-type-badge.type-pos {
    background: #ede9fe;
    color: #5b21b6;
}
.account-type-badge.type-credit_card {
    background: #fef3c7;
    color: #92400e;
}
.account-type-badge.type-auto {
    background: #e0e7ff;
    color: #4338ca;
}

.account-currency-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
}

.account-card-balance {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
}

.account-card-balance .balance-lbl {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
}

.account-card-balance .balance-val {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
}

.account-card-balance .balance-val.is-positive {
    color: #059669;
}
.account-card-balance .balance-val.is-negative {
    color: #dc2626;
}

/* Card Selection Checkmark Indicator */
.account-card-indicator {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    border: 1.5px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 0.75rem;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
}

.account-card.is-selected .account-card-indicator {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    transform: scale(1.08);
}

.account-card.is-auto-card.is-selected .account-card-indicator {
    border-color: #6366f1;
    background: #6366f1;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

/* Compact Mode fine tuning */
.account-picker-grid.is-compact .account-card {
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
}
.account-picker-grid.is-compact .account-card-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 0.95rem;
    border-radius: 10px;
}
.account-picker-grid.is-compact .account-card-title {
    font-size: 0.84rem;
}
.account-picker-grid.is-compact .account-card-balance .balance-val {
    font-size: 0.8rem;
}

/* Empty state */
.account-picker-empty {
    padding: 1.5rem;
    text-align: center;
    color: #64748b;
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 1px dashed #cbd5e1;
    font-size: 0.85rem;
    grid-column: 1 / -1;
}

/* Dark mode overrides */
[data-bs-theme="dark"] .account-card {
    background: #1e293b;
    border-color: #334155;
}
[data-bs-theme="dark"] .account-card:hover {
    border-color: #60a5fa;
    background: #243047;
}
[data-bs-theme="dark"] .account-card.is-selected {
    border-color: #3b82f6;
    background: #1e3a5f;
    box-shadow: 0 0 0 2px #3b82f6;
}
[data-bs-theme="dark"] .account-card.is-auto-card {
    background: #172033;
}
[data-bs-theme="dark"] .account-card-title {
    color: #f8fafc;
}
[data-bs-theme="dark"] .account-card-balance .balance-val {
    color: #f1f5f9;
}
[data-bs-theme="dark"] .account-card-balance .balance-val.is-positive {
    color: #34d399;
}
[data-bs-theme="dark"] .account-picker-filter-tabs {
    background: #334155;
}
[data-bs-theme="dark"] .account-filter-tab.active {
    background: #1e293b;
    color: #60a5fa;
}
[data-bs-theme="dark"] .account-picker-search input {
    background: #1e293b;
    border-color: #475569;
    color: #f8fafc;
}

/* ── Unified Payment Channels (Tahsilat Kanalı Butonları) ─────────────── */
.payment-channel-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.payment-channel-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.15rem;
    border-radius: 0.75rem;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.payment-channel-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    color: #0f172a;
    transform: translateY(-1px);
}

.payment-channel-btn i {
    font-size: 1.15rem;
    transition: transform 0.15s ease;
}

.payment-channel-btn:hover i {
    transform: scale(1.1);
}

/* Active States for Channels */
.payment-channel-btn.channel-cash.active {
    border-color: #059669;
    background: #ecfdf5;
    color: #047857;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15), 0 2px 6px rgba(5, 150, 105, 0.1);
}

.payment-channel-btn.channel-bank.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), 0 2px 6px rgba(37, 99, 235, 0.1);
}

.payment-channel-btn.channel-pos.active {
    border-color: #7c3aed;
    background: #f5f3ff;
    color: #6d28d9;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15), 0 2px 6px rgba(124, 58, 237, 0.1);
}

.payment-channel-btn.channel-check.active {
    border-color: #d97706;
    background: #fffbeb;
    color: #b45309;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15), 0 2px 6px rgba(217, 119, 6, 0.1);
}

.payment-channel-btn.channel-card.active {
    border-color: #d97706;
    background: #fffbeb;
    color: #b45309;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15), 0 2px 6px rgba(217, 119, 6, 0.1);
}

.payment-channel-btn.channel-other.active {
    border-color: #475569;
    background: #f1f5f9;
    color: #1e293b;
    box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.15);
}

.channel-badge-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

/* Check / Cheque Information Box */
.cheque-details-box {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: 0.85rem;
    padding: 1.15rem;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.05);
}

[data-bs-theme="dark"] .payment-channel-btn {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}
[data-bs-theme="dark"] .payment-channel-btn:hover {
    background: #243047;
    border-color: #64748b;
    color: #f8fafc;
}
[data-bs-theme="dark"] .payment-channel-btn.channel-cash.active {
    background: #064e3b;
    border-color: #10b981;
    color: #a7f3d0;
}
[data-bs-theme="dark"] .payment-channel-btn.channel-bank.active {
    background: #1e3a5f;
    border-color: #3b82f6;
    color: #bfdbfe;
}
[data-bs-theme="dark"] .payment-channel-btn.channel-pos.active {
    background: #3b1d6e;
    border-color: #a855f7;
    color: #e9d5ff;
}
[data-bs-theme="dark"] .payment-channel-btn.channel-check.active,
[data-bs-theme="dark"] .payment-channel-btn.channel-card.active {
    background: #451a03;
    border-color: #f59e0b;
    color: #fef3c7;
}
[data-bs-theme="dark"] .cheque-details-box {
    background: #291d0e;
    border-color: #78350f;
    color: #fef3c7;
}
