/**
 * Grid Cell Popup Styles
 * Simple CSS popup for grid cell details (UI-010)
 */

/* Popup container */
.grid-cell-popup {
    position: fixed;
    z-index: 100;
    min-width: 280px;
    max-width: 360px;
    background-color: #1e293b; /* slate-800 */
    border: 1px solid #334155; /* slate-700 */
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: popup-fade-in 0.15s ease-out;
}

@keyframes popup-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Popup header */
.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #334155;
}

.popup-title {
    font-weight: 600;
    font-size: 1rem;
    color: #f1f5f9; /* slate-100 */
    flex: 1;
    margin-right: 0.5rem;
}

.popup-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    color: #94a3b8; /* slate-400 */
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.popup-close:hover {
    background-color: #334155;
    color: #f1f5f9;
}

/* Popup body */
.popup-body {
    padding: 1rem;
}

/* Rank display */
.popup-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.popup-rank .rank-number {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pack-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

/* Details section */
.popup-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.875rem;
}

.detail-label {
    color: #94a3b8; /* slate-400 */
}

.detail-value {
    color: #e2e8f0; /* slate-200 */
    font-family: ui-monospace, monospace;
    font-size: 0.8125rem;
}

/* Competitors section */
.popup-competitors {
    border-top: 1px solid #334155;
    padding-top: 1rem;
}

.competitors-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.competitors-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.competitor-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    padding: 0.375rem 0.5rem;
    background-color: #0f172a; /* slate-900 */
    border-radius: 0.375rem;
}

.competitor-rank {
    color: #64748b; /* slate-500 */
    font-weight: 600;
    min-width: 1.5rem;
}

.competitor-name {
    color: #e2e8f0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.competitor-rating {
    color: #fbbf24; /* amber-400 */
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
    .grid-cell-popup {
        min-width: auto;
        max-width: calc(100vw - 2rem);
        left: 1rem !important;
        right: 1rem;
        /* Center on mobile */
        transform: none;
    }

    .popup-header {
        padding: 0.625rem 0.875rem;
    }

    .popup-title {
        font-size: 0.9375rem;
    }

    .popup-body {
        padding: 0.875rem;
    }

    .popup-rank .rank-number {
        font-size: 1.5rem;
    }

    .popup-rank {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .pack-badge {
        font-size: 0.6875rem;
        padding: 0.1875rem 0.375rem;
    }

    .popup-details {
        gap: 0.375rem;
    }

    .detail-row {
        font-size: 0.8125rem;
        flex-wrap: wrap;
    }

    .detail-value {
        font-size: 0.75rem;
    }

    .competitor-item {
        font-size: 0.8125rem;
        padding: 0.3125rem 0.375rem;
    }

    .competitor-name {
        max-width: 120px;
    }

    .competitor-rating {
        font-size: 0.6875rem;
    }

    .competitors-title {
        font-size: 0.6875rem;
        margin-bottom: 0.5rem;
    }
}

/* Extra small screens (375px and below) */
@media (max-width: 375px) {
    .grid-cell-popup {
        left: 0.5rem !important;
        right: 0.5rem;
        max-width: calc(100vw - 1rem);
    }

    .popup-header {
        padding: 0.5rem 0.75rem;
    }

    .popup-title {
        font-size: 0.875rem;
    }

    .popup-close {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 1.125rem;
    }

    .popup-body {
        padding: 0.75rem;
    }

    .popup-rank .rank-number {
        font-size: 1.25rem;
    }

    .competitor-name {
        max-width: 100px;
    }
}
