/**
 * CRM Plan Card Templates
 *
 * CSS for different plan card template designs with localization and currency support.
 * Each template (plan1, plan2, plan3) has its own unique styling approach.
 */

/* ================================================
   Common Template Styles
   ================================================ */

.crm-template-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.crm-plans-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.crm-plan-card {
    position: relative;
    height: 100%;
}

/* Common elements across all templates */
.plan-title {
    font-weight: 700;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.plan-description {
    margin: 16px 0;
    line-height: 1.6;
    color: #666;
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    margin: 8px 0;
    padding: 4px 0;
}

.benefit-icon {
    color: #22c55e;
    margin-right: 8px;
    font-weight: bold;
    flex-shrink: 0;
}

.signup-button {
    display: inline-block;
    width: 100%;
    padding: 12px 24px;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.signup-button:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

/* ================================================
   Template Plan1 - Classic Professional
   ================================================ */

.crm-template-plan1 .crm-plan-card-plan1 {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.crm-template-plan1 .crm-plan-card-plan1:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
    transform: translateY(-4px);
}

.crm-template-plan1 .plan-title {
    font-size: 1.5rem;
    color: #1f2937;
    text-align: center;
    margin-bottom: 20px;
}

.crm-template-plan1 .plan-trial-pricing {
    text-align: center;
    margin-bottom: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    display: block !important;
    visibility: visible !important;
}

.crm-template-plan1 .trial-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 4px;
}

.crm-template-plan1 .trial-period {
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crm-template-plan1 .plan-subscription-pricing {
    text-align: center;
    margin-bottom: 24px;
    display: block !important;
    visibility: visible !important;
}

.crm-template-plan1 .subscription-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 4px;
}

.crm-template-plan1 .subscription-period {
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crm-template-plan1 .plan-benefits {
    flex-grow: 1;
    margin: 20px 0;
}

.crm-template-plan1 .benefit-item {
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
}

.crm-template-plan1 .benefit-item:last-child {
    border-bottom: none;
}

.crm-template-plan1 .plan-signup {
    margin-top: auto;
    padding-top: 24px;
}

.crm-template-plan1 .signup-button {
    background: #3b82f6;
    color: #ffffff;
    border: 2px solid #3b82f6;
}

.crm-template-plan1 .signup-button:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

/* ================================================
   Template Plan2 - Modern Gradient
   ================================================ */

.crm-template-plan2 .crm-plan-card-plan2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 32px 24px;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.crm-template-plan2 .crm-plan-card-plan2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.crm-template-plan2 .crm-plan-card-plan2:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.crm-template-plan2 .plan-title {
    font-size: 1.6rem;
    color: #ffffff;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.crm-template-plan2 .plan-trial-pricing {
    text-align: center;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    display: block !important;
    visibility: visible !important;
}

.crm-template-plan2 .trial-price {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.crm-template-plan2 .trial-period {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crm-template-plan2 .plan-subscription-pricing {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    display: block !important;
    visibility: visible !important;
}

.crm-template-plan2 .subscription-price {
    font-size: 3rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.crm-template-plan2 .subscription-period {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crm-template-plan2 .plan-description {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin: 16px 0;
}

.crm-template-plan2 .plan-benefits {
    flex-grow: 1;
    margin: 20px 0;
}

.crm-template-plan2 .benefit-item {
    color: rgba(255, 255, 255, 0.95);
    padding: 8px 0;
}

.crm-template-plan2 .benefit-icon {
    color: #fbbf24;
}

.crm-template-plan2 .plan-signup {
    margin-top: auto;
    padding-top: 24px;
}

.crm-template-plan2 .signup-button {
    background: #ffffff;
    color: #667eea;
    border: 2px solid #ffffff;
    font-weight: 700;
}

.crm-template-plan2 .signup-button:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #5a67d8;
    transform: translateY(-2px);
}

/* ================================================
   Template Plan3 - Minimal Clean
   ================================================ */

.crm-template-plan3 .crm-plan-card-plan3 {
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    padding: 40px 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.crm-template-plan3 .crm-plan-card-plan3:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #e5e7eb;
}

.crm-template-plan3 .plan-title {
    font-size: 1.375rem;
    color: #111827;
    text-align: left;
    margin-bottom: 12px;
    font-weight: 600;
}

.crm-template-plan3 .plan-trial-pricing {
    margin-bottom: 8px;
    padding: 0;
    background: none;
}

.crm-template-plan3 .trial-price {
    font-size: 0.875rem;
    font-weight: 500;
    color: #10b981;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crm-template-plan3 .trial-period {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 16px;
}

.crm-template-plan3 .plan-subscription-pricing {
    margin-bottom: 20px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 20px;
}

.crm-template-plan3 .subscription-price {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    margin-bottom: 4px;
}

.crm-template-plan3 .subscription-period {
    font-size: 0.875rem;
    color: #6b7280;
}

.crm-template-plan3 .plan-description {
    color: #4b5563;
    margin: 16px 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.crm-template-plan3 .plan-benefits {
    flex-grow: 1;
    margin: 0;
}

.crm-template-plan3 .benefits-list {
    margin: 0;
}

.crm-template-plan3 .benefit-item {
    padding: 3px 0;
    font-size: 0.875rem;
    color: #374151;
}

.crm-template-plan3 .benefit-icon {
    color: #10b981;
    font-size: 0.75rem;
}

.crm-template-plan3 .plan-signup {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.crm-template-plan3 .signup-button {
    background: #111827;
    color: #ffffff;
    border: 2px solid #111827;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.crm-template-plan3 .signup-button:hover {
    background: #374151;
    border-color: #374151;
    color: #ffffff;
}

/* ================================================
   Responsive Design
   ================================================ */

@media (max-width: 768px) {
    .crm-plans-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .crm-template-plan1 .crm-plan-card-plan1,
    .crm-template-plan2 .crm-plan-card-plan2,
    .crm-template-plan3 .crm-plan-card-plan3 {
        padding: 24px 20px;
    }
    
    .crm-template-plan1 .subscription-price,
    .crm-template-plan2 .subscription-price {
        font-size: 2rem;
    }
    
    .crm-template-plan3 .subscription-price {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .crm-template-plan1 .crm-plan-card-plan1,
    .crm-template-plan2 .crm-plan-card-plan2,
    .crm-template-plan3 .crm-plan-card-plan3 {
        padding: 20px 16px;
    }
    
    .plan-title {
        font-size: 1.25rem;
    }
    
    .crm-template-plan1 .subscription-price,
    .crm-template-plan2 .subscription-price {
        font-size: 1.75rem;
    }
    
    .crm-template-plan3 .subscription-price {
        font-size: 1.5rem;
    }
}

/* ================================================
   Loading States
   ================================================ */

.crm-template-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.crm-template-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================================================
   Error States
   ================================================ */

.crm-template-error {
    padding: 24px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    text-align: center;
    font-weight: 500;
}

/* ================================================
   Dark Mode Support
   ================================================ */

@media (prefers-color-scheme: dark) {
    .crm-template-plan1 .crm-plan-card-plan1 {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .crm-template-plan1 .plan-title {
        color: #f9fafb;
    }
    
    .crm-template-plan1 .subscription-price {
        color: #f9fafb;
    }
    
    .crm-template-plan3 .crm-plan-card-plan3 {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .crm-template-plan3 .plan-title {
        color: #f9fafb;
    }
    
    .crm-template-plan3 .subscription-price {
        color: #f9fafb;
    }
}

/* ================================================
   Print Styles
   ================================================ */

@media print {
    .crm-template-container {
        box-shadow: none !important;
    }
    
    .crm-plan-card-plan1,
    .crm-plan-card-plan2,
    .crm-plan-card-plan3 {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        background: #fff !important;
        color: #000 !important;
    }
    
    .signup-button {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
}
