/**
 * MSW Medication Cost Comparison - Styles
 * Version: 1.1.1
 * Senior-friendly design: 18px+ fonts, high contrast, large touch targets
 */

/* ==========================================================================
   BASE CALCULATOR STYLES
   ========================================================================== */

.msw-medication-cost {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333333;
    line-height: 1.6;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.msw-calculator__header {
    text-align: center;
    margin-bottom: 30px;
}

.msw-calculator__title {
    font-size: 32px;
    font-weight: 700;
    color: #2E5A78;
    margin: 0 0 10px 0;
}

.msw-calculator__subtitle {
    font-size: 20px;
    color: #666666;
    margin: 0;
}

/* ==========================================================================
   INSTRUCTIONS
   ========================================================================== */

.msw-calculator__instructions {
    background: #E8F4F8;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #4A7C9D;
}

.msw-calculator__instructions p {
    font-size: 18px;
    margin: 0;
}

/* ==========================================================================
   FORM SECTION
   ========================================================================== */

.msw-form-section {
    background: #FFFFFF;
    padding: 30px;
    border-radius: 8px;
    border: 2px solid #E8E8E8;
    margin-bottom: 30px;
}

.msw-form-section__title {
    font-size: 24px;
    font-weight: 600;
    color: #2E5A78;
    margin: 0 0 20px 0;
}

.msw-form-row {
    margin-bottom: 20px;
}

.msw-form-row--two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.msw-form-row--three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.msw-form-group {
    display: flex;
    flex-direction: column;
}

.msw-form-label {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 8px;
}

.msw-form-input {
    padding: 14px;
    font-size: 18px;
    border: 2px solid #CCCCCC;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.msw-form-input:focus {
    outline: 3px solid #4A7C9D;
    outline-offset: 2px;
    border-color: #4A7C9D;
}

.msw-form-select {
    font-size: 18px;
    border: 2px solid #CCCCCC;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    background: #FFFFFF;
    cursor: pointer;
}

.msw-form-select:focus {
    outline: 3px solid #4A7C9D;
    outline-offset: 2px;
    border-color: #4A7C9D;
}

/* ==========================================================================
   CHECKBOX
   ========================================================================== */

.msw-checkbox-group {
    padding-top: 10px;
}

.msw-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 18px;
}

.msw-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.msw-button {
    padding: 14px 28px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.msw-button--primary {
    background: #4A7C9D;
    color: #FFFFFF;
}

.msw-button--primary:hover {
    background: #3A6A8A;
}

.msw-button__text {
    pointer-events: none;
}

/* ==========================================================================
   ERROR MESSAGE
   ========================================================================== */

.msw-error-message {
    background: #FFE8E8;
    color: #C76868;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    display: none;
    margin-top: 15px;
    border: 1px solid #F0C0C0;
}

.msw-error-message.active {
    display: block;
}

/* ==========================================================================
   MEDICATIONS LIST
   ========================================================================== */

.msw-medications-list {
    margin-bottom: 30px;
}

.msw-medication-card {
    background: #FFFFFF;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #E8E8E8;
    margin-bottom: 15px;
}

.msw-medication-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #E8F4F8;
}

.msw-medication-header h4 {
    font-size: 20px;
    font-weight: 600;
    color: #2E5A78;
    margin: 0;
}

.msw-button-remove {
    width: 32px;
    height: 32px;
    background: #FFE8E8;
    color: #C76868;
    border: none;
    border-radius: 4px;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.msw-button-remove:hover {
    background: #C76868;
    color: #FFFFFF;
}

.msw-medication-details p {
    margin: 8px 0;
    font-size: 16px;
}

/* ==========================================================================
   RESULTS SECTION
   ========================================================================== */

.msw-results {
    background: #FFFFFF;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 2px solid #4A7C9D;
}

.msw-results__title {
    font-size: 28px;
    font-weight: 600;
    color: #2E5A78;
    margin: 0 0 25px 0;
    text-align: center;
}

.msw-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.msw-result-card {
    background: #F9F9F9;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    border: 2px solid #E8E8E8;
}

.msw-result-card--primary {
    background: #E8F4F8;
    border-color: #4A7C9D;
}

.msw-result-card__label {
    font-size: 14px;
    color: #666666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.msw-result-card__value {
    font-size: 36px;
    font-weight: 700;
    color: #2E5A78;
    margin-bottom: 5px;
}

.msw-result-card__value--text {
    font-size: 24px;
}

.msw-result-card__note {
    font-size: 13px;
    color: #999999;
}

/* ==========================================================================
   MEDICATION COMPARISONS
   ========================================================================== */

.msw-medication-comparisons {
    margin-bottom: 30px;
}

.msw-medication-comparison {
    background: #F9F9F9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #E8E8E8;
}

.msw-comparison-title {
    font-size: 18px;
    font-weight: 600;
    color: #2E5A78;
    margin: 0 0 15px 0;
}

.msw-price-list {
    display: grid;
    gap: 10px;
}

.msw-price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #FFFFFF;
    border-radius: 4px;
    border: 1px solid #E8E8E8;
}

.msw-price-item--best {
    background: #F0F9F5;
    border-color: #6B9F78;
    border-width: 2px;
}

.msw-price-pharmacy {
    font-weight: 600;
    color: #333333;
}

.msw-best-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 8px;
    background: #6B9F78;
    color: #FFFFFF;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 600;
}

.msw-price-amount {
    font-size: 18px;
    font-weight: 700;
    color: #2E5A78;
}

/* ==========================================================================
   PHARMACY TOTALS
   ========================================================================== */

.msw-pharmacy-totals {
    background: #E8F4F8;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.msw-section-subtitle {
    font-size: 20px;
    font-weight: 600;
    color: #2E5A78;
    margin: 0 0 15px 0;
}

.msw-pharmacy-list {
    display: grid;
    gap: 12px;
}

.msw-pharmacy-total-item {
    background: #FFFFFF;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #E8E8E8;
}

.msw-pharmacy-total-item--best {
    border-color: #6B9F78;
    border-width: 2px;
    background: #F0F9F5;
}

.msw-pharmacy-name {
    font-size: 18px;
    font-weight: 600;
    color: #2E5A78;
    margin-bottom: 5px;
}

.msw-pharmacy-total {
    font-size: 24px;
    font-weight: 700;
    color: #333333;
    margin-bottom: 5px;
}

.msw-pharmacy-note {
    font-size: 14px;
    color: #666666;
    font-style: italic;
}

/* ==========================================================================
   INSIGHTS
   ========================================================================== */

.msw-insights {
    margin-top: 30px;
}

.msw-insight {
    display: flex;
    gap: 15px;
    padding: 16px;
    background: #E8F4F8;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 4px solid #4A7C9D;
}

.msw-insight__icon {
    font-size: 24px;
    flex-shrink: 0;
}

/* ==========================================================================
   ACTION BUTTONS
   ========================================================================== */

.msw-calc-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.msw-calc-actions__save {
    background: #6B9F78;
    color: #FFFFFF;
    border: 2px solid #6B9F78;
}

.msw-calc-actions__save:hover {
    background: #5A8A67;
    border-color: #5A8A67;
}

.msw-calc-actions__print {
    background: #FFFFFF;
    color: #2E5A78;
    border: 2px solid #2E5A78;
}

.msw-calc-actions__print:hover {
    background: #2E5A78;
    color: #FFFFFF;
}

/* ==========================================================================
   TIPS SECTION
   ========================================================================== */

.msw-tips {
    background: #F9F9F9;
    padding: 30px;
    border-radius: 8px;
    border: 2px solid #E8E8E8;
}

.msw-tips__title {
    font-size: 24px;
    font-weight: 600;
    color: #2E5A78;
    margin: 0 0 20px 0;
}

.msw-tips__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.msw-tips__list li {
    padding: 12px 0 12px 35px;
    position: relative;
    border-bottom: 1px solid #E8E8E8;
}

.msw-tips__list li:last-child {
    border-bottom: none;
}

.msw-tips__list li::before {
    content: "💊";
    position: absolute;
    left: 0;
    font-size: 20px;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .msw-calculator__instructions,
    .msw-form-section,
    .msw-calc-actions,
    .msw-tips,
    .msw-button-remove {
        display: none !important;
    }
    
    .msw-results,
    .msw-medications-list {
        page-break-inside: avoid;
    }
    
    body {
        background: white;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .msw-medication-cost {
        padding: 20px 15px;
    }
    
    .msw-calculator__title {
        font-size: 28px;
    }
    
    .msw-calculator__subtitle {
        font-size: 18px;
    }
    
    .msw-form-section {
        padding: 20px;
    }
    
    .msw-form-row--two-col,
    .msw-form-row--three-col {
        grid-template-columns: 1fr;
    }
    
    .msw-results-grid {
        grid-template-columns: 1fr;
    }
    
    .msw-result-card__value {
        font-size: 28px;
    }
    
    .msw-price-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .msw-calc-actions {
        flex-direction: column;
    }
    
    .msw-calc-actions .msw-button {
        width: 100%;
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* High contrast mode */
@media (prefers-contrast: high) {
    .msw-form-select,
    .msw-form-input,
    .msw-medication-card {
        border-width: 3px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible */
*:focus-visible {
    outline: 3px solid #4A7C9D;
    outline-offset: 2px;
}

/* Screen reader only */
.msw-sr-only {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
