/**
 * Cost Calculator Styles
 * File: /platform/assets/css/cost-calculator.css
 * 
 * Custom styles for the VistarKriya platform cost calculator
 * Uses unique prefixed variables and classes to avoid conflicts
 */

/* Calculator-specific variables */
.calc-container {
    --vk-calc-primary: #667eea;
    --vk-calc-primary-dark: #5568d3;
    --vk-calc-secondary: #764ba2;
    --vk-calc-accent: #f093fb;
    --vk-calc-success: #10b981;
    --vk-calc-warning: #f59e0b;
    --vk-calc-danger: #ef4444;
    --vk-calc-text: #1a1a1a;
    --vk-calc-text-muted: #6b7280;
    --vk-calc-light: #f8f9fa;
    --vk-calc-border: #e5e7eb;
    --vk-calc-shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.07);
    --vk-calc-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.1);
    --vk-calc-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Container and Layout */
.calc-container {
    max-width: 1200px;
    margin: 2rem auto;
    background: white;
    border-radius: 1.5rem;
    box-shadow: var(--vk-calc-shadow-lg);
    overflow: hidden;
}

.calc-header {
    background: linear-gradient(135deg, var(--vk-calc-primary), var(--vk-calc-secondary));
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.calc-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.calc-body {
    padding: 3rem 2rem;
    background: white;
}

/* Journey Selector */
.journey-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

.journey-card {
    flex: 1;
    padding: 1.5rem;
    border: 2px solid var(--vk-calc-border);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: white;
}

.journey-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--vk-calc-shadow-md);
    border-color: var(--vk-calc-primary);
}

.journey-card.selected {
    border-color: var(--vk-calc-primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.journey-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--vk-calc-text);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-badge {
    background: linear-gradient(135deg, var(--vk-calc-primary), var(--vk-calc-secondary));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Plan Selector */
.plan-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.plan-option {
    padding: 1.25rem;
    border: 2px solid var(--vk-calc-border);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

.plan-option:hover {
    transform: translateY(-3px);
    box-shadow: var(--vk-calc-shadow-md);
    border-color: var(--vk-calc-primary);
}

.plan-option.selected {
    border-color: var(--vk-calc-primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.plan-option h5 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Chapter Grid */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chapter-card {
    border: 2px solid var(--vk-calc-border);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
    position: relative;
}

.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--vk-calc-shadow-md);
    border-color: var(--vk-calc-primary);
}

.chapter-card.selected {
    border-color: var(--vk-calc-success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(5, 150, 105, 0.05));
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.chapter-card.selected::after {
    content: '✓';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 24px;
    height: 24px;
    background: var(--vk-calc-success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.chapter-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--vk-calc-primary), var(--vk-calc-secondary));
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.chapter-card h5 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

/* VIP Section */
.vip-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem 0;
    border: 2px solid #fbbf24;
}

.vip-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.vip-discount-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.discount-option {
    padding: 1rem;
    background: white;
    border: 2px solid #fbbf24;
    border-radius: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.discount-option:hover {
    transform: scale(1.05);
    box-shadow: var(--vk-calc-shadow-sm);
}

.discount-option.selected {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.2);
}

.discount-option .fs-2 {
    font-size: 2rem;
    line-height: 1.2;
}

/* Cost Summary */
.cost-summary {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid var(--vk-calc-success);
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 2rem;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.cost-item:last-child {
    border-bottom: none;
    padding-top: 1rem;
    padding-bottom: 0;
}

.cost-label {
    font-weight: 600;
    color: var(--vk-calc-text);
}

.cost-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--vk-calc-primary);
}

.total-cost {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--vk-calc-primary), var(--vk-calc-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.savings-badge {
    display: inline-block;
    background: var(--vk-calc-success);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Billing Toggle */
.billing-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1rem;
    background: var(--vk-calc-light);
    border-radius: 0.75rem;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--vk-calc-border);
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: var(--vk-calc-primary);
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(30px);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--vk-calc-border);
}

.btn-vk-primary {
    background: linear-gradient(135deg, var(--vk-calc-primary), var(--vk-calc-secondary));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-vk-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-vk-outline {
    background: white;
    color: var(--vk-calc-primary);
    border: 2px solid var(--vk-calc-primary);
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-vk-outline:hover {
    background: var(--vk-calc-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.alert-warning {
    background-color: #fef3c7;
    border: 1px solid #fbbf24;
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    border: 1px solid #60a5fa;
    color: #1e40af;
}

/* Disabled State */
section[style*="opacity: 0.5"] {
    pointer-events: none;
    user-select: none;
}

/* Responsive Design */
@media (max-width: 991px) {
    .chapter-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .plan-selector {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .journey-selector {
        flex-direction: column;
    }
    
    .chapter-grid {
        grid-template-columns: 1fr;
    }
    
    .calc-body {
        padding: 2rem 1rem;
    }
    
    .calc-header {
        padding: 2rem 1rem;
    }
    
    .calc-header h1 {
        font-size: 1.75rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-vk-primary,
    .btn-vk-outline {
        width: 100%;
        justify-content: center;
    }
    
    .vip-discount-selector {
        grid-template-columns: 1fr;
    }
    
    .cost-summary {
        padding: 1.5rem 1rem;
    }
    
    .total-cost {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 1.25rem;
    }
    
    .section-badge {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }
    
    .billing-toggle {
        font-size: 0.875rem;
    }
    
    .toggle-switch {
        width: 50px;
        height: 25px;
    }
    
    .toggle-slider {
        width: 19px;
        height: 19px;
    }
    
    .toggle-switch.active .toggle-slider {
        transform: translateX(25px);
    }
}

/* Print Styles */
@media print {
    .calc-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .action-buttons {
        display: none;
    }
    
    .journey-selector,
    .plan-selector,
    .chapter-grid {
        display: block;
    }
    
    .journey-card,
    .plan-option,
    .chapter-card {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
}