﻿/* =============================================
   Edition Wishlists Tab Styles
   Mirrors iOS EditionWishlists / WishesTab
   ============================================= */

/* ─────────────────────────────────────────────
   Container
   ───────────────────────────────────────────── */
.edition-wishlists {
    padding: 8px 0 0;
}

/* ─────────────────────────────────────────────
   Action Bar (My Wishlist / Create Wishlist)
   ───────────────────────────────────────────── */
.ew-actions {
    margin-bottom: 20px;
}

.ew-action-form {
    width: 100%;
}

.ew-action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 12px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-br);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: inherit;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

    .ew-action-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    }

    .ew-action-card:active {
        transform: scale(0.99);
    }

/* Highlighted variant (Create) */
.ew-action-card--highlight {
    border-color: rgba(52, 199, 89, 0.3);
}

    .ew-action-card--highlight:hover {
        border-color: rgba(52, 199, 89, 0.5);
    }

/* Action icon circles */
.ew-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ew-action-card:hover .ew-action-icon {
    transform: scale(1.05);
}

.ew-action-icon--blue {
    background: var(--glass-bg);
    color: var(--primary);
}

    .ew-action-icon--blue svg {
        stroke: var(--primary);
    }

.ew-action-icon--green {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.9), #34C759);
    color: #fff;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}

    .ew-action-icon--green svg {
        stroke: #fff;
    }

.ew-action-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
}

.ew-action-chevron {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.ew-tip {
    margin: 12px 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ─────────────────────────────────────────────
   Participants List
   ───────────────────────────────────────────── */
.ew-participants {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ew-participant {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-br);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
}

    .ew-participant:hover {
        transform: translateX(4px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
        border-color: var(--primary);
    }

    .ew-participant:active {
        transform: scale(0.99);
    }

/* Avatar */
.ew-participant-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border);
    flex-shrink: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-secondary);
}

    .ew-participant-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* Info */
.ew-participant-info {
    flex: 1;
    min-width: 0;
}

.ew-participant-name {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ew-you-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5AC8FA, #FF9500);
    color: #fff;
}

.ew-participant-status {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action buttons */
.ew-participant-action {
    flex-shrink: 0;
}

.ew-chat-btn,
.ew-follow-btn {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.ew-chat-btn {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.ew-participant:hover .ew-chat-btn {
    background: var(--primary);
    color: #fff;
}

.ew-follow-btn {
    background: var(--primary);
    color: #fff;
    border: 1.5px solid var(--primary);
}

.ew-participant:hover .ew-follow-btn {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Footer note */
.ew-footer-note {
    margin: 20px 0 0;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

.ew-no-others {
    margin: 24px 0;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* ─────────────────────────────────────────────
   Wishes View (Selected Instance)
   ───────────────────────────────────────────── */
.ew-wishes-view {
    animation: fadeSlideIn 0.25s ease;
}

.ew-wish-add-form {
    margin: 0;
    border: 0;
    padding: 0;
    background: none;
}

.ew-wish-add-btn {
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    background: none;
    cursor: pointer;
    text-align: inherit;
}

    .ew-wish-add-btn:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: 2px;
    }

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Header with back button */
.ew-wishes-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ew-back-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: var(--glass-bg);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

    .ew-back-btn:hover {
        background: var(--border);
    }

    .ew-back-btn:active {
        transform: scale(0.95);
    }

.ew-wishes-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
}

.ew-settings-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--primary);
    text-decoration: none;
    transition: background 0.15s ease;
}

    .ew-settings-link:hover {
        background: var(--glass-bg);
    }

/* Filter bar */
.ew-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    margin-bottom: 16px;
}

.ew-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.ew-filter-dropdown {
    position: relative;
}

.ew-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(0, 122, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .ew-filter-btn:hover {
        background: rgba(0, 122, 255, 0.15);
    }

.ew-filter-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    padding: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    z-index: 50;
}

    .ew-filter-menu[hidden] {
        display: none;
    }

.ew-filter-option {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s ease;
}

    .ew-filter-option:hover {
        background: var(--bg);
    }

    .ew-filter-option.active {
        background: var(--primary);
        color: #fff;
    }

/* ─────────────────────────────────────────────
   Wishes Grid
   ───────────────────────────────────────────── */
.ew-wishes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px;
}

@media (min-width: 768px) {
    .ew-wishes-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 18px;
    }
}

/* Wish card */
.ew-wish-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

    .ew-wish-card:hover {
        transform: translateY(-4px);
    }

    .ew-wish-card:active {
        transform: scale(0.98);
    }

    .ew-wish-card.is-received {
        opacity: 0.6;
    }

/* Image container */
.ew-wish-image {
    position: relative;
    aspect-ratio: 1;
    background: var(--border);
    border-radius: 12px;
    overflow: hidden;
}

    .ew-wish-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.ew-wish-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

/* Status badges */
.ew-wish-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ew-wish-badge--reserved {
    background: var(--success);
    color: #fff;
}

.ew-wish-badge--received {
    background: var(--primary);
    color: #fff;
}

/* Wish info */
.ew-wish-info {
    padding: 10px 4px 4px;
}

.ew-wish-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ew-wish-title--add {
    color: var(--text-secondary);
    text-align: center;
}

.ew-wish-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 4px;
}

/* Add wish tile */
.ew-wish-add .ew-wish-image {
    border: 2px dashed var(--border);
    background: transparent;
}

.ew-add-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.ew-wish-add:hover .ew-wish-image {
    border-color: var(--primary);
    background: rgba(0, 122, 255, 0.05);
}

/* ─────────────────────────────────────────────
   Empty State
   ───────────────────────────────────────────── */
.ew-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 24px;
}

.ew-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.ew-empty h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
}

.ew-empty p {
    margin: 0 0 24px;
    color: var(--text-secondary);
    max-width: 300px;
}

.ew-empty .btn {
    margin-bottom: 16px;
}

.ew-empty-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.ew-auth-actions {
    margin-bottom: 24px;
}

.ew-app-promo {
    margin-top: 12px;
}

    .ew-app-promo .store-badge img {
        height: 44px;
        opacity: 0.9;
        transition: opacity 0.2s;
    }

        .ew-app-promo .store-badge img:hover {
            opacity: 1;
        }

/* ─────────────────────────────────────────────
   Auth Banner (for unauthenticated users)
   ───────────────────────────────────────────── */
.ew-auth-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.08), rgba(52, 199, 89, 0.06));
    border: 1px solid rgba(0, 122, 255, 0.15);
    border-radius: 14px;
}

.ew-auth-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ew-auth-banner-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.ew-auth-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

    .ew-auth-banner-text strong {
        font-size: 15px;
        font-weight: 600;
    }

    .ew-auth-banner-text span {
        font-size: 13px;
        color: var(--text-secondary);
    }

.ew-auth-banner .btn {
    flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   Footer CTA (after participants list)
   ───────────────────────────────────────────── */
.ew-footer-cta {
    margin-top: 24px;
    padding: 20px;
    text-align: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-br);
    border-radius: 16px;
}

    .ew-footer-cta p {
        margin: 0 0 16px;
        font-size: 15px;
        color: var(--text-secondary);
    }

.ew-footer-cta-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

    .ew-footer-cta-actions .store-badge img {
        height: 40px;
        opacity: 0.85;
        transition: opacity 0.2s;
    }

    .ew-footer-cta-actions .store-badge:hover img {
        opacity: 1;
    }

/* ─────────────────────────────────────────────
   Wishes CTA (after wishes grid)
   ───────────────────────────────────────────── */
.ew-wishes-cta {
    margin-top: 24px;
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.06), rgba(52, 199, 89, 0.04));
    border: 1px solid rgba(0, 122, 255, 0.12);
    border-radius: 14px;
}

    .ew-wishes-cta p {
        margin: 0 0 12px;
        font-size: 14px;
        color: var(--text-secondary);
    }

/* ─────────────────────────────────────────────
   View chevron (for unauthenticated users)
   ───────────────────────────────────────────── */
.ew-view-chevron {
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   Dark Mode Adjustments
   ───────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .ew-action-icon--blue {
        background: rgba(0, 122, 255, 0.15);
    }

    .ew-filter-btn {
        background: rgba(0, 122, 255, 0.2);
    }

        .ew-filter-btn:hover {
            background: rgba(0, 122, 255, 0.3);
        }

    .ew-filter-menu {
        background: var(--glass-bg);
        border-color: var(--glass-br);
    }

    .ew-wish-add .ew-wish-image {
        border-color: rgba(255, 255, 255, 0.15);
    }

    .ew-wish-add:hover .ew-wish-image {
        border-color: var(--primary);
        background: rgba(0, 122, 255, 0.1);
    }

    /* Auth banner dark */
    .ew-auth-banner {
        background: linear-gradient(135deg, rgba(0, 122, 255, 0.12), rgba(52, 199, 89, 0.08));
        border-color: rgba(0, 122, 255, 0.25);
    }

    /* Footer CTA dark */
    .ew-footer-cta {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.08);
    }

    /* Wishes CTA dark */
    .ew-wishes-cta {
        background: linear-gradient(135deg, rgba(0, 122, 255, 0.1), rgba(52, 199, 89, 0.06));
        border-color: rgba(0, 122, 255, 0.2);
    }
}

/* ─────────────────────────────────────────────
   Mobile Adjustments
   ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .ew-action-card {
        padding: 10px 14px;
        gap: 12px;
    }

    .ew-action-icon {
        width: 44px;
        height: 44px;
    }

        .ew-action-icon svg {
            width: 22px;
            height: 22px;
        }

    .ew-action-title {
        font-size: 15px;
    }

    .ew-participant {
        padding: 12px 14px;
        gap: 12px;
    }

    .ew-participant-avatar {
        width: 44px;
        height: 44px;
    }

    .ew-participant-name {
        font-size: 14px;
    }

    .ew-participant-status {
        font-size: 12px;
    }

    .ew-wishes-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .ew-wish-title {
        font-size: 13px;
    }

    .ew-wish-price {
        font-size: 13px;
    }

    .ew-wishes-title {
        font-size: 18px;
    }

    /* Auth banner mobile */
    .ew-auth-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 16px;
    }

        .ew-auth-banner .btn {
            width: 100%;
            justify-content: center;
        }

    .ew-auth-banner-text strong {
        font-size: 14px;
    }

    .ew-auth-banner-text span {
        font-size: 12px;
    }

    /* Footer CTA mobile */
    .ew-footer-cta {
        padding: 16px;
    }

        .ew-footer-cta p {
            font-size: 14px;
        }

    .ew-footer-cta-actions .btn {
        width: 100%;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .ew-wishes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}