/**
 * AI Article Generator - Amazon Product Box Styles
 * Frontend styles for Amazon affiliate product boxes
 */

/* Amazon Box Container */
.aiag-amazon-box {
    margin: 32px 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.aiag-amazon-box-inner {
    display: flex;
    gap: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.aiag-amazon-box-inner:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

/* Product Image */
.aiag-amazon-image {
    flex-shrink: 0;
    width: 180px;
}

.aiag-amazon-image a {
    display: block;
    text-decoration: none;
}

.aiag-amazon-image img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.aiag-amazon-image:hover img {
    transform: scale(1.05);
}

/* Content Section */
.aiag-amazon-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Title */
.aiag-amazon-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.aiag-amazon-title a {
    color: #1e3a5f;
    text-decoration: none;
    transition: color 0.2s ease;
}

.aiag-amazon-title a:hover {
    color: #ff9900;
}

/* Rating */
.aiag-amazon-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.aiag-stars {
    display: inline-flex;
    letter-spacing: -2px;
}

.aiag-star {
    font-size: 18px;
}

.aiag-star-full {
    color: #ff9900;
}

.aiag-star-half {
    color: #ff9900;
    position: relative;
}

.aiag-star-half::after {
    content: '☆';
    position: absolute;
    left: 0;
    color: #d4d4d4;
    clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}

.aiag-star-empty {
    color: #d4d4d4;
}

.aiag-rating-value {
    font-weight: 600;
    color: #ff9900;
}

.aiag-review-count {
    color: #6b7280;
    font-size: 13px;
}

/* Price */
.aiag-amazon-price {
    margin-bottom: 16px;
}

.aiag-price-label {
    font-size: 13px;
    color: #6b7280;
    margin-right: 6px;
}

.aiag-price-value {
    font-size: 24px;
    font-weight: 700;
    color: #b12704;
}

/* Features */
.aiag-amazon-features {
    margin: 0 0 16px 0;
    padding: 0 0 0 20px;
    list-style: none;
}

.aiag-amazon-features li {
    position: relative;
    padding: 4px 0;
    padding-left: 24px;
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}

.aiag-amazon-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 700;
}

/* CTA Button */
.aiag-amazon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(180deg, #ffd814 0%, #f7c404 100%);
    border: 1px solid #c99a00;
    border-radius: 24px;
    color: #0f1111 !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-top: auto;
    align-self: flex-start;
}

.aiag-amazon-button:hover {
    background: linear-gradient(180deg, #ffe566 0%, #ffd814 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.aiag-amazon-button:active {
    transform: translateY(0);
}

.aiag-cart-icon,
.aiag-arrow-icon {
    width: 18px;
    height: 18px;
}

/* Disclaimer */
.aiag-amazon-disclaimer {
    margin: 16px 0 0 0;
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
    line-height: 1.4;
}

/* Compact Box Variant */
.aiag-amazon-box-compact {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin: 16px 0;
}

.aiag-compact-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}

.aiag-compact-info {
    flex: 1;
    min-width: 0;
}

.aiag-compact-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e3a5f;
    text-decoration: none;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aiag-compact-title:hover {
    color: #ff9900;
}

.aiag-compact-price {
    font-size: 16px;
    font-weight: 700;
    color: #b12704;
}

.aiag-compact-button {
    flex-shrink: 0;
    padding: 10px 20px;
    background: linear-gradient(180deg, #ffd814 0%, #f7c404 100%);
    border: 1px solid #c99a00;
    border-radius: 20px;
    color: #0f1111 !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
}

.aiag-compact-button:hover {
    background: linear-gradient(180deg, #ffe566 0%, #ffd814 100%);
}

/* Content Images */
.aiag-figure {
    margin: 32px 0;
    text-align: center;
}

.aiag-content-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .aiag-amazon-box-inner {
        flex-direction: column;
        padding: 20px;
    }

    .aiag-amazon-image {
        width: 100%;
        text-align: center;
    }

    .aiag-amazon-image img {
        max-width: 200px;
        max-height: 200px;
    }

    .aiag-amazon-title {
        font-size: 16px;
    }

    .aiag-amazon-button {
        width: 100%;
        justify-content: center;
    }

    .aiag-amazon-box-compact {
        flex-wrap: wrap;
    }

    .aiag-compact-info {
        flex: 1 1 calc(100% - 96px);
    }

    .aiag-compact-button {
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .aiag-amazon-box-inner {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        border-color: #374151;
    }

    .aiag-amazon-title a {
        color: #e5e7eb;
    }

    .aiag-amazon-features li {
        color: #d1d5db;
    }

    .aiag-review-count {
        color: #9ca3af;
    }

    .aiag-amazon-disclaimer {
        color: #6b7280;
    }

    .aiag-amazon-box-compact {
        background: #1f2937;
        border-color: #374151;
    }

    .aiag-compact-title {
        color: #e5e7eb;
    }
}

/* Print Styles */
@media print {
    .aiag-amazon-box {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .aiag-amazon-box-inner {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .aiag-amazon-button {
        background: #fff;
        border: 2px solid #ff9900;
        color: #0f1111;
    }
}