/**
 * Promotion Shortcode Styles
 *
 * Displays promotion/campaign cards with various layouts.
 * Layouts: card, list, compact, banner
 *
 * @since 1.1.0
 */

/* ==========================================================================
   Base Container
   ========================================================================== */

.bf-promotion {
    margin: 1.5em 0;
}

/* ==========================================================================
   Card Layout (Default)
   ========================================================================== */

.bf-promotion--card {
    display: grid;
    gap: 1.25rem;
}

.bf-promotion--cols-1 {
    grid-template-columns: 1fr;
}

.bf-promotion--cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.bf-promotion--cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.bf-promotion--cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.bf-promotion--card .bf-promotion__item {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.bf-promotion--card .bf-promotion__item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.bf-promotion--card .bf-promotion__item--featured {
    border-color: #fbbf24;
    box-shadow: 0 0 0 1px #fbbf24;
}

.bf-promotion--card .bf-promotion__item--expiring {
    border-color: #ef4444;
}

/* ==========================================================================
   List Layout
   ========================================================================== */

.bf-promotion--list .bf-promotion__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.bf-promotion--list .bf-promotion__item:last-child {
    margin-bottom: 0;
}

.bf-promotion--list .bf-promotion__image {
    flex-shrink: 0;
    width: 120px;
    border-radius: 6px;
    overflow: hidden;
}

.bf-promotion--list .bf-promotion__content {
    flex: 1;
    min-width: 0;
}

.bf-promotion--list .bf-promotion__cta {
    flex-shrink: 0;
}

/* ==========================================================================
   Compact Layout
   ========================================================================== */

.bf-promotion--compact .bf-promotion__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.bf-promotion--compact .bf-promotion__item:last-child {
    border-bottom: none;
}

.bf-promotion--compact .bf-promotion__image {
    display: none;
}

.bf-promotion--compact .bf-promotion__provider-logo {
    flex-shrink: 0;
    width: 40px;
}

.bf-promotion--compact .bf-promotion__provider-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.bf-promotion--compact .bf-promotion__content {
    flex: 1;
    min-width: 0;
}

.bf-promotion--compact .bf-promotion__title {
    font-size: 0.9375rem;
    margin: 0 0 0.25rem;
}

.bf-promotion--compact .bf-promotion__description,
.bf-promotion--compact .bf-promotion__terms {
    display: none;
}

.bf-promotion--compact .bf-promotion__bonus-value {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

/* ==========================================================================
   Banner Layout
   ========================================================================== */

.bf-promotion--banner .bf-promotion__item {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    min-height: 160px;
}

.bf-promotion--banner .bf-promotion__item:last-child {
    margin-bottom: 0;
}

.bf-promotion--banner .bf-promotion__image {
    position: absolute;
    inset: 0;
    opacity: 0.3;
}

.bf-promotion--banner .bf-promotion__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bf-promotion--banner .bf-promotion__content {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 1.5rem 2rem;
    color: #fff;
}

.bf-promotion--banner .bf-promotion__title {
    color: #fff;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.bf-promotion--banner .bf-promotion__title a {
    color: inherit;
}

.bf-promotion--banner .bf-promotion__bonus-value {
    background: rgba(255, 255, 255, 0.15);
    color: #fbbf24;
    font-size: 1.125rem;
}

.bf-promotion--banner .bf-promotion__description {
    color: rgba(255, 255, 255, 0.85);
}

.bf-promotion--banner .bf-promotion__expiry {
    color: rgba(255, 255, 255, 0.7);
}

.bf-promotion--banner .bf-promotion__cta {
    position: relative;
    z-index: 1;
    padding: 1.5rem 2rem 1.5rem 0;
}

/* ==========================================================================
   Badge
   ========================================================================== */

.bf-promotion__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 4px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.bf-promotion__item--featured .bf-promotion__badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1f2937;
}

.bf-promotion__item--expiring .bf-promotion__badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ==========================================================================
   Image
   ========================================================================== */

.bf-promotion__image {
    position: relative;
    overflow: hidden;
}

.bf-promotion--card .bf-promotion__image {
    aspect-ratio: 16 / 9;
}

.bf-promotion__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bf-promotion__item:hover .bf-promotion__image img {
    transform: scale(1.03);
}

/* ==========================================================================
   Content
   ========================================================================== */

.bf-promotion__content {
    padding: 1.25rem;
    flex: 1;
}

.bf-promotion__provider-logo {
    margin-bottom: 0.75rem;
}

.bf-promotion__provider-logo img {
    max-width: 80px;
    max-height: 32px;
    object-fit: contain;
}

.bf-promotion__title {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

.bf-promotion__title a {
    color: inherit;
    text-decoration: none;
}

.bf-promotion__title a:hover {
    color: #0066cc;
}

/* ==========================================================================
   Bonus Value
   ========================================================================== */

.bf-promotion__bonus-value {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

/* ==========================================================================
   Description
   ========================================================================== */

.bf-promotion__description {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ==========================================================================
   Terms
   ========================================================================== */

.bf-promotion__terms {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

/* ==========================================================================
   Expiry
   ========================================================================== */

.bf-promotion__expiry {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.bf-promotion__expiry-icon {
    flex-shrink: 0;
    color: #9ca3af;
}

.bf-promotion__item--expiring .bf-promotion__expiry {
    color: #ef4444;
}

.bf-promotion__item--expiring .bf-promotion__expiry-icon {
    color: #ef4444;
}

/* ==========================================================================
   CTA Button
   ========================================================================== */

.bf-promotion__cta {
    padding: 0 1.25rem 1.25rem;
}

.bf-promotion__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.bf-promotion__button:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    color: #fff;
}

.bf-promotion__button:active {
    transform: translateY(0);
}

/* List/compact layout button */
.bf-promotion--list .bf-promotion__cta,
.bf-promotion--compact .bf-promotion__cta {
    padding: 0;
}

.bf-promotion--list .bf-promotion__button {
    width: auto;
    padding: 0.625rem 1.5rem;
}

.bf-promotion--compact .bf-promotion__button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .bf-promotion--cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .bf-promotion--cols-3,
    .bf-promotion--cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .bf-promotion--list .bf-promotion__item {
        flex-wrap: wrap;
    }

    .bf-promotion--list .bf-promotion__image {
        width: 100%;
        margin-bottom: 1rem;
    }

    .bf-promotion--list .bf-promotion__cta {
        width: 100%;
        margin-top: 0.75rem;
    }

    .bf-promotion--list .bf-promotion__button {
        width: 100%;
    }

    .bf-promotion--banner .bf-promotion__item {
        flex-direction: column;
        min-height: auto;
    }

    .bf-promotion--banner .bf-promotion__content {
        padding: 1.25rem;
    }

    .bf-promotion--banner .bf-promotion__cta {
        width: 100%;
        padding: 0 1.25rem 1.25rem;
    }

    .bf-promotion--banner .bf-promotion__button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .bf-promotion--cols-2,
    .bf-promotion--cols-3,
    .bf-promotion--cols-4 {
        grid-template-columns: 1fr;
    }

    .bf-promotion--card .bf-promotion__content {
        padding: 1rem;
    }

    .bf-promotion--card .bf-promotion__cta {
        padding: 0 1rem 1rem;
    }

    .bf-promotion--compact .bf-promotion__item {
        flex-wrap: wrap;
    }

    .bf-promotion--compact .bf-promotion__cta {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* ==========================================================================
   Dark Mode
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .bf-promotion--card .bf-promotion__item,
    .bf-promotion--list .bf-promotion__item {
        background: #1f2937;
        border-color: #374151;
    }

    .bf-promotion--card .bf-promotion__item:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }

    .bf-promotion--card .bf-promotion__item--featured {
        border-color: #fbbf24;
        box-shadow: 0 0 0 1px #fbbf24;
    }

    .bf-promotion--compact .bf-promotion__item {
        border-color: #374151;
    }

    .bf-promotion__title {
        color: #f9fafb;
    }

    .bf-promotion__title a:hover {
        color: #60a5fa;
    }

    .bf-promotion__description {
        color: #9ca3af;
    }

    .bf-promotion__terms {
        background: #374151;
        color: #9ca3af;
    }

    .bf-promotion__expiry {
        color: #9ca3af;
    }

    .bf-promotion__expiry-icon {
        color: #6b7280;
    }

    .bf-promotion__item--expiring .bf-promotion__expiry,
    .bf-promotion__item--expiring .bf-promotion__expiry-icon {
        color: #f87171;
    }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .bf-promotion--card .bf-promotion__item,
    .bf-promotion--list .bf-promotion__item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .bf-promotion__badge {
        background: #333;
        color: #fff;
    }

    .bf-promotion__button {
        background: #000;
        color: #fff;
    }

    .bf-promotion__image img {
        max-height: 150px;
    }
}
