/* PreciousMetalCrypto Products Table Styling - Three-level structure */

#pmc-products-table-container {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Metal group styling */
.pmc-metal-group {
    margin-bottom: 0;
}

.pmc-metal-group:last-child {
    margin-bottom: 0;
}

/* Metal headers with golden gradient */
.pmc-metal-header {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 50%, #b8860b 100%);
    color: #2c1810;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    padding: 15px 20px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    border-bottom: 2px solid #b8860b;
}

/* Silver header variation */
.pmc-metal-group:nth-child(2) .pmc-metal-header {
    background: linear-gradient(135deg, #c0c0c0 0%, #e6e6e6 50%, #a8a8a8 100%);
    color: #2c2c2c;
    border-bottom: 2px solid #a8a8a8;
}

/* Platinum header variation */
.pmc-metal-group:nth-child(3) .pmc-metal-header {
    background: linear-gradient(135deg, #e5e4e2 0%, #f0f0f0 50%, #d3d3d3 100%);
    color: #2c2c2c;
    border-bottom: 2px solid #d3d3d3;
}

/* Palladium header variation */
.pmc-metal-group:nth-child(4) .pmc-metal-header {
    background: linear-gradient(135deg, #ccc5b9 0%, #e8e2d5 50%, #b5a991 100%);
    color: #2c2c2c;
    border-bottom: 2px solid #b5a991;
}

/* Weights container */
.pmc-weights-container {
    background-color: #ffffff;
}

/* Weight group styling */
.pmc-weight-group {
    border-bottom: 1px solid #e9ecef;
}

.pmc-weight-group:last-child {
    border-bottom: none;
}

/* Weight header (clickable) */
.pmc-weight-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-bottom: 1px solid #dee2e6;
    user-select: none;
}

.pmc-weight-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pmc-weight-header.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

/* Weight toggle icon */
.pmc-weight-toggle {
    font-size: 12px;
    margin-right: 10px;
    transition: transform 0.3s ease;
    color: #6c757d;
    font-weight: bold;
}

.pmc-weight-header.active .pmc-weight-toggle {
    transform: rotate(90deg);
    color: white;
}

/* Weight name */
.pmc-weight-name {
    font-weight: 600;
    font-size: 16px;
    color: #495057;
    margin-right: 10px;
}

.pmc-weight-header.active .pmc-weight-name {
    color: white;
}

/* Products count */
.pmc-products-count {
    font-size: 12px;
    color: #6c757d;
    font-weight: normal;
    margin-left: auto;
}

.pmc-weight-header.active .pmc-products-count {
    color: rgba(255, 255, 255, 0.8);
}

/* Table wrapper */
.pmc-products-table-wrapper {
    overflow-x: auto;
    display: none; /* Initially hidden */
    animation-duration: 0.3s;
    animation-fill-mode: both;
}

.pmc-products-table-wrapper.show {
    display: block;
    animation-name: slideDown;
}

.pmc-products-table-wrapper.hide {
    animation-name: slideUp;
}

/* Slide animations */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
}

/* Main table styling */
.pmc-products-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    font-size: 14px;
}

/* Table header */
.pmc-products-table thead th {
    background-color: #f1f3f4;
    color: #495057;
    font-weight: 600;
    padding: 10px 20px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

.pmc-product-column {
    width: 60%;
}

.pmc-price-column {
    width: 40%;
    text-align: right;
}

/* Table rows */
.pmc-product-row {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
}

.pmc-product-row:nth-child(even) {
    background-color: #fafbfc;
}

.pmc-product-row:hover {
    background-color: #e3f2fd;
    cursor: pointer;
}

/* Product name cell */
.pmc-product-name {
    padding: 10px 20px;
}

.pmc-product-link {
    color: #495057;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: color 0.2s ease;
}

.pmc-product-link:hover {
    color: #007bff;
    text-decoration: none;
}

.pmc-product-icon {
    margin-right: 8px;
    font-size: 14px;
    color: #6c757d;
}

/* Price cell */
.pmc-product-price {
    padding: 10px 20px;
    text-align: right;
    font-weight: 600;
    color: #28a745;
}

.pmc-price-value {
    font-size: 14px;
    white-space: nowrap;
}

/* No products message */
.pmc-no-products {
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    #pmc-products-table-container {
        margin: 10px;
        border-radius: 4px;
    }

    .pmc-metal-header {
        font-size: 20px;
        padding: 12px 15px;
    }

    .pmc-weight-header {
        padding: 10px 15px;
    }

    .pmc-weight-name {
        font-size: 14px;
    }

    .pmc-products-table thead th,
    .pmc-product-name,
    .pmc-product-price {
        padding: 8px 15px;
    }

    .pmc-products-table thead th {
        font-size: 13px;
    }

    .pmc-price-value {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .pmc-product-column {
        width: 55%;
    }

    .pmc-price-column {
        width: 45%;
    }

    .pmc-weight-header {
        padding: 8px 12px;
    }

    .pmc-weight-name {
        font-size: 13px;
    }

    .pmc-products-count {
        font-size: 11px;
    }

    .pmc-price-value {
        font-size: 12px;
    }
}

/* Loading animation for price updates */
.pmc-price-updating {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.pmc-price-updated {
    background-color: #d4edda !important;
    transition: background-color 0.5s ease;
}

/* Animation for updated prices */
@keyframes priceUpdate {
    0% { background-color: #d4edda; }
    100% { background-color: transparent; }
}

.pmc-product-row.price-updated {
    animation: priceUpdate 2s ease-out;
}