/**
 * Smart Promotions - Shortcodes Styles
 *
 * @package Smart_Promotions_WooCommerce
 * @since 5.0.0
 */

/* ==========================================================================
   Table of Contents
   ==========================================================================
   1. Base Shortcode Styles
   2. Progress Bar Shortcode
   3. Rules Display Shortcode
   4. Eligible Products Shortcode
   5. Badge Shortcode
   6. Incentive Shortcode
   7. Savings Shortcode
   8. Social Proof Shortcode
   9. Countdown Shortcode
   10. Message Shortcodes
   11. Banner Shortcode
   12. Quick Add Shortcode
   13. Responsive Styles
   ========================================================================== */

/* ==========================================================================
   1. Base Shortcode Styles
   ========================================================================== */

.spwc-shortcode {
    display: block;
    margin: 1rem 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.spwc-shortcode * {
    box-sizing: border-box;
}

.spwc-shortcode-error {
    padding: 1rem;
    background: #FEE2E2;
    border: 1px solid #EF4444;
    border-radius: 4px;
    color: #991B1B;
    font-size: 0.875rem;
}

/* ==========================================================================
   2. Progress Bar Shortcode
   ========================================================================== */

.spwc-progress-shortcode {
    padding: 1rem;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
}

.spwc-progress-shortcode .spwc-progress-title {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1F2937;
}

.spwc-progress-shortcode .spwc-progress-bar-wrapper {
    position: relative;
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.spwc-progress-shortcode .spwc-progress-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--spwc-primary, #1E293B);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.spwc-progress-shortcode .spwc-progress-text {
    font-size: 0.875rem;
    color: #6B7280;
}

/* Steps Style */
.spwc-progress-shortcode.style-steps .spwc-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.spwc-progress-shortcode.style-steps .spwc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.spwc-progress-shortcode.style-steps .spwc-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6B7280;
    z-index: 2;
}

.spwc-progress-shortcode.style-steps .spwc-step.completed .spwc-step-circle {
    background: var(--spwc-success, #10B981);
    color: white;
}

.spwc-progress-shortcode.style-steps .spwc-step.active .spwc-step-circle {
    background: var(--spwc-primary, #1E293B);
    color: white;
}

.spwc-progress-shortcode.style-steps .spwc-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(50% + 16px);
    width: calc(100% - 32px);
    height: 2px;
    background: #E5E7EB;
    z-index: 1;
}

.spwc-progress-shortcode.style-steps .spwc-step.completed:not(:last-child)::after {
    background: var(--spwc-success, #10B981);
}

/* Circular Style */
.spwc-progress-shortcode.style-circular {
    text-align: center;
}

.spwc-progress-shortcode.style-circular .spwc-progress-circle {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 0.5rem;
}

.spwc-progress-shortcode.style-circular .spwc-progress-circle svg {
    transform: rotate(-90deg);
}

.spwc-progress-shortcode.style-circular .spwc-progress-circle-bg {
    fill: none;
    stroke: #E5E7EB;
    stroke-width: 6;
}

.spwc-progress-shortcode.style-circular .spwc-progress-circle-bar {
    fill: none;
    stroke: var(--spwc-primary, #1E293B);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease;
}

.spwc-progress-shortcode.style-circular .spwc-progress-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--spwc-primary, #1E293B);
}

/* ==========================================================================
   3. Rules Display Shortcode
   ========================================================================== */

.spwc-rules-shortcode {
    display: grid;
    gap: 1rem;
}

.spwc-rule-card {
    padding: 1.25rem;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    transition: box-shadow 0.2s ease;
}

.spwc-rule-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.spwc-rule-card .rule-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1F2937;
}

.spwc-rule-card .rule-description {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: #6B7280;
}

.spwc-rule-card .rule-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.spwc-rule-card .rule-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: #F3F4F6;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #4B5563;
}

.spwc-rule-card .rule-badge.active {
    background: #D1FAE5;
    color: #065F46;
}

/* Rule Details Shortcode */
.spwc-rule-details {
    padding: 1.5rem;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
}

.spwc-rule-details .rule-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E5E7EB;
}

.spwc-rule-details .rule-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1F2937;
}

.spwc-rule-details .rule-description {
    margin: 0;
    color: #6B7280;
}

.spwc-rule-details .rule-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.spwc-rule-details .info-item {
    padding: 0.75rem;
    background: #F9FAFB;
    border-radius: 6px;
}

.spwc-rule-details .info-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    color: #6B7280;
}

.spwc-rule-details .info-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1F2937;
}

/* ==========================================================================
   4. Eligible Products Shortcode
   ========================================================================== */

.spwc-eligible-products-shortcode {
    padding: 1rem;
}

.spwc-eligible-products-shortcode .section-title {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1F2937;
}

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

.spwc-product-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.spwc-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.spwc-product-card .product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.spwc-product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spwc-product-card .free-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--spwc-success, #10B981);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.spwc-product-card .product-info {
    padding: 0.75rem;
}

.spwc-product-card .product-name {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1F2937;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.spwc-product-card .product-price {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
}

.spwc-product-card .product-price .original-price {
    text-decoration: line-through;
    color: #9CA3AF;
    margin-right: 0.25rem;
}

.spwc-product-card .product-price .free-price {
    color: var(--spwc-success, #10B981);
    font-weight: 600;
}

.spwc-product-card .add-to-cart-btn {
    width: 100%;
    padding: 0.5rem;
    background: var(--spwc-primary, #1E293B);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.spwc-product-card .add-to-cart-btn:hover {
    background: #334155;
}

/* ==========================================================================
   5. Badge Shortcode
   ========================================================================== */

.spwc-badge-shortcode {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--spwc-primary, #1E293B);
    color: white;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.spwc-badge-shortcode .badge-icon {
    margin-right: 0.5rem;
}

/* ==========================================================================
   6. Incentive Shortcode
   ========================================================================== */

.spwc-incentive-shortcode {
    padding: 1.5rem;
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    border: 1px solid #E5E7EB;
    border-radius: 12px;
}

.spwc-incentive-shortcode .incentive-header {
    text-align: center;
    margin-bottom: 1rem;
}

.spwc-incentive-shortcode .incentive-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.spwc-incentive-shortcode .incentive-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1F2937;
}

.spwc-incentive-shortcode .incentive-message {
    margin: 0;
    color: #6B7280;
}

.spwc-incentive-shortcode .incentive-products {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin: 1rem 0;
}

.spwc-incentive-shortcode .incentive-cta {
    text-align: center;
}

.spwc-incentive-shortcode .cta-button {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--spwc-primary, #1E293B);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.spwc-incentive-shortcode .cta-button:hover {
    background: #334155;
    color: white;
}

/* ==========================================================================
   7. Savings Shortcode
   ========================================================================== */

.spwc-savings-shortcode {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #D1FAE5;
    border: 1px solid #10B981;
    border-radius: 8px;
}

.spwc-savings-shortcode .savings-icon {
    margin-right: 0.5rem;
    font-size: 1.25rem;
}

.spwc-savings-shortcode .savings-text {
    font-size: 0.875rem;
    color: #065F46;
}

.spwc-savings-shortcode .savings-amount {
    font-size: 1.125rem;
    font-weight: 700;
    color: #065F46;
}

/* ==========================================================================
   8. Social Proof Shortcode
   ========================================================================== */

.spwc-social-proof-shortcode {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: 8px;
}

.spwc-social-proof-shortcode .proof-icon {
    font-size: 1.5rem;
}

.spwc-social-proof-shortcode .proof-content {
    flex: 1;
}

.spwc-social-proof-shortcode .proof-title {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400E;
}

.spwc-social-proof-shortcode .proof-message {
    margin: 0;
    font-size: 0.8125rem;
    color: #92400E;
}

/* ==========================================================================
   9. Countdown Shortcode
   ========================================================================== */

.spwc-countdown-shortcode {
    text-align: center;
    padding: 1rem;
    background: #FEF2F2;
    border: 1px solid #EF4444;
    border-radius: 8px;
}

.spwc-countdown-shortcode .countdown-title {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #991B1B;
}

.spwc-countdown-shortcode .countdown-timer {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.spwc-countdown-shortcode .countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}

.spwc-countdown-shortcode .countdown-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #EF4444;
    line-height: 1;
}

.spwc-countdown-shortcode .countdown-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    color: #991B1B;
    margin-top: 0.25rem;
}

.spwc-countdown-shortcode.expired .countdown-value {
    color: #9CA3AF;
}

/* ==========================================================================
   10. Message Shortcodes
   ========================================================================== */

.spwc-message-shortcode {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9375rem;
}

.spwc-message-shortcode.fomo {
    background: #FEF3C7;
    border-left: 4px solid #F59E0B;
    color: #92400E;
}

.spwc-message-shortcode.progress {
    background: #DBEAFE;
    border-left: 4px solid #3B82F6;
    color: #1E40AF;
}

.spwc-message-shortcode.success {
    background: #D1FAE5;
    border-left: 4px solid #10B981;
    color: #065F46;
}

.spwc-message-shortcode .message-icon {
    margin-right: 0.5rem;
}

/* ==========================================================================
   11. Banner Shortcode
   ========================================================================== */

.spwc-banner-shortcode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--spwc-primary, #1E293B);
    color: white;
    border-radius: 8px;
}

.spwc-banner-shortcode.style-gradient {
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
}

.spwc-banner-shortcode.style-outlined {
    background: transparent;
    border: 2px solid var(--spwc-primary, #1E293B);
    color: var(--spwc-primary, #1E293B);
}

.spwc-banner-shortcode .banner-content {
    flex: 1;
}

.spwc-banner-shortcode .banner-text {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.spwc-banner-shortcode .banner-cta {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: white;
    color: var(--spwc-primary, #1E293B);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.2s ease;
}

.spwc-banner-shortcode .banner-cta:hover {
    background: #F3F4F6;
}

.spwc-banner-shortcode.style-outlined .banner-cta {
    background: var(--spwc-primary, #1E293B);
    color: white;
}

.spwc-banner-shortcode.style-outlined .banner-cta:hover {
    background: #334155;
}

/* ==========================================================================
   12. Quick Add Shortcode
   ========================================================================== */

.spwc-quick-add-shortcode {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spwc-quick-add-shortcode .quantity-input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    text-align: center;
    font-size: 0.875rem;
}

.spwc-quick-add-shortcode .quick-add-btn {
    padding: 0.5rem 1rem;
    background: var(--spwc-primary, #1E293B);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.spwc-quick-add-shortcode .quick-add-btn:hover {
    background: #334155;
}

.spwc-quick-add-shortcode .quick-add-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Customer Usage Shortcode */
.spwc-customer-usage-shortcode {
    padding: 1rem;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
}

.spwc-customer-usage-shortcode .usage-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.spwc-customer-usage-shortcode .usage-stat {
    text-align: center;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
}

.spwc-customer-usage-shortcode .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--spwc-primary, #1E293B);
}

.spwc-customer-usage-shortcode .stat-label {
    font-size: 0.75rem;
    color: #6B7280;
}

/* Stats Shortcode */
.spwc-stats-shortcode {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.spwc-stats-shortcode .stat-item {
    flex: 1;
    min-width: 100px;
    padding: 1rem;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    text-align: center;
}

.spwc-stats-shortcode .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--spwc-primary, #1E293B);
}

.spwc-stats-shortcode .stat-label {
    font-size: 0.75rem;
    color: #6B7280;
}

/* ==========================================================================
   13. Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    .spwc-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .spwc-banner-shortcode {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .spwc-incentive-shortcode .incentive-products {
        flex-direction: column;
        align-items: center;
    }

    .spwc-countdown-shortcode .countdown-timer {
        gap: 0.5rem;
    }

    .spwc-countdown-shortcode .countdown-unit {
        min-width: 40px;
    }

    .spwc-countdown-shortcode .countdown-value {
        font-size: 1.25rem;
    }

    .spwc-progress-shortcode.style-steps .spwc-steps {
        flex-direction: column;
        align-items: flex-start;
    }

    .spwc-progress-shortcode.style-steps .spwc-step {
        flex-direction: row;
        width: 100%;
        padding: 0.5rem 0;
    }

    .spwc-progress-shortcode.style-steps .spwc-step-circle {
        margin-right: 0.75rem;
    }

    .spwc-progress-shortcode.style-steps .spwc-step:not(:last-child)::after {
        top: calc(100% - 8px);
        left: 16px;
        width: 2px;
        height: calc(100% - 16px);
    }

    .spwc-rule-details .rule-info-grid {
        grid-template-columns: 1fr;
    }

    .spwc-stats-shortcode {
        flex-direction: column;
    }

    .spwc-stats-shortcode .stat-item {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .spwc-products-grid {
        grid-template-columns: 1fr;
    }

    .spwc-social-proof-shortcode {
        flex-direction: column;
        text-align: center;
    }

    .spwc-quick-add-shortcode {
        flex-direction: column;
        width: 100%;
    }

    .spwc-quick-add-shortcode .quantity-input,
    .spwc-quick-add-shortcode .quick-add-btn {
        width: 100%;
    }
}
