/**
 * AffiliateFlow AI - Modern Frontend Styles
 */

:root {
    --af-primary: #2563eb;
    --af-primary-hover: #1d4ed8;
    --af-accent: #10b981;
    --af-accent-hover: #059669;
    --af-deal: #f59e0b;
    --af-text: #1e293b;
    --af-text-muted: #64748b;
    --af-bg-card: #ffffff;
    --af-border: #e2e8f0;
    --af-radius: 12px;
    --af-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
    --af-shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Base Card */
.af-card {
    background: var(--af-bg-card);
    border: 1px solid var(--af-border);
    border-radius: var(--af-radius);
    box-shadow: var(--af-shadow);
    margin: 24px 0;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.af-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--af-shadow-hover);
}

.af-card-inner {
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 20px;
}

@media (min-width: 640px) {
    .af-card-inner {
        flex-direction: row;
        align-items: center;
    }
}

.af-card-media {
    flex-shrink: 0;
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
}

.af-card-media img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

.af-card-content {
    flex-grow: 1;
}

.af-brand-badge {
    display: inline-block;
    background: #eff6ff;
    color: var(--af-primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.af-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--af-text);
    margin: 0 0 10px 0;
    line-height: 1.35;
}

/* Ratings */
.af-rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.af-stars {
    color: #e2e8f0;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.af-star.filled {
    color: #f59e0b;
}

.af-rating-score {
    font-weight: 700;
    color: var(--af-text);
}

.af-review-count {
    font-size: 0.85rem;
    color: var(--af-text-muted);
}

/* Pricing */
.af-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 18px;
}

.af-price-label {
    font-size: 0.875rem;
    color: var(--af-text-muted);
}

.af-price-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--af-accent);
}

/* Buttons */
.af-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.af-btn-primary {
    background: var(--af-primary);
    color: #ffffff !important;
}

.af-btn-primary:hover {
    background: var(--af-primary-hover);
}

.af-btn-accent {
    background: var(--af-accent);
    color: #ffffff !important;
}

.af-btn-accent:hover {
    background: var(--af-accent-hover);
}

.af-btn-deal {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff !important;
}

.af-btn-outline {
    background: transparent;
    border: 1px solid var(--af-border);
    color: var(--af-text) !important;
}

.af-btn-outline:hover {
    border-color: var(--af-primary);
    color: var(--af-primary) !important;
}

.af-btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

/* Comparison Table */
.af-comparison-wrapper {
    margin: 28px 0;
    border: 1px solid var(--af-border);
    border-radius: var(--af-radius);
    overflow: hidden;
    box-shadow: var(--af-shadow);
}

.af-table-responsive {
    overflow-x: auto;
}

.af-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    text-align: left;
}

.af-comparison-table th {
    background: #f8fafc;
    padding: 14px 18px;
    font-weight: 600;
    color: var(--af-text-muted);
    border-bottom: 2px solid var(--af-border);
}

.af-comparison-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--af-border);
    vertical-align: middle;
}

.af-row-winner {
    background: #f0fdf4;
}

.af-product-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.af-thumb {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--af-border);
}

.af-badge-winner {
    display: inline-block;
    background: var(--af-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
}

/* Where to Buy Box */
.af-where-to-buy-box {
    margin: 28px 0;
    background: #ffffff;
    border: 1px solid var(--af-border);
    border-radius: var(--af-radius);
    padding: 20px;
    box-shadow: var(--af-shadow);
}

.af-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.af-box-title {
    margin: 0;
    font-size: 1.15rem;
    color: var(--af-text);
}

.af-save-pill {
    background: #dcfce7;
    color: #15803d;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

.af-offer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--af-border);
    gap: 12px;
}

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

.af-best-deal-row {
    background: #f8fafc;
    border-radius: 8px;
}

.af-stock-status.instock {
    color: #10b981;
    font-size: 0.85rem;
    font-weight: 600;
}

.af-stock-status.outofstock {
    color: #ef4444;
    font-size: 0.85rem;
}

/* Coupon Card */
.af-coupon-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    border: 2px dashed #3b82f6;
    border-radius: var(--af-radius);
    padding: 20px 24px;
    margin: 24px 0;
    gap: 20px;
}

.af-coupon-code {
    display: inline-block;
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 700;
    background: #eff6ff;
    color: var(--af-primary);
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #bfdbfe;
}

.af-btn-copy {
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
}

/* Pros & Cons */
.af-pros-cons-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 24px 0;
}

@media (min-width: 640px) {
    .af-pros-cons-container {
        grid-template-columns: 1fr 1fr;
    }
}

.af-pros-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--af-radius);
    padding: 20px;
}

.af-cons-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--af-radius);
    padding: 20px;
}

.af-pros-list li {
    list-style: none;
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    color: #166534;
}

.af-pros-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #16a34a;
    font-weight: 800;
}

.af-cons-list li {
    list-style: none;
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    color: #991b1b;
}

.af-cons-list li::before {
    content: "✕";
    position: absolute;
    left: 0;
    color: #dc2626;
    font-weight: 800;
}
