/**
 * MSW Calculator Framework - Styles
 * 
 * Senior-friendly modal and UI elements for all calculators
 */

/* ==========================================================================
   AUTH MODAL
   ========================================================================== */

.msw-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msw-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.msw-modal__content {
    position: relative;
    background: #FFFFFF;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.2s ease;
    z-index: 1;
}

.msw-modal__header {
    padding: 30px 30px 20px 30px;
    border-bottom: 2px solid #E8E8E8;
}

.msw-modal__title {
    margin: 0;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 28px;
    font-weight: 600;
    color: #2E5F6F;
    line-height: 1.3;
}

.msw-modal__body {
    padding: 30px;
}

.msw-modal__message {
    margin: 0;
    font-size: 20px;
    line-height: 1.6;
    color: #333333;
    font-family: 'Verdana', 'Arial', sans-serif;
}

.msw-modal__footer {
    padding: 20px 30px 30px 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ==========================================================================
   BUTTONS (Modal and General)
   ========================================================================== */

.msw-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Verdana', 'Arial', sans-serif;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    min-height: 52px;
    min-width: 140px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.msw-button--primary {
    background: #4A90A4;
    color: #FFFFFF;
    border: 2px solid transparent;
}

.msw-button--primary:hover {
    background: #2E5F6F;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.msw-button--primary:focus {
    outline: 3px solid #E17B65;
    outline-offset: 2px;
}

.msw-button--primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.msw-button--secondary {
    background: #FFFFFF;
    color: #666666;
    border: 2px solid #CCCCCC;
}

.msw-button--secondary:hover {
    background: #F5F5F5;
    border-color: #999999;
    color: #333333;
}

.msw-button--secondary:focus {
    outline: 3px solid #E17B65;
    outline-offset: 2px;
}

/* ==========================================================================
   MESSAGES / NOTIFICATIONS
   ========================================================================== */

.msw-message {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 16px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Verdana', 'Arial', sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100000;
    display: none;
    min-width: 200px;
    max-width: 400px;
}

.msw-message--info {
    background: #E8F4F8;
    color: #2E5F6F;
    border-left: 4px solid #4A90A4;
}

.msw-message--success {
    background: #F0F9F5;
    color: #2E5F3A;
    border-left: 4px solid #6B9F78;
}

.msw-message--error {
    background: #FFF5F5;
    color: #8B2E2E;
    border-left: 4px solid #C76868;
}

/* ==========================================================================
   SAVE/PRINT BUTTON CONTAINER
   ========================================================================== */

.msw-calc-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #E8E8E8;
    flex-wrap: wrap;
}

.msw-calc-actions__save {
    background: #6B9F78;
}

.msw-calc-actions__save:hover {
    background: #4F7D5B;
}

.msw-calc-actions__print {
    background: #4A90A4;
}

.msw-calc-actions__print:hover {
    background: #2E5F6F;
}

/* Save indicator (small text next to button) */
.msw-save-indicator {
    display: inline-block;
    margin-left: 10px;
    font-size: 14px;
    color: #666666;
    font-style: italic;
}

.msw-save-indicator--saving {
    color: #D4925A;
}

.msw-save-indicator--saved {
    color: #6B9F78;
}

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

@media (max-width: 768px) {
    .msw-modal__content {
        width: 95%;
        max-width: none;
    }
    
    .msw-modal__header {
        padding: 20px 20px 15px 20px;
    }
    
    .msw-modal__title {
        font-size: 24px;
    }
    
    .msw-modal__body {
        padding: 20px;
    }
    
    .msw-modal__message {
        font-size: 18px;
    }
    
    .msw-modal__footer {
        padding: 15px 20px 20px 20px;
        flex-direction: column;
    }
    
    .msw-button {
        width: 100%;
    }
    
    .msw-message {
        top: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
    
    .msw-calc-actions {
        flex-direction: column;
    }
    
    .msw-calc-actions .msw-button {
        width: 100%;
    }
}

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

@media print {
    /* Hide modal and messages when printing */
    .msw-modal,
    .msw-message {
        display: none !important;
    }
    
    /* Hide action buttons */
    .msw-calc-actions {
        display: none !important;
    }
    
    /* Ensure good print layout */
    body {
        background: white;
    }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .msw-modal__content {
        border: 3px solid #000000;
    }
    
    .msw-button {
        border-width: 3px;
    }
}

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

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid #E17B65;
    outline-offset: 2px;
}

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