/**
 * Amazon Reports - Styles
 * 
 * Styles matching webotee.com design system
 */

/* ============================================================================
   VARIABLES - Matching webotee.com
   ============================================================================ */
:root {
    --ar-primary: #3ECFB4;
    --ar-primary-dark: #2DB89E;
    --ar-secondary: #1a1a2e;
    --ar-text: #1a1a2e;
    --ar-text-light: #6b7280;
    --ar-border: #e5e7eb;
    --ar-bg: #f8fafc;
    --ar-white: #ffffff;
    --ar-stock-in: #10b981;
    --ar-stock-low: #f59e0b;
    --ar-stock-out: #ef4444;
    --ar-rank-up: #10b981;
    --ar-rank-down: #ef4444;
    --ar-amazon-orange: #ff9900;
}

/* ============================================================================
   COMMON ELEMENTS
   ============================================================================ */
.amazon-reports-main,
.amazon-asin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--ar-primary);
    color: var(--ar-white);
}

.btn-primary:hover {
    background: var(--ar-primary-dark);
    color: var(--ar-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(62, 207, 180, 0.4);
}

.btn-secondary {
    background: var(--ar-white);
    color: var(--ar-text);
    border: 2px solid var(--ar-border);
}

.btn-secondary:hover {
    border-color: var(--ar-primary);
    color: var(--ar-primary);
}

.btn-amazon {
    background: var(--ar-amazon-orange);
    color: var(--ar-white);
}

.btn-amazon:hover {
    background: #e68a00;
    color: var(--ar-white);
    transform: translateY(-2px);
}

/* ============================================================================
   REPORTS LISTING PAGE
   ============================================================================ */
.amazon-reports-listing {
    padding: 1rem 0;
}

.reports-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--ar-text);
}

.reports-intro {
    font-size: 1.125rem;
    color: var(--ar-text-light);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

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

.report-card {
    background: var(--ar-white);
    border: 1px solid var(--ar-border);
    border-radius: 16px;
    padding: 1.75rem;
    transition: all 0.3s ease;
}

.report-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
    border-color: var(--ar-primary);
}

.report-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.report-card-title a {
    color: var(--ar-text);
    text-decoration: none;
    transition: color 0.2s;
}

.report-card-title a:hover {
    color: var(--ar-primary);
}

.report-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: var(--ar-text-light);
    margin-bottom: 1.25rem;
}

.report-card-link {
    color: var(--ar-primary);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.2s;
}

.report-card-link:hover {
    gap: 0.5rem;
}

/* ============================================================================
   SINGLE REPORT PAGE
   ============================================================================ */
.amazon-report-header {
    margin-bottom: 2rem;
}

.report-breadcrumbs {
    font-size: 0.875rem;
    color: var(--ar-text-light);
    margin-bottom: 1rem;
}

.report-breadcrumbs a {
    color: var(--ar-primary);
    text-decoration: none;
    font-weight: 500;
}

.report-breadcrumbs a:hover {
    text-decoration: underline;
}

.report-breadcrumbs .sep {
    margin: 0 0.5rem;
    color: var(--ar-text-light);
}

.report-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--ar-text);
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--ar-text-light);
    margin-bottom: 1.5rem;
}

.report-meta strong {
    color: var(--ar-text);
}

.report-date-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.report-date-selector label {
    font-weight: 600;
    color: var(--ar-text);
}

.report-date-selector select {
    padding: 0.625rem 1rem;
    border: 2px solid var(--ar-border);
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: 200px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.report-date-selector select:focus {
    outline: none;
    border-color: var(--ar-primary);
}

/* Stats Bar */
.report-stats-bar {
    display: flex;
    gap: 2rem;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--ar-border);
}

.report-stats-bar .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.report-stats-bar .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.report-stats-bar .stat-label {
    font-size: 0.7rem;
    color: var(--ar-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================================
   PRODUCTS TABLE
   ============================================================================ */
.amazon-products-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--ar-border);
    border-radius: 16px;
    background: var(--ar-white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.amazon-products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.amazon-products-table th {
    background: var(--ar-bg);
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    color: var(--ar-text);
    border-bottom: 2px solid var(--ar-border);
    white-space: nowrap;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.amazon-products-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ar-border);
    vertical-align: middle;
}

.amazon-products-table tr:last-child td {
    border-bottom: none;
}

.amazon-products-table tbody tr {
    transition: background 0.2s;
}

.amazon-products-table tbody tr:hover {
    background: #f8fafc;
}

.col-rank {
    width: 70px;
    text-align: center;
}

.col-product {
    min-width: 320px;
}

.col-price,
.col-rating,
.col-reviews,
.col-seller,
.col-change {
    width: 110px;
    text-align: center;
}

.ranking {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--ar-primary);
    color: var(--ar-white);
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-thumb {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 10px;
    background: var(--ar-bg);
    padding: 4px;
    border: 1px solid var(--ar-border);
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.product-title {
    color: var(--ar-text);
    text-decoration: none;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.product-title:hover {
    color: var(--ar-primary);
}

.product-asin {
    font-size: 0.75rem;
    color: var(--ar-text-light);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    background: var(--ar-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    display: inline-block;
}

.product-brand {
    font-size: 0.8rem;
    color: var(--ar-text-light);
}

.rating-stars {
    color: #fbbf24;
    font-weight: 600;
}

/* Stock badges */
.stock-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.stock-in {
    background: rgba(16, 185, 129, 0.1);
    color: var(--ar-stock-in);
}

.stock-low {
    background: rgba(245, 158, 11, 0.1);
    color: var(--ar-stock-low);
}

.stock-out {
    background: rgba(239, 68, 68, 0.1);
    color: var(--ar-stock-out);
}

.stock-unknown {
    background: var(--ar-bg);
    color: var(--ar-text-light);
}

/* Ranking change */
.rank-up {
    color: var(--ar-rank-up);
    font-weight: 600;
}

.rank-down {
    color: var(--ar-rank-down);
    font-weight: 600;
}

.rank-neutral {
    color: var(--ar-text-light);
}

/* New product row highlight */
.amazon-products-table tr.new-product {
    background: rgba(62, 207, 180, 0.05);
}

.amazon-products-table tr.new-product:hover {
    background: rgba(62, 207, 180, 0.1);
}

/* New badge */
.rank-new {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: var(--ar-primary);
    color: white;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* ============================================================================
   ASIN TRACKING PAGE
   ============================================================================ */
.asin-tracking-header {
    margin-bottom: 2rem;
}

.asin-breadcrumbs {
    font-size: 0.875rem;
    color: var(--ar-text-light);
}

.asin-breadcrumbs a {
    color: var(--ar-primary);
    text-decoration: none;
    font-weight: 500;
}

.asin-breadcrumbs .sep {
    margin: 0 0.5rem;
}

/* Product Overview Card */
.asin-overview {
    margin-bottom: 2rem;
}

.asin-product-card {
    display: flex;
    gap: 2.5rem;
    background: var(--ar-white);
    border: 1px solid var(--ar-border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.asin-product-card .product-image {
    flex-shrink: 0;
    width: 220px;
}

.asin-product-card .product-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: var(--ar-bg);
    padding: 1rem;
    border: 1px solid var(--ar-border);
}

.asin-product-card .product-details {
    flex: 1;
}

.asin-product-card .product-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--ar-text);
    line-height: 1.3;
}

.asin-product-card .product-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.asin-badge {
    background: var(--ar-bg);
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.85rem;
    border: 1px solid var(--ar-border);
}

.product-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-box {
    background: var(--ar-bg);
    padding: 1.25rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--ar-border);
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--ar-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ar-text);
}

/* Category Rankings */
.asin-categories {
    margin-bottom: 2rem;
}

.asin-categories h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

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

.category-rank-card {
    background: var(--ar-white);
    border: 1px solid var(--ar-border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.2s;
}

.category-rank-card:hover {
    border-color: var(--ar-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.category-name {
    font-size: 0.875rem;
    color: var(--ar-text-light);
}

.category-rank {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ar-primary);
}

/* Charts */
.asin-price-history,
.asin-ranking-history {
    margin-bottom: 2rem;
}

.asin-price-history h2,
.asin-ranking-history h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.chart-container {
    background: var(--ar-white);
    border: 1px solid var(--ar-border);
    border-radius: 16px;
    padding: 1.5rem;
    height: 320px;
}

/* Stock Timeline */
.asin-stock-history h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.stock-timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.stock-entry {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.stock-date {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* ASIN Search Form */
.asin-search {
    text-align: center;
    padding: 4rem 2rem;
}

.asin-search h1 {
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.asin-search p {
    color: var(--ar-text-light);
    margin-bottom: 2rem;
}

.asin-search-form {
    display: flex;
    justify-content: center;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.asin-search-form input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--ar-border);
    border-radius: 12px;
    font-size: 1rem;
    text-transform: uppercase;
    transition: border-color 0.2s;
}

.asin-search-form input:focus {
    outline: none;
    border-color: var(--ar-primary);
}

/* ============================================================================
   HOMEPAGE SHORTCODE
   ============================================================================ */
.amazon-reports-homepage {
    padding: 2rem 0;
}

.amazon-reports-homepage .reports-grid {
    display: grid;
    gap: 1.5rem;
}

.amazon-reports-homepage.columns-2 .reports-grid {
    grid-template-columns: repeat(2, 1fr);
}

.amazon-reports-homepage.columns-3 .reports-grid {
    grid-template-columns: repeat(3, 1fr);
}

.amazon-reports-homepage.columns-4 .reports-grid {
    grid-template-columns: repeat(4, 1fr);
}

.featured-report-card {
    background: var(--ar-white);
    border: 1px solid var(--ar-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.featured-report-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

.featured-report-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.featured-report-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.featured-report-card .card-title a {
    color: var(--ar-text);
    text-decoration: none;
}

.featured-report-card .card-title a:hover {
    color: var(--ar-primary);
}

.featured-report-card .card-date {
    font-size: 0.75rem;
    color: var(--ar-text-light);
    white-space: nowrap;
}

.top-products {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.top-product {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem;
    background: var(--ar-bg);
    border-radius: 10px;
}

.top-product .product-rank {
    font-weight: 700;
    color: var(--ar-primary);
    min-width: 28px;
}

.top-product .product-thumb {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 6px;
    background: var(--ar-white);
    border: 1px solid var(--ar-border);
}

.top-product .product-info {
    flex: 1;
    min-width: 0;
}

.top-product .product-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ar-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-product .product-name:hover {
    color: var(--ar-primary);
}

.top-product .product-price {
    font-size: 0.75rem;
    color: var(--ar-text-light);
}

.featured-report-card .card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--ar-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: gap 0.2s;
}

.featured-report-card .card-link:hover {
    gap: 0.5rem;
}

.reports-updated {
    text-align: center;
    font-size: 0.8rem;
    color: var(--ar-text-light);
    margin-top: 1.5rem;
}

/* ============================================================================
   ERROR STATES
   ============================================================================ */
.report-not-found,
.asin-not-cached,
.no-reports,
.no-products,
.amazon-reports-error {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--ar-bg);
    border-radius: 16px;
    border: 1px solid var(--ar-border);
}

.report-not-found h1,
.asin-not-cached h1 {
    margin-bottom: 1rem;
    font-weight: 700;
}

.asin-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 1024px) {
    .amazon-reports-homepage.columns-4 .reports-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .report-stats-bar {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .amazon-reports-main,
    .amazon-asin-main {
        padding: 1.5rem 1rem;
    }
    
    .reports-page-title {
        font-size: 2rem;
    }
    
    .asin-product-card {
        flex-direction: column;
        padding: 1.5rem;
    }
    
    .asin-product-card .product-image {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .report-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .amazon-reports-homepage.columns-2 .reports-grid,
    .amazon-reports-homepage.columns-3 .reports-grid,
    .amazon-reports-homepage.columns-4 .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .product-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .asin-search-form {
        flex-direction: column;
    }
    
    .col-product {
        min-width: 220px;
    }
    
    .col-seller {
        display: none;
    }
}

@media (max-width: 480px) {
    .reports-page-title {
        font-size: 1.75rem;
    }
    
    .report-title {
        font-size: 1.5rem;
    }
    
    .amazon-products-table th,
    .amazon-products-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .product-thumb {
        width: 48px;
        height: 48px;
    }
    
    .col-rating,
    .col-reviews {
        display: none;
    }
    
    .report-stats-bar {
        gap: 1rem;
        padding: 1rem;
    }
    
    .report-stats-bar .stat-value {
        font-size: 1.25rem;
    }
}
