/**
 * CSPG Elementor Plugin Sales Card V2 CSS
 * 
 * Complete styles for the advanced V2 plugin sales card widget with billing toggle,
 * badges, multiple layouts, and playful geek theme.
 * 
 * @package CSPGPluginSales
 * @since 2.0.47
 */

/* ==========================================================================
   Reset & Base Card Container
   ========================================================================== */

.cspg-plugin-card-v2 {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 24px;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.cspg-plugin-card-v2 * {
    box-sizing: border-box;
}

.cspg-plugin-card-v2:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* ==========================================================================
   Badges (Featured & Top)
   ========================================================================== */

.cspg-badge-v2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: absolute;
    z-index: 10;
    transition: all 0.3s ease;
}

.cspg-badge-v2--featured {
    top: -12px;
    left: 24px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.cspg-badge-v2--featured i,
.cspg-badge-v2--featured svg {
    font-size: 12px;
}

.cspg-badge-v2--top {
    top: -12px;
    right: 24px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.cspg-badge-v2:hover {
    transform: scale(1.05);
}

/* Card with badges - add top padding */
.cspg-plugin-card-v2.has-featured-badge,
.cspg-plugin-card-v2.has-top-badge {
    padding-top: 32px;
}

/* ==========================================================================
   Media Panel
   ========================================================================== */

.cspg-card-v2__media {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.cspg-card-v2__media-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.cspg-card-v2__media-icon {
    font-size: 80px;
    color: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.cspg-card-v2__media-icon i,
.cspg-card-v2__media-icon svg {
    width: 80px;
    height: 80px;
}

/* Aspect Ratios */
.cspg-card-v2__media[data-aspect-ratio="16-9"] {
    aspect-ratio: 16 / 9;
}

.cspg-card-v2__media[data-aspect-ratio="4-3"] {
    aspect-ratio: 4 / 3;
}

.cspg-card-v2__media[data-aspect-ratio="1-1"] {
    aspect-ratio: 1 / 1;
}

/* Corner Styles */
.cspg-card-v2__media[data-corner-style="sharp"] {
    border-radius: 0;
}

.cspg-card-v2__media[data-corner-style="rounded"] {
    border-radius: 12px;
}

.cspg-card-v2__media[data-corner-style="pill"] {
    border-radius: 50px;
}

/* Overlay Patterns */
.cspg-card-v2__media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0.1;
}

.cspg-overlay--geek-grid {
    background-image: 
        linear-gradient(90deg, rgba(52, 152, 219, 0.3) 1px, transparent 1px),
        linear-gradient(rgba(52, 152, 219, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
}

.cspg-overlay--stars {
    background-image: 
        radial-gradient(circle, rgba(241, 196, 15, 0.8) 1px, transparent 1px),
        radial-gradient(circle, rgba(241, 196, 15, 0.6) 1px, transparent 1px);
    background-size: 50px 50px, 80px 80px;
    background-position: 0 0, 25px 25px;
}

/* ==========================================================================
   Content Panel
   ========================================================================== */

.cspg-card-v2__content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cspg-card-v2__title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    line-height: 1.3;
}

.cspg-card-v2__tagline {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0;
    line-height: 1.5;
    font-style: italic;
}

.cspg-card-v2__description {
    font-size: 15px;
    color: #34495e;
    line-height: 1.7;
    margin: 0;
}

.cspg-card-v2__description p {
    margin: 0 0 12px 0;
}

.cspg-card-v2__description p:last-child {
    margin-bottom: 0;
}

/* Feature Bullets */
.cspg-card-v2__features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cspg-card-v2__features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 15px;
    color: #34495e;
    line-height: 1.6;
}

.cspg-card-v2__features li i,
.cspg-card-v2__features li svg {
    color: #27ae60;
    font-size: 16px;
    margin-top: 3px;
    flex-shrink: 0;
}

/* ==========================================================================
   Pricing Section
   ========================================================================== */

.cspg-card-v2__pricing-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid #ecf0f1;
    border-bottom: 1px solid #ecf0f1;
}

/* Billing Toggle */
.cspg-billing-toggle-v2 {
    display: inline-flex;
    background: #ecf0f1;
    border-radius: 50px;
    padding: 4px;
    gap: 4px;
}

.cspg-billing-toggle-v2__button {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cspg-billing-toggle-v2__button:hover {
    color: #2c3e50;
}

.cspg-billing-toggle-v2__button--active {
    background: #3498db;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* Price Display */
.cspg-price-v2-container {
    position: relative;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cspg-price-v2 {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-weight: 700;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.cspg-price-v2--hidden {
    display: none;
}

.cspg-price-v2--active {
    display: flex;
    animation: priceSlideIn 0.4s ease;
}

@keyframes priceSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cspg-price-v2__currency {
    font-size: 24px;
    color: #7f8c8d;
}

.cspg-price-v2__amount {
    font-size: 48px;
    line-height: 1;
}

.cspg-price-v2__unit {
    font-size: 16px;
    color: #7f8c8d;
    font-weight: 500;
}

/* Savings Badge */
.cspg-savings-v2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.cspg-savings-v2 i,
.cspg-savings-v2 svg {
    font-size: 12px;
}

/* ==========================================================================
   Call to Actions (Buttons)
   ========================================================================== */

.cspg-actions-v2 {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.cspg-button-v2 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.cspg-button-v2__icon {
    font-size: 18px;
}

.cspg-button-v2__icon--before {
    margin-right: 4px;
}

.cspg-button-v2__icon--after {
    margin-left: 4px;
}

/* Primary Button */
.cspg-button-v2--primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.cspg-button-v2--primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    transform: translateY(-2px);
}

.cspg-button-v2--primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* Secondary Button */
.cspg-button-v2--secondary {
    background: transparent;
    color: #3498db;
    border-color: #3498db;
}

.cspg-button-v2--secondary:hover {
    background: #3498db;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

.cspg-button-v2--secondary:active {
    transform: translateY(0);
}

/* ==========================================================================
   Trust Row
   ========================================================================== */

.cspg-trust-v2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #95a5a6;
    margin-top: 16px;
    padding-top: 0;
    position: relative;
}

.cspg-trust-v2--separator {
    padding-top: 16px;
}

.cspg-trust-v2--separator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: #ecf0f1;
}

.cspg-trust-v2 i,
.cspg-trust-v2 svg {
    font-size: 14px;
    color: #27ae60;
}

/* ==========================================================================
   Layout Variants
   ========================================================================== */

/* Layout A - Side-by-Side (Desktop), Stacked (Mobile) */
.cspg-plugin-card-v2--layout_a {
    flex-direction: column;
}

@media (min-width: 769px) {
    .cspg-plugin-card-v2--layout_a {
        flex-direction: row;
        gap: 32px;
    }
    
    .cspg-plugin-card-v2--layout_a .cspg-card-v2__media {
        flex: 0 0 40%;
        max-width: 40%;
    }
    
    .cspg-plugin-card-v2--layout_a .cspg-card-v2__content {
        flex: 1;
    }
}

/* Layout B - Stacked Centered */
.cspg-plugin-card-v2--layout_b {
    text-align: center;
    align-items: center;
}

.cspg-plugin-card-v2--layout_b .cspg-card-v2__media {
    max-width: 400px;
    margin: 0 auto;
}

.cspg-plugin-card-v2--layout_b .cspg-actions-v2 {
    flex-direction: column;
}

.cspg-plugin-card-v2--layout_b .cspg-button-v2 {
    width: 100%;
    max-width: 300px;
}

/* Layout C - Minimal (Text-Heavy) */
.cspg-plugin-card-v2--layout_c {
    flex-direction: column;
}

.cspg-plugin-card-v2--layout_c .cspg-card-v2__media {
    display: none;
}

.cspg-plugin-card-v2--layout_c .cspg-card-v2__pricing-wrapper {
    border: none;
    padding: 12px 0;
}

.cspg-plugin-card-v2--layout_c .cspg-actions-v2 {
    justify-content: flex-start;
}

/* ==========================================================================
   Responsive Styles - Mobile First
   ========================================================================== */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .cspg-plugin-card-v2 {
        padding: 20px;
        gap: 20px;
    }
    
    .cspg-badge-v2--featured {
        left: 20px;
    }
    
    .cspg-badge-v2--top {
        right: 20px;
    }
    
    .cspg-card-v2__title {
        font-size: 24px;
    }
    
    .cspg-card-v2__tagline {
        font-size: 14px;
    }
    
    .cspg-price-v2__amount {
        font-size: 40px;
    }
    
    .cspg-price-v2__currency {
        font-size: 20px;
    }
    
    .cspg-actions-v2 {
        flex-direction: column;
        width: 100%;
    }
    
    .cspg-button-v2 {
        width: 100%;
    }
    
    .cspg-billing-toggle-v2 {
        width: 100%;
    }
    
    .cspg-billing-toggle-v2__button {
        flex: 1;
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .cspg-plugin-card-v2 {
        padding: 16px;
        gap: 16px;
        border-radius: 12px;
    }
    
    .cspg-badge-v2 {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .cspg-badge-v2--featured {
        left: 16px;
    }
    
    .cspg-badge-v2--top {
        right: 16px;
        top: -10px;
    }
    
    .cspg-card-v2__title {
        font-size: 20px;
    }
    
    .cspg-card-v2__tagline {
        font-size: 13px;
    }
    
    .cspg-card-v2__description,
    .cspg-card-v2__features li {
        font-size: 14px;
    }
    
    .cspg-price-v2__amount {
        font-size: 36px;
    }
    
    .cspg-button-v2 {
        padding: 12px 24px;
        font-size: 15px;
    }
    
    .cspg-card-v2__media-icon {
        font-size: 60px;
        padding: 30px;
    }
}

/* ==========================================================================
   Elementor Editor Styles
   ========================================================================== */

.elementor-editor-active .cspg-plugin-card-v2 {
    pointer-events: auto;
}

.elementor-editor-active .cspg-button-v2 {
    pointer-events: none;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.cspg-plugin-card-v2 .elementor-widget-container {
    width: 100%;
}

/* JavaScript-enhanced states */
.cspg-card-v2__pricing-wrapper.cspg-highlight {
    animation: highlightPulse 1.5s ease;
}

@keyframes highlightPulse {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(52, 152, 219, 0.1);
    }
}

.cspg-badge-v2--pulse {
    animation: badgePulse 0.6s ease;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.cspg-button-v2--loading {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}

.cspg-button-v2--success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%) !important;
    animation: successPulse 0.4s ease;
}

@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Screen reader only */
.cspg-sr-live-region {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Print Styles */
@media print {
    .cspg-plugin-card-v2 {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .cspg-badge-v2 {
        position: static;
        display: inline-flex;
        margin-bottom: 10px;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    .cspg-plugin-card-v2 {
        background: #1e1e1e;
        border-color: #333;
        color: #e0e0e0;
    }
    
    .cspg-card-v2__title {
        color: #ffffff;
    }
    
    .cspg-card-v2__tagline,
    .cspg-card-v2__description,
    .cspg-card-v2__features li {
        color: #b0b0b0;
    }
}
