/**
 * The Yield Room - Deals Styles
 * Updated with featured image hero support
 */

/* ========================================
   DEAL CARD
   ======================================== */

.deal-card {
    background: #111;
    border: 1px solid #1a1a1a;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s ease;
}

.deal-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #8a7340, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.deal-card:hover {
    border-color: #8a7340;
}

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

.deal-card--closed {
    opacity: 0.5;
}

.deal-card--closed:hover {
    border-color: #1a1a1a;
    opacity: 0.6;
}


/* ========================================
   CARD HERO / FEATURED IMAGE
   ======================================== */

.deal-card__hero {
    position: relative;
    width: 100%;
    height: 120px;
    background: #0a0a0a;
    overflow: hidden;
}

/* Darker overlay when no image - indicates image placeholder */
.deal-card__hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(10, 10, 10, 0.3) 0%,
        rgba(10, 10, 10, 0.7) 100%
    );
    z-index: 1;
}

/* Featured image */
.deal-card__hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* When image exists, adjust overlay for better contrast */
.deal-card__hero--has-image::before {
    background: linear-gradient(
        180deg,
        rgba(10, 10, 10, 0.2) 0%,
        rgba(10, 10, 10, 0.8) 100%
    );
}

/* No image placeholder pattern - subtle indication */
.deal-card__hero:not(.deal-card__hero--has-image) {
    background: 
        linear-gradient(135deg, #0a0a0a 25%, transparent 25%),
        linear-gradient(225deg, #0a0a0a 25%, transparent 25%),
        linear-gradient(45deg, #0a0a0a 25%, transparent 25%),
        linear-gradient(315deg, #0a0a0a 25%, #0d0d0d 25%);
    background-size: 20px 20px;
    background-color: #0d0d0d;
}

/* Logo positioned in hero */
.deal-card__logo {
    position: absolute;
    bottom: 1rem;
    left: 1.25rem;
    width: 48px;
    height: 48px;
    background: rgba(17, 17, 17, 0.95);
    border: 1px solid #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    color: #888;
    z-index: 2;
    backdrop-filter: blur(4px);
}

/* Status badge positioned in hero */
.deal-card__status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.3rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.deal-card__status--live {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.deal-card__status--live::before {
    content: '';
    width: 5px;
    height: 5px;
    background: #4ade80;
    border-radius: 50%;
    animation: tyrPulse 2s infinite;
}

.deal-card__status--closing {
    color: #fb923c;
    background: rgba(251, 146, 60, 0.15);
    border: 1px solid rgba(251, 146, 60, 0.2);
}

.deal-card__status--closed {
    color: #555;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid #1a1a1a;
}

@keyframes tyrPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


/* ========================================
   CARD BODY
   ======================================== */

.deal-card__body {
    padding: 1rem 1.5rem 1rem;
    flex: 1;
}

.deal-card__name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem;
    font-weight: 400;
    color: #e8e8e8;
    margin-bottom: 0.35rem;
}

.deal-card__tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.deal-card__tag {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #555;
    background: #0a0a0a;
    padding: 0.25rem 0.5rem;
    border: 1px solid #1a1a1a;
}

.deal-card__timing {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.deal-card__timing strong {
    color: #cb9c3f;
    font-weight: 400;
}


/* ========================================
   CARD METRICS
   ======================================== */

.deal-card__metrics {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid #1a1a1a;
}

.deal-card__metric {
    display: flex;
    flex-direction: column;
}

.deal-card__metric-label {
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 0.15rem;
}

.deal-card__metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #e8e8e8;
}

.deal-card__metric-value--verified {
    color: #4ade80;
}


/* ========================================
   CARD FOOTER
   ======================================== */

.deal-card__footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #1a1a1a;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.deal-card__btn {
    display: block;
    flex: 1;
    padding: 0.8rem;
    background: transparent;
    border: 1px solid #1a1a1a;
    color: #888;
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.deal-card__btn:hover {
    background: #cb9c3f;
    border-color: #cb9c3f;
    color: #0a0a0a !important;
}

.deal-card__btn--disabled {
    pointer-events: none;
    opacity: 0.5;
}


/* ========================================
   WATCHLIST BUTTON (IN CARD)
   ======================================== */

.deal-card__footer .deal-card__watchlist {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 42px;
    height: 42px;
    background: transparent;
    border: 1px solid #1a1a1a;
    color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.deal-card__watchlist:hover,
.deal-card__watchlist.is-saved {
    border-color: #cb9c3f;
    color: #cb9c3f;
}

.deal-card__watchlist .icon-saved {
    display: none;
}

.deal-card__watchlist.is-saved .icon-unsaved {
    display: none;
}

.deal-card__watchlist.is-saved .icon-saved {
    display: block;
}

.deal-card__watchlist.is-loading {
    opacity: 0.5;
    pointer-events: none;
}


/* ========================================
   DEALS GRID
   ======================================== */

.deals-section {
    margin: 2rem 0;
}

.deals-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #1a1a1a;
}

.deals-title {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #cb9c3f;
}

.deals-count {
    font-size: 0.7rem;
    color: #555;
}

.deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}


/* ========================================
   EMPTY STATES
   ======================================== */

.deals-empty {
    text-align: center;
    padding: 3rem;
    color: #888;
    font-size: 0.9rem;
    background: #111;
    border: 1px solid #1a1a1a;
}

.deals-empty a {
    color: #cb9c3f;
}

.deals-empty--watchlist {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.deals-empty--watchlist svg {
    color: #333;
    margin-bottom: 1rem;
}

.deals-empty--watchlist .subtext {
    color: #555;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}


/* ========================================
   STANDALONE WATCHLIST BUTTON
   ======================================== */

.tyr-watchlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: 1px solid #1a1a1a;
    color: #888;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.tyr-watchlist-btn:hover {
    border-color: #cb9c3f;
    color: #cb9c3f;
}

.tyr-watchlist-btn .icon-saved,
.tyr-watchlist-btn .text-saved {
    display: none;
}

.tyr-watchlist-btn.is-saved {
    border-color: #cb9c3f;
    color: #cb9c3f;
}

.tyr-watchlist-btn.is-saved .icon-unsaved,
.tyr-watchlist-btn.is-saved .text-unsaved {
    display: none;
}

.tyr-watchlist-btn.is-saved .icon-saved,
.tyr-watchlist-btn.is-saved .text-saved {
    display: inline;
}

.tyr-watchlist-btn.is-loading {
    opacity: 0.5;
    pointer-events: none;
}


/* ========================================
   RECENTLY VIEWED
   ======================================== */

.recently-viewed {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recently-viewed li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #1a1a1a;
}

.recently-viewed li:last-child {
    border-bottom: none;
}

.recently-viewed a {
    color: #e8e8e8;
    text-decoration: none;
    font-size: 0.9rem;
}

.recently-viewed a:hover {
    color: #cb9c3f;
}

.recently-viewed .time-ago {
    font-size: 0.75rem;
    color: #555;
}


/* ========================================
   DEAL VIEWS
   ======================================== */

.deal-views-today {
    font-size: 0.75rem;
    color: #888;
}


/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 600px) {
    .deals-grid {
        grid-template-columns: 1fr;
    }
    
    .deals-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .deal-card__hero {
        height: 100px;
    }
    
    .deal-card__logo {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        bottom: 0.75rem;
        left: 1rem;
    }
    
    .deal-card__body,
    .deal-card__footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .deal-card__metrics {
        gap: 1rem;
    }
}