/**
 * AI Amazon Affiliate Auto Inserter - Front-end Cards Styling
 *
 * Designed to match clean, rounded, high-converting product card aesthetics.
 * Namespaced with aaai- to prevent theme collision.
 */

/* Affiliate Disclosure */
.aaai-disclosure {
    font-size: 0.85em;
    color: #666;
    text-align: center;
    margin: 1.5em auto 0.75em;
    max-width: 800px;
    padding: 0 15px;
    line-height: 1.4;
    font-style: italic;
}

/* Two-card row wrapper */
.aaai-block {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: stretch;
    margin: 2em auto;
    max-width: 800px;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Clickable card container */
.aaai-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    max-width: 380px;
    min-width: 250px;
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    text-decoration: none !important;
    color: inherit !important;
    padding: 20px;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.aaai-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    text-decoration: none !important;
    color: inherit !important;
}

.aaai-card:visited {
    color: inherit !important;
}

/* Image container */
.aaai-img {
    background: #ffffff;
    border: 1.5px solid #2d2d2d;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-sizing: border-box;
    padding: 8px;
}

.aaai-img img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border: none;
    border-radius: 8px;
}

/* Product display title */
.aaai-title {
    text-align: center;
    font-weight: 700;
    font-size: 1.05em;
    line-height: 1.4;
    min-height: 2.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    margin-bottom: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

/* Subtle separator line */
.aaai-divider {
    height: 1px;
    background: #e5e5e5;
    margin: 0 0 14px 0;
    width: 100%;
}

/* Footer row */
.aaai-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 4px;
}

.aaai-brand {
    font-weight: 700;
    font-size: 1.15em;
    color: #1a1a1a;
    letter-spacing: 0.5px;
}

.aaai-btn {
    background: #F5A25D;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.9em;
    padding: 10px 22px;
    border-radius: 25px;
    white-space: nowrap;
    transition: background 0.2s ease;
    display: inline-block;
    text-align: center;
    line-height: 1.2;
}

.aaai-card:hover .aaai-btn {
    background: #e8923f;
}

/* Responsive: stack to single column on small screens */
@media (max-width: 600px) {
    .aaai-block {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .aaai-card {
        max-width: 100%;
        width: 100%;
        min-width: unset;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .aaai-disclosure {
        color: #aaa;
    }

    .aaai-card {
        background: #23272a;
        box-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
    }

    .aaai-card:hover {
        box-shadow: 0 8px 26px rgba(0, 0, 0, 0.6);
    }

    .aaai-img {
        border-color: #4f545c;
        background: #1e2124;
    }

    .aaai-title {
        color: #f6f6f6;
    }

    .aaai-brand {
        color: #f6f6f6;
    }

    .aaai-divider {
        background: #36393f;
    }
}
