/* ═══════════════════════════════════════════════════════
   Deals List Page – my-deals.css
   Extends CryptoVault design system (style.css)
════════════════════════════════════════════════════════ */

/* ─── DEALS PAGE LAYOUT ─────────────────────────────── */
.deals-page {
    min-height: calc(100vh - var(--nav-h));
    padding: calc(var(--nav-h) + 3rem) var(--section-px) 4rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.deals-inner {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ─── HEADER ────────────────────────────────────────── */
.deals-header {
    text-align: center;
    padding-bottom: 0.5rem;
}

.deals-title {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--white);
    margin: 0.6rem 0 0.4rem;
}

.deals-subtitle {
    font-size: 0.9375rem;
    color: var(--white-50);
    line-height: 1.6;
}

/* ─── CONNECT PANEL ─────────────────────────────────── */
.deals-connect-panel {
    background: rgba(20, 20, 26, 0.8);
    border: 1px solid rgba(245, 245, 247, 0.10);
    border-radius: var(--radius-xl);
    padding: 3.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    backdrop-filter: blur(24px);
    position: relative;
    overflow: hidden;
    animation: panelIn 0.35s var(--ease-out) both;
}

.deals-connect-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 151, 58, 0.4), transparent);
}

.deals-connect-panel__icon {
    width: 72px;
    height: 72px;
    background: var(--gold-subtle);
    border: var(--border-gold);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-light);
    margin-bottom: 0.5rem;
}

.deals-connect-panel__title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--white);
}

.deals-connect-panel__desc {
    font-size: 0.9rem;
    color: var(--white-50);
    line-height: 1.65;
    max-width: 400px;
    margin-bottom: 0.5rem;
}

/* ─── WALLET BAR (connected state) ─────────────────── */
.deals-wallet-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(20, 20, 26, 0.6);
    border: 1px solid rgba(245, 245, 247, 0.08);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1.25rem;
    backdrop-filter: blur(16px);
    animation: panelIn 0.3s var(--ease-out) both;
    flex-wrap: wrap;
}

.deals-wallet-bar__actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* ─── FILTER TABS ───────────────────────────────────── */
.deals-filters {
    display: flex;
    align-items: center;
    gap: 0;
    animation: panelIn 0.3s var(--ease-out) both;
}

.deals-filters__tabs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(20, 20, 26, 0.7);
    border: 1px solid rgba(245, 245, 247, 0.08);
    border-radius: var(--radius-lg);
    padding: 0.3rem;
    flex-wrap: wrap;
    width: 100%;
}

.deals-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--white-40);
    transition: all var(--transition-fast);
    cursor: pointer;
    flex: 1;
    justify-content: center;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.deals-filter-tab:hover {
    color: var(--white-80);
    background: var(--white-05);
}

.deals-filter-tab--active {
    background: var(--dark-4);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.deals-filter-tab__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: var(--white-10);
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--white-60);
    transition: all var(--transition-fast);
}

.deals-filter-tab--active .deals-filter-tab__count {
    background: var(--gold-subtle);
    color: var(--gold-light);
    border: 1px solid var(--gold-border);
}

/* ─── LIST WRAP ─────────────────────────────────────── */
.deals-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ─── LOADING ────────────────────────────────────────── */
.deals-loading {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 3rem;
    text-align: center;
}

.deals-loading__text {
    font-size: 0.875rem;
    color: var(--white-40);
}

.deals-skeleton {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.deals-skeleton__row {
    height: 100px;
    background: linear-gradient(90deg,
        rgba(245, 245, 247, 0.04) 0%,
        rgba(245, 245, 247, 0.08) 50%,
        rgba(245, 245, 247, 0.04) 100%
    );
    background-size: 200% 100%;
    border-radius: var(--radius-lg);
    animation: shimmer 1.6s ease-in-out infinite;
}

.deals-skeleton__row:nth-child(2) { animation-delay: 0.15s; }
.deals-skeleton__row:nth-child(3) { animation-delay: 0.30s; opacity: 0.7; }

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── EMPTY STATE ───────────────────────────────────── */
.deals-empty {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 2rem;
    text-align: center;
    background: rgba(20, 20, 26, 0.6);
    border: 1px dashed rgba(245, 245, 247, 0.12);
    border-radius: var(--radius-xl);
    animation: panelIn 0.35s var(--ease-out) both;
}

.deals-empty__icon {
    color: var(--white-20);
    margin-bottom: 0.5rem;
}

.deals-empty__title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white-60);
}

.deals-empty__desc {
    font-size: 0.875rem;
    color: var(--white-30);
    line-height: 1.65;
    max-width: 360px;
    margin-bottom: 0.5rem;
}

/* ─── DEALS GRID ────────────────────────────────────── */
.deals-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* ─── DEAL CARD ─────────────────────────────────────── */
.deal-card {
    background: rgba(20, 20, 26, 0.8);
    border: 1px solid rgba(245, 245, 247, 0.10);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    animation: panelIn 0.35s var(--ease-out) both;
}

.deal-card::before {
    content: '';
    position: absolute;
    top: 0; left: 8%; right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 151, 58, 0.3), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.deal-card:hover {
    background: rgba(24, 24, 32, 0.95);
    border-color: rgba(245, 245, 247, 0.16);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 30px rgba(201, 151, 58, 0.06);
}

.deal-card:hover::before {
    opacity: 1;
}

/* Card Header Row */
.deal-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.deal-card__date {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--white-30);
    letter-spacing: 0.02em;
}

/* Status Badge */
.deal-card__status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--white-05);
    border: 1px solid var(--white-10);
    color: var(--white-50);
}

.deal-card__status-badge--open {
    background: rgba(52, 201, 122, 0.08);
    border-color: rgba(52, 201, 122, 0.3);
    color: var(--green);
}

.deal-card__status-badge--executed {
    background: var(--gold-subtle);
    border-color: var(--gold-border);
    color: var(--gold-light);
}

.deal-card__status-badge--cancelled {
    background: var(--red-subtle);
    border-color: rgba(232, 64, 64, 0.3);
    color: #f08080;
}

.deal-card__status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.deal-card__status-badge--open .deal-card__status-dot {
    animation: pulse-dot 2s ease-in-out infinite;
    box-shadow: 0 0 6px currentColor;
}

/* Network badge */
.deal-card__network {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    background: var(--white-05);
    border: 1px solid var(--white-10);
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--white-40);
    letter-spacing: 0.03em;
}

/* ─── TRADE DISPLAY ─────────────────────────────────── */
.deal-card__trade {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    background: rgba(10, 10, 14, 0.5);
    border: 1px solid rgba(245, 245, 247, 0.06);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
}

.deal-card__token {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.deal-card__token--buy {
    flex-direction: row-reverse;
    text-align: right;
}

.deal-card__token--buy .deal-card__token-info {
    align-items: flex-end;
}

.deal-card__token-icon-wrap {
    flex-shrink: 0;
    position: relative;
}

.deal-card__token-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.deal-card__token-fallback {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dark-4);
    border: 1px solid var(--gold-border);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.03em;
}

.deal-card__token-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.deal-card__token-amount {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
    letter-spacing: -0.02em;
}

.deal-card__token-symbol {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.deal-card__token-name {
    font-size: 0.7rem;
    color: var(--white-30);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.deal-card__arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--gold-light);
    opacity: 0.7;
    flex-shrink: 0;
}

.deal-card__rate {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--white-30);
    white-space: nowrap;
    letter-spacing: 0.04em;
}

/* ─── META ROW ──────────────────────────────────────── */
.deal-card__meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.deal-card__meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.deal-card__meta-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--white-30);
}

.deal-card__meta-value {
    font-size: 0.8rem;
    color: var(--white-60);
}

.deal-card__meta-value--mono {
    font-family: 'Courier New', 'Lucida Console', monospace;
    font-size: 0.75rem;
}

/* ─── CARD ACTIONS ──────────────────────────────────── */
.deal-card__actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(245, 245, 247, 0.05);
}

.deal-card__manage-btn {
    flex: 1;
    justify-content: center;
    min-width: 140px;
}

.deal-card__copy-btn {
    flex-shrink: 0;
}

/* ─── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 600px) {
    .deals-page {
        padding-top: calc(var(--nav-h) + 1.5rem);
    }

    .deal-card__trade {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .deal-card__token--buy {
        flex-direction: row;
        text-align: left;
    }

    .deal-card__token--buy .deal-card__token-info {
        align-items: flex-start;
    }

    .deal-card__arrow {
        flex-direction: row;
        justify-content: center;
        transform: rotate(90deg);
    }

    .deal-card__rate {
        transform: rotate(-90deg);
    }

    .deals-filter-tab {
        padding: 0.45rem 0.65rem;
        font-size: 0.75rem;
    }

    .deal-card__actions {
        flex-direction: column;
    }

    .deal-card__manage-btn,
    .deal-card__copy-btn {
        width: 100%;
        justify-content: center;
    }

    .deals-wallet-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .deals-wallet-bar__actions {
        width: 100%;
    }

    .deals-wallet-bar__actions .btn {
        flex: 1;
        justify-content: center;
    }
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}