/**
 * API.DevWharf - Products Browser Styles
 * Cyberpunk-themed product grid and modal
 */

/* ===============================
   PRODUCT STATS HEADER
   =============================== */

.product-stats {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.stat-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--accent-cyan);
    border-radius: 8px;
    box-shadow: var(--glow-cyan);
}

.stat-badge .stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-cyan);
    text-shadow: var(--glow-cyan);
}

.stat-badge .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ===============================
   PRODUCTS SECTION
   =============================== */

.products-section {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* ===============================
   PRODUCTS GRID
   =============================== */

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

/* ===============================
   PRODUCT CARD
   =============================== */

.product-card {
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.product-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        var(--glow-cyan);
}

.product-card:hover .product-hover-info {
    opacity: 1;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

/* Product Image */
.product-image-wrapper {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Rating Badge */
.rating-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(10, 10, 15, 0.85);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #ffd700;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

/* Product Content */
.product-content {
    padding: 1.25rem;
}

.product-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Product Meta (Price + ID) */
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(139, 92, 246, 0.15);
}

.product-price {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.product-id {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hover Info Overlay */
.product-hover-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 255, 249, 0.9), transparent);
    padding: 2rem 1rem 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
}

.view-details {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--bg-primary);
}

/* ===============================
   MODAL STYLES
   =============================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-purple);
    border-radius: 16px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        var(--glow-purple);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--accent-red);
    border-radius: 50%;
    color: var(--accent-red);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 400px;
}

/* Modal Image Section */
.modal-image-section {
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-image {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Modal Details Section */
.modal-details-section {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.modal-rating {
    margin-bottom: 1rem;
}

.modal-rating .stars {
    font-size: 1.25rem;
    color: #ffd700;
    letter-spacing: 2px;
}

.modal-rating .rating-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.modal-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.modal-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.price-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.modal-price {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-green);
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

/* Modal Metadata */
.modal-metadata {
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-row:last-child {
    border-bottom: none;
}

.meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.meta-value {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-actions .cyber-btn {
    flex: 1;
    text-align: center;
    text-decoration: none;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
}

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

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .modal-image-section {
        padding: 1rem;
        max-height: 250px;
    }
    
    .modal-image {
        max-height: 200px;
    }
    
    .modal-details-section {
        padding: 1.5rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .products-section {
        padding: 1rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-image-wrapper {
        height: 200px;
    }
}
