/**
 * Elementor CRM Widgets Styles
 *
 * Default styling for CRM Elementor widgets and dynamic content.
 * These styles provide a solid foundation that can be customized via Elementor's style controls.
 */

/* ================================================
   CRM Product Card Styles
   ================================================ */

.crm-product-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.crm-product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.crm-product-card .product-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #333333;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.crm-product-card .product-price {
    font-size: 2em;
    font-weight: 700;
    color: #2c5aa0;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.crm-product-card .product-trial {
    background: #e7f3ff;
    color: #2c5aa0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
    margin: 0 0 16px 0;
    text-align: center;
}

.crm-product-card .product-description {
    color: #666666;
    line-height: 1.6;
    margin: 0 0 24px 0;
    flex-grow: 1;
}

.crm-product-card .product-button-wrapper {
    margin-top: auto;
}

.crm-product-card .signup-button {
    display: inline-block;
    width: 100%;
    padding: 12px 24px;
    background: #2c5aa0;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

.crm-product-card .signup-button:hover {
    background: #1e3f73;
    color: #ffffff;
    text-decoration: none;
}

.crm-product-card .signup-button:focus {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

/* ================================================
   CRM Products Grid Styles
   ================================================ */

.crm-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
}

.crm-products-grid .crm-product-card {
    margin: 0;
}

/* ================================================
   Responsive Design
   ================================================ */

@media (max-width: 768px) {
    .crm-products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .crm-product-card {
        padding: 20px;
    }
    
    .crm-product-card .product-title {
        font-size: 1.3em;
    }
    
    .crm-product-card .product-price {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .crm-product-card {
        padding: 16px;
    }
    
    .crm-product-card .product-title {
        font-size: 1.2em;
        margin-bottom: 12px;
    }
    
    .crm-product-card .product-price {
        font-size: 1.6em;
        margin-bottom: 10px;
    }
    
    .crm-product-card .signup-button {
        padding: 10px 20px;
        font-size: 0.95em;
    }
}

/* ================================================
   Error States
   ================================================ */

.crm-product-card-error,
.crm-products-grid-error {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
    text-align: center;
    font-style: italic;
}

/* ================================================
   Loading States
   ================================================ */

.crm-product-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.crm-product-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================================================
   Accessibility Improvements
   ================================================ */

.crm-product-card .signup-button:focus-visible {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .crm-product-card,
    .crm-product-card .signup-button {
        transition: none;
    }
    
    .crm-product-card:hover {
        transform: none;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
}

/* ================================================
   High Contrast Support
   ================================================ */

@media (prefers-contrast: high) {
    .crm-product-card {
        border-color: #000000;
        border-width: 2px;
    }
    
    .crm-product-card .signup-button {
        border: 2px solid #000000;
    }
    
    .crm-product-card .product-trial {
        border: 1px solid #2c5aa0;
    }
}

/* ================================================
   Theme Customization Hooks
   ================================================ */

/* Allow themes to easily override colors */
.crm-product-card {
    --card-bg: #ffffff;
    --card-border: #e1e1e1;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --title-color: #333333;
    --price-color: #2c5aa0;
    --description-color: #666666;
    --button-bg: #2c5aa0;
    --button-text: #ffffff;
    --button-hover-bg: #1e3f73;
    
    background: var(--card-bg);
    border-color: var(--card-border);
    box-shadow: 0 2px 8px var(--card-shadow);
}

.crm-product-card .product-title {
    color: var(--title-color);
}

.crm-product-card .product-price {
    color: var(--price-color);
}

.crm-product-card .product-description {
    color: var(--description-color);
}

.crm-product-card .signup-button {
    background: var(--button-bg);
    color: var(--button-text);
}

.crm-product-card .signup-button:hover {
    background: var(--button-hover-bg);
}
