/* Product Exchange Styles */

.rb-product-manage {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.rb-product-form .form-group {
    margin-bottom: 25px;
}

.rb-product-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #374151;
    font-size: 16px;
}

.rb-product-form input[type="url"],
.rb-product-form input[type="text"] {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f9fafb;
}

.rb-product-form input[type="url"]:focus,
.rb-product-form input[type="text"]:focus {
    outline: none;
    border-color: #4f46e5;
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.rb-product-form small {
    display: block;
    margin-top: 8px;
    color: #6b7280;
    font-size: 14px;
}

.rb-product-info {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 15px;
    border-left: 5px solid #4f46e5;
}

.product-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.product-stat-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
}

.product-stat-item .stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #4f46e5;
    margin-bottom: 5px;
}

.product-stat-item .stat-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.product-thumbnail {
    max-width: 200px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.rb-product-partners-header {
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border-left: 5px solid #10b981;
}

.token-info {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #1e40af;
    text-align: center;
}

.sorting-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.sort-badge {
    background: #4f46e5;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

.view-limit {
    background: #fef3c7;
    color: #92400e;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.rb-product-no-products {
    text-align: center;
    padding: 80px 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin: 40px 0;
    border: 2px dashed #e5e7eb;
}

.rb-product-no-products p {
    font-size: 18px;
    color: #6b7280;
    margin-bottom: 15px;
}

.rb-product-viewed {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 2px solid #e5e7eb;
}

.views-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.summary-item {
    flex: 1;
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.summary-item.pending {
    border-top: 4px solid #f59e0b;
}

.summary-item.confirmed {
    border-top: 4px solid #10b981;
}

.summary-item.rejected {
    border-top: 4px solid #ef4444;
}

.summary-count {
    display: block;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.summary-item.pending .summary-count {
    color: #f59e0b;
}

.summary-item.confirmed .summary-count {
    color: #10b981;
}

.summary-item.rejected .summary-count {
    color: #ef4444;
}

.summary-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.views-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.view-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #e5e7eb;
    transition: transform 0.2s;
}

.view-item:hover {
    transform: translateY(-2px);
}

.view-item.status-confirmed {
    border-left-color: #10b981;
}

.view-item.status-pending {
    border-left-color: #f59e0b;
}

.view-item.status-rejected {
    border-left-color: #ef4444;
}

.view-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

.view-item-content {
    flex: 1;
}

.view-item-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #374151;
}

.view-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #6b7280;
}

.view-date {
    font-weight: 500;
}

.view-status {
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.status-confirmed .view-status {
    background: #d1fae5;
    color: #065f46;
}

.status-pending .view-status {
    background: #fef3c7;
    color: #92400e;
}

.status-rejected .view-status {
    background: #fee2e2;
    color: #991b1b;
}

.rb-product-views-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.rb-product-views-table th {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 20px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.rb-product-views-table td {
    padding: 18px 20px;
    border-top: 1px solid #f3f4f6;
}

.rb-product-views-table tr:hover {
    background: #f9fafb;
}

.button-small {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.button-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.button-small.reject {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.rb-product-stats {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.stats-table th {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 20px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.stats-table td {
    padding: 18px 20px;
    border-top: 1px solid #f3f4f6;
}

.stats-table tr:hover {
    background: #f9fafb;
}

.recent-views {
    margin-top: 60px;
}

/* Leaderboard Styles */
.rb-leaderboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 40px;
}

.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.tab-button {
    padding: 12px 24px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-button:hover {
    background: #e5e7eb;
}

.tab-button.active {
    background: #4f46e5;
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.leaderboard-table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.leaderboard-header-row {
    display: grid;
    grid-template-columns: 80px 1fr 150px 100px 100px;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 80px 1fr 150px 100px 100px;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

.leaderboard-row:hover {
    background: #f9fafb;
}

.leaderboard-row.top-1 {
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
}

.leaderboard-row.top-2 {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.leaderboard-row.top-3 {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.rank-col {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-number {
    font-size: 24px;
    font-weight: bold;
    color: #4f46e5;
    min-width: 30px;
}

.rank-medal {
    font-size: 24px;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.product-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

.product-owner {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

.rate-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rate-bar {
    flex: 1;
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
}

.rate-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    border-radius: 5px;
}

.rate-value {
    font-weight: 600;
    color: #10b981;
    min-width: 60px;
    text-align: right;
}

.tokens-badge {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 18px;
}

/* Product Cards */
.rb-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.rb-product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e5e7eb;
    position: relative;
}

.rb-product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.product-rank {
    position: absolute;
    top: 15px;
    right: 15px;
    text-align: center;
    z-index: 2;
}

.rank-badge {
    display: block;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 18px;
}

.rank-label {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
    font-weight: 500;
}

.product-image, 
.product-image-placeholder {
    height: 200px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.rb-product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-image-placeholder {
    font-size: 70px;
    color: #cbd5e1;
}

.product-content {
    padding: 25px;
}

.product-header h4 {
    margin: 0 0 5px 0;
    font-size: 20px;
    color: #374151;
    line-height: 1.4;
}

.product-owner {
    margin: 0 0 15px 0;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.product-price {
    font-size: 24px;
    font-weight: bold;
    color: #10b981;
    margin-bottom: 20px;
}

.product-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.stat-icon {
    font-size: 18px;
}

.confirmation-rate-display {
    margin-bottom: 20px;
}

.rate-text {
    display: block;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    margin-top: 8px;
    font-weight: 500;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-link {
    display: block;
    text-align: center;
    padding: 14px;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.product-link:hover {
    background: #e5e7eb;
    color: #4f46e5;
}

.view-btn {
    display: block;
    text-align: center;
    padding: 16px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.view-btn:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.3);
}

/* WooCommerce My Account Integration */
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--product-exchange a::before {
    content: "🛒";
    margin-right: 10px;
    font-size: 20px;
}

.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--product-views a::before {
    content: "👁️";
    margin-right: 10px;
    font-size: 20px;
}

.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--product-leaderboard a::before {
    content: "🏆";
    margin-right: 10px;
    font-size: 20px;
}

/* Fix WooCommerce My Account styling */
.woocommerce-MyAccount-content {
    width: 100% !important;
    float: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .rb-product-manage {
        padding: 20px;
    }
    
    .rb-product-partners-header {
        padding: 20px;
    }
    
    .rb-product-info {
        padding: 20px;
    }
    
    .rb-product-views-table,
    .stats-table {
        display: block;
        overflow-x: auto;
    }
    
    .leaderboard-header-row,
    .leaderboard-row {
        grid-template-columns: 60px 1fr 100px;
        font-size: 14px;
    }
    
    .views-col,
    .confirmed-col {
        display: none;
    }
    
    .rb-product-grid {
        grid-template-columns: 1fr;
    }
    
    .product-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sorting-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .rb-product-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-stat-item {
        padding: 15px;
    }
    
    .product-stat-item .stat-number {
        font-size: 24px;
    }
    
    .views-summary {
        flex-direction: column;
    }
    
    .tab-button {
        padding: 10px 15px;
        font-size: 14px;
    }
}