/* dashstyle/components.css */

/* --- Typography Helpers --- */
h1, h2, h3, h4 { color: var(--text-main); }
.text-muted { color: var(--text-muted); }
.text-bold { font-weight: 600; }
.text-small { font-size: 11px; }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-danger); }
.text-center { text-align: center; }

/* --- Buttons --- */
.btn-action {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    background: transparent;
    color: var(--text-main);
}
.btn-action:hover { background: var(--bg-hover); }

.btn-primary {
    background: var(--text-main);
    color: var(--text-inverse);
}
.btn-primary:hover {
    background: var(--color-primary);
    color: white;
}

.btn-close-square {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-body);
    border: none; border-radius: 8px;
    cursor: pointer; transition: 0.2s;
    color: var(--text-main);
}
.btn-close-square:hover { background: var(--bg-hover); }

.btn-drawer-primary {
    width: 100%;
    background: var(--text-main);
    color: var(--text-inverse);
    padding: 16px;
    border-radius: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
    margin-top: 20px;
}
.btn-drawer-primary:hover { background: var(--color-primary); }
.btn-drawer-primary i { color: inherit; }

.btn-drawer-delete {
    width: 100%;
    background: var(--bg-hover);
    color: var(--text-muted);
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px dashed var(--border-dashed);
    margin-top: 12px;
    cursor: not-allowed;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* --- Note Toggle Button --- */
.btn-text-small {
    background: transparent;
    border: none;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-text-small:hover {
    color: var(--color-primary-hover);
    transform: translateX(2px);
}

.btn-text-small i {
    font-size: 10px;
}

/* --- Note Input Wrapper --- */
#note-wrapper {
    margin-top: 10px;
    position: relative;
    animation: fadeIn 0.3s ease;
}

/* Button to remove the note (Red X) */
.btn-remove-note {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.btn-remove-note:hover {
    color: var(--color-danger);
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card-settings { max-width: 500px; }

/* --- Inputs --- */
.input-group { margin-bottom: 20px; }
.label-text { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-main); }

.std-input, .std-select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-main);
    outline: none;
    transition: 0.2s;
}
.std-input:focus, .std-select:focus { border-color: var(--color-primary); }

.input-with-icon-wrapper { position: relative; }
.input-icon-symbol { position: absolute; left: 15px; top: 12px; color: var(--text-muted); }
.std-input.has-icon { padding-left: 30px; }

/* --- Toggle --- */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    background: #3a3a3a;          /* track */
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    transition: 180ms ease;
}

.slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    background: #e7e7e7;          /* knob */
    border-radius: 999px;
    transition: 180ms ease;
}

.switch input:checked + .slider {
    background: #3b82f6;          /* your “on” color */
}

.switch input:checked + .slider::before {
    transform: translate(20px, -50%);
}

/* --- Hero Wallet Widget --- */
.hero-wallet {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 35px 45px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    position: relative; overflow: hidden;
}
.hero-wallet::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--color-primary) 0%, #60A5FA 100%);
}

.wallet-balance-group { display: flex; flex-direction: column; gap: 5px; }
.wallet-label {
    font-size: 14px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px;
    display: flex; align-items: center; gap: 8px;
}
.wallet-amount { font-size: 56px; font-weight: 800; color: var(--text-main); letter-spacing: -2px; line-height: 1; }

.salary-action-group {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 20px 25px;
    border-radius: 16px;
    display: flex; align-items: center; gap: 25px;
}
.job-details { display: flex; flex-direction: column; text-align: right; }
.job-title { font-size: 14px; font-weight: 700; color: var(--text-main); }
.job-rate { font-size: 13px; color: var(--text-muted); }
.salary-val { color: var(--color-success); font-weight: 700; }
.salary-timer { font-size: 11px; color: var(--color-danger); font-weight: 600; display: none; }

.btn-claim-hero {
    background: var(--text-main); color: var(--bg-card);
    border: none; padding: 12px 28px; border-radius: 12px;
    font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.btn-claim-hero:hover:not(:disabled) {
    background: var(--color-primary); color: white;
    transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}
.btn-claim-hero:disabled {
    background: var(--border-dashed); cursor: not-allowed;
    box-shadow: none; transform: none;
}

@media (max-width: 768px) {
    .hero-wallet { flex-direction: column; align-items: flex-start; gap: 25px; }
    .salary-action-group { width: 100%; justify-content: space-between; }
    .job-details { text-align: left; }
    .wallet-amount { font-size: 42px; }
}

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; margin-top: 15px; }
th { text-align: left; padding: 12px; border-bottom: 2px solid var(--border-color); color: var(--text-muted); font-size: 13px; }
td { padding: 16px 12px; border-bottom: 1px solid var(--border-color); font-size: 14px; color: var(--text-main); vertical-align: middle; }

/* --- Unified Transaction Table --- */
/* --- Transaction Table Updates --- */
.transaction-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    table-layout: fixed;
}

.transaction-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}
.transaction-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.transaction-table th {
    text-align: left; /* Default headers to left */
    padding: 12px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.transaction-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-main);
    vertical-align: middle;
    text-align: left; /* Default cells to left */
}

/* --- Column Specifics --- */

.col-desc { width: 45%; }
.desc-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

.col-date {
    width: 25%;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 13px;
}

/* CHANGED: Amount is now Left Aligned to match header and prevent "floating" */
.col-amount {
    width: 20%;
    text-align: left;
    white-space: nowrap;
    font-weight: 600;
}

.col-status {
    width: 10%;
    text-align: right; /* Keep status right-aligned as a pill */
}
/* Ensure Status Header matches the Right alignment */
th.col-status {
    text-align: right;
}

/* Colors */
.text-amount-pos { color: var(--color-success) !important; }
.text-amount-neg { color: var(--color-danger) !important; }

/* Mobile Tweaks */
@media (max-width: 768px) {
    .col-date { display: none; } /* Hide date on mobile to save space */
    .col-desc { width: 60%; }
    .col-amount { width: 25%; }
    .col-status { width: 15%; }
}



/* --- Account Lists --- */
.account-list-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px; border: 1px solid var(--border-color);
    border-radius: 12px; margin-bottom: 10px; transition: 0.2s; cursor: pointer;
    background: var(--bg-card);
}
.account-list-item:hover { background: var(--bg-hover); }
.account-list-item.frozen { opacity: 0.6; }
.empty-state-container { display: none; text-align: center; padding: 40px; }
.empty-state-icon { font-size: 48px; color: var(--border-color); margin-bottom: 20px; }

/* --- Tabs --- */
.tab-group { display: flex; background: var(--bg-body); padding: 4px; border-radius: 12px; margin-bottom: 25px; }
.tab-btn {
    flex: 1; padding: 12px; border: none; background: transparent;
    font-weight: 600; color: var(--text-muted); cursor: pointer;
    border-radius: 8px; transition: 0.2s;
}
.tab-btn.active { background: var(--bg-card); color: var(--text-main); box-shadow: var(--shadow-sm); }

.sub-tabs { display: flex; gap: 15px; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.sub-tab-link {
    padding-bottom: 10px; cursor: pointer; font-size: 13px; font-weight: 600;
    color: var(--text-muted); border-bottom: 2px solid transparent;
}
.sub-tab-link.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* --- Tax/Option Cards --- */
.tax-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.tax-card {
    border: 2px solid var(--border-color); border-radius: 12px;
    padding: 10px; cursor: pointer; transition: 0.2s; position: relative;
    background: var(--bg-card);
}
.tax-card:hover { border-color: var(--border-dashed); }
.tax-card.selected { border-color: var(--color-primary); background: var(--bg-highlight); }
.check-icon {
    position: absolute; top: 10px; right: 10px;
    color: var(--color-primary); opacity: 0; transform: scale(0.5); transition: 0.2s;
}
.tax-card.selected .check-icon { opacity: 1; transform: scale(1); }

/* --- Receipt Panel --- */
.receipt-panel {
    background: var(--receipt-bg); color: var(--receipt-text);
    border-radius: 24px; padding: 30px; display: flex; flex-direction: column;
}
.receipt-header { border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px; margin-bottom: 20px; }
.receipt-row { display: flex; justify-content: space-between; margin-bottom: 15px; font-size: 14px; color: inherit; }
.receipt-row.total { margin-top: auto; padding-top: 5px; color: white; font-weight: 700; font-size: 18px; }
.big-amount { font-size: 42px; font-weight: 700; color: white; margin: 10px 0; letter-spacing: -1px; }

/* --- Gift Card Code Box --- */
.code-display-box {
    margin-top: 20px; display: none;
    background: var(--code-bg); border: 1px solid var(--code-border);
    padding: 15px; border-radius: 8px; text-align: center;
}
.code-label { color: var(--code-text); display: block; margin-bottom: 10px; }
.code-value {
    font-family: 'Monaco', monospace; font-size: 24px;
    letter-spacing: 2px; color: var(--code-text); margin: 0;
}
.btn-copy-mini {
    background: var(--code-border); border: none; color: white;
    width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: 0.2s;
}

/* --- Drawers --- */
.drawer-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px);
    display: none; justify-content: flex-end; z-index: 1000;
}
.drawer-content {
    width: 100%; max-width: 400px; height: 100%;
    background: var(--bg-card); box-shadow: -10px 0 40px rgba(0,0,0,0.1);
    padding: 40px; display: flex; flex-direction: column;
    animation: slideIn 0.3s ease-out; position: relative; overflow: hidden;
}
.drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.single-info-card {
    background: var(--bg-sidebar); color: white;
    padding: 24px; border-radius: 20px; margin-bottom: 25px;
    box-shadow: var(--shadow-md);
}
.acc-bal { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.copyable-text { cursor: pointer; transition: opacity 0.2s; }
.copyable-text:hover { opacity: 0.7; }
.uuid-small { font-family: 'Monaco', monospace; font-size: 11px; color: #94A3B8; margin-top: 15px; word-break: break-all; display: block; }
.pin-input { letter-spacing: 8px; text-align: center; font-size: 18px; }

@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* --- Toasts (FIXED) --- */
#copy-toast {
    position: fixed; /* Fixed here too */
    bottom: 20px; left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-success); color: white;
    padding: 8px 16px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1100; pointer-events: none;
}
#copy-toast.show { transform: translateX(-50%) translateY(0); }

#global-toast {
    position: fixed; /* FIXED: Use fixed to prevent layout push */
    bottom: 30px; left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px; border-radius: 50px;
    font-size: 14px; font-weight: 600; color: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000; pointer-events: none;
    display: flex; align-items: center; gap: 10px;
    min-width: 300px; justify-content: center;
}
#global-toast.show { transform: translateX(-50%) translateY(0); }
.toast-success { background: var(--color-success); }
.toast-error { background: var(--color-danger); }

/* --- Status/Badges --- */
.status-msg { font-size: 12px; margin-top: 5px; height: 16px; }
.acc-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--bg-body); color: var(--text-muted);
    padding: 2px 6px; border-radius: 4px;
    font-size: 10px; font-family: 'Monaco', monospace;
    border: 1px solid var(--border-color); margin-bottom: 4px;
}

/* --- Grayedd out --- */
.is-coming-soon {
    position: relative;
    opacity: 0.55;
    filter: grayscale(0.35);
    pointer-events: none;   /* disables all clicks inside */
    user-select: none;
}

.coming-soon-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.85);
}