/* Public Styles for CRM Pricing Calculator */

.crm-calculator-container {
    max-width: 1000px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.crm-calculator-container.loaded {
    opacity: 1;
    transform: translateY(0);
}

.crm-calculator-header {
    background-color: #2563EB;
    color: #ffffff;
    padding: 24px;
    text-align: center;
}

.crm-calculator-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 600;
    color: #ffffff;
}

.crm-calculator-subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

.crm-calculator-content {
    padding: 24px;
}

/* Modules Table */
.crm-calculator-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 30px;
}

.crm-calculator-table th,
.crm-calculator-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.crm-calculator-table thead th {
    background-color: #f3f4f6;
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
}

.crm-calculator-table th.module-select {
    width: 60px;
}

.crm-calculator-table th.module-name {
    width: 20%;
}

.crm-calculator-table th.module-price {
    width: 15%;
    text-align: right;
}

.crm-calculator-table td.module-price {
    text-align: right;
    font-weight: 600;
}

.module-row {
    transition: background-color 0.2s ease;
}

.module-row:hover {
    background-color: #f9fafb;
}

.module-row.selected {
    background-color: #f0f9ff;
}

/* Checkboxes */
.crm-checkbox-container {
    display: block;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 16px;
    user-select: none;
    margin: 0;
}

.crm-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.crm-checkbox-container:hover input ~ .checkmark {
    border-color: #2563EB;
}

.crm-checkbox-container input:checked ~ .checkmark {
    background-color: #2563EB;
    border-color: #2563EB;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.crm-checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.crm-checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Summary Section */
.crm-calculator-summary {
    background-color: #f3f4f6;
    padding: 24px;
    border-radius: 6px;
}

.crm-calculator-summary h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 20px;
    color: #1f2937;
}

.crm-calculator-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.crm-calculator-summary-table th,
.crm-calculator-summary-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.crm-calculator-summary-table th.summary-price,
.crm-calculator-summary-table td.summary-price {
    text-align: right;
}

.crm-calculator-summary-table .empty-selection td {
    text-align: center;
    color: #6b7280;
    padding: 20px;
}

.crm-calculator-summary-table .total-row {
    font-weight: 700;
    color: #1f2937;
    font-size: 18px;
}

.crm-calculator-summary-table .total-row td {
    padding: 16px 12px;
    border-top: 2px solid #d1d5db;
    border-bottom: none;
}

.total-price {
    transition: color 0.3s ease;
    
}

.total-price.price-updated {
    color: #2563EB;
}

/* Button */
.crm-calculator-button {
    background-color: #2563EB;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: block;
    margin-top: 20px;
    width: 100%;
    max-width: 200px;
}

.crm-calculator-button:hover {
    background-color: #1d4ed8;
}

.crm-calculator-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.crm-calculator-button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.crm-calculator-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

/* No Modules Message */
.crm-calculator-no-modules {
    padding: 40px;
    text-align: center;
    color: #6b7280;
    background-color: #f9fafb;
    border-radius: 6px;
}

/* Selected Module Animation */
.selected-module {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .crm-calculator-container {
        margin: 20px 10px;
        border-radius: 6px;
    }
    
    .crm-calculator-header {
        padding: 16px;
    }
    
    .crm-calculator-header h2 {
        font-size: 24px;
    }
    
    .crm-calculator-content {
        padding: 16px;
    }
    
    .crm-calculator-table th.module-description,
    .crm-calculator-table td.module-description {
        display: none;
    }
    
    .crm-calculator-table th.module-name {
        width: auto;
    }
    
    .crm-calculator-summary {
        padding: 16px;
    }
    
    .crm-calculator-actions {
        justify-content: center;
    }
    
    .crm-calculator-button {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .crm-calculator-table {
        display: block;
        overflow-x: auto;
    }
    
    .crm-calculator-header h2 {
        font-size: 20px;
    }
    
    .crm-calculator-subtitle {
        font-size: 14px;
    }
}