/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    color: #333;
    line-height: 1.5;
    padding: 20px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Main Container */
.calculator-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Input Section - 5 Row Layout */
.input-section {
    background: #f8f9fa;
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 32px;
    border: 2px solid #9ca3af;
}

.input-row {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.input-row:last-child {
    margin-bottom: 0;
}

.row-label {
    font-weight: 700;
    font-size: 14px;
    color: #1f2937;
    min-width: 180px;
    flex-shrink: 0;
}

/* Row 1: PDF Count Controls */
.pdf-count-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.pdf-input {
    padding: 10px 14px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    width: 80px;
    transition: border-color 0.2s ease;
    background: white;
}

.pdf-input:focus {
    outline: none;
    border-color: #6b7280;
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    max-width: 300px;
}

.pdf-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e1e5e9;
    outline: none;
    cursor: pointer;
}

.pdf-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-slider::-webkit-slider-thumb:hover {
    background: #4b5563;
    transform: scale(1.1);
}

.pdf-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6b7280;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.pdf-slider::-moz-range-thumb:hover {
    background: #4b5563;
    transform: scale(1.1);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* Button Groups for Rows 2, 3, 4 */
.button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.button-group input[type="radio"] {
    display: none;
}

.button-option {
    padding: 10px 16px;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    flex: 1;
    text-align: center;
    min-width: fit-content;
}

.button-option:hover {
    border-color: #6b7280;
    color: #4b5563;
    transform: translateY(-1px);
}

.button-group input[type="radio"]:checked + .button-option {
    background: #6b7280;
    border-color: #6b7280;
    color: white;
}

/* Row 5: Calculate Button */
.calculate-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.calculate-btn:hover {
    background: linear-gradient(135deg, #3730a3 0%, #312e81 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Results Section - Updated Design with Boxes */
.results-section {
    display: flex;
    flex-direction: column;
}

.platform-card {
    background: #fafafa;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 80px;
    position: relative;
}

.platform-card:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 1px;
    background: #d1d5db;
}

.platform-header {
    background: transparent;
    padding: 0 0 16px 0;
}

.platform-name {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #1f2937;
}

.platform-description {
    font-size: 14px;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
}

/* Plans Container */
.plans-container {
    padding: 4px 0 4px 0;
    display: flex;
    gap: 16px;
    overflow-x: auto;
}

.plan-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 200px;
}

.plan-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.plan-item.highlighted {
    background: #eff6ff;
    border: 2px solid #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.plan-item.highlighted::before {
    content: "✓ Matches your needs";
    display: block;
    background: #10b981;
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    width: fit-content;
    font-weight: 600;
}

/* Learn More Button for Titlegram */
.learn-more-btn {
    background: #323232;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
    width: 100%;
}

.learn-more-btn:hover {
    background: #5a0794;
    transform: translateY(-1px);
}

/* Plan Details */
.plan-name {
    font-weight: 700;
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 4px;
}

.plan-price {
    font-size: 20px;
    font-weight: 800;
    color: #4f46e5;
    margin-bottom: 8px;
}

.plan-features {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .calculator-container {
        max-width: 100%;
    }
    
    .input-section {
        padding: 24px;
    }
    
    .input-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .row-label {
        min-width: auto;
        margin-bottom: 8px;
    }
    
    .button-group {
        flex-direction: column;
        width: 100%;
    }
    
    .button-option {
        flex: none;
    }
    
    .pdf-count-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }
    
    .slider-container {
        max-width: none;
        width: 100%;
    }
    
    .platform-name {
        font-size: 20px;
    }
    
    .plans-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .plan-item {
        min-width: auto;
    }
    
    .platform-card {
        margin-bottom: 60px;
    }
    
    .platform-card:not(:last-child)::after {
        bottom: -30px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
