/**
 * MSW Subscription Audit Tool - Styles
 * 
 * Senior-Friendly Design Principles:
 * - Large text (18px minimum)
 * - High contrast colors
 * - Generous spacing and padding
 * - Large click targets (48px minimum)
 * - Clear focus indicators
 * - Accessibility-first approach
 */

/* ==========================================================================
   CALCULATOR CONTAINER
   ========================================================================== */

.msw-calculator {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: #FFFFFF;
    border: 2px solid #CCCCCC;
    border-radius: 8px;
    font-family: 'Verdana', 'Arial', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #333333;
}

/* Header */
.msw-calculator__header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #4A90A4;
}

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

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

/* Instructions */
.msw-calculator__instructions {
    background: #F5F5F5;
    padding: 20px;
    border-left: 4px solid #E17B65;
    border-radius: 4px;
    margin-bottom: 30px;
}

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

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */

.msw-form-section {
    margin-bottom: 40px;
}

.msw-form-section__title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 24px;
    font-weight: 600;
    color: #2E5F6F;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #E8E8E8;
}

/* Form Row */
.msw-form-row {
    margin-bottom: 20px;
}

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

/* Form Group */
.msw-form-group {
    margin-bottom: 0;
}

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

.msw-form-required {
    color: #C76868;
    margin-left: 4px;
}

/* Input Fields */
.msw-form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 18px;
    font-family: 'Verdana', 'Arial', sans-serif;
    border: 2px solid #CCCCCC;
    border-radius: 4px;
    background: #FFFFFF;
    color: #333333;
    min-height: 50px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.msw-form-input:focus {
    outline: none;
    border-color: #4A90A4;
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(74, 144, 164, 0.1);
}

.msw-form-input::placeholder {
    color: #999999;
}

/* Input with Prefix (for $ sign) */
.msw-input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.msw-input-prefix {
    position: absolute;
    left: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #666666;
    pointer-events: none;
}

.msw-form-input--with-prefix {
    padding-left: 36px;
}

/* Select Dropdowns */
.msw-form-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 18px;
    font-family: 'Verdana', 'Arial', sans-serif;
    border: 2px solid #CCCCCC;
    border-radius: 4px;
    background: #FFFFFF;
    color: #333333;
    min-height: 50px;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.msw-form-select:focus {
    outline: none;
    border-color: #4A90A4;
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(74, 144, 164, 0.1);
}

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

.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: 160px;
    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--delete {
    background: #C76868;
    color: #FFFFFF;
    padding: 10px 20px;
    font-size: 16px;
    min-height: 40px;
    min-width: 80px;
}

.msw-button--delete:hover {
    background: #A54545;
}

.msw-button__text {
    display: inline-block;
}

/* ==========================================================================
   ERROR MESSAGES
   ========================================================================== */

.msw-error-message {
    display: none;
    padding: 16px;
    margin-top: 15px;
    background: #FFF5F5;
    border-left: 4px solid #C76868;
    border-radius: 4px;
    color: #C76868;
    font-size: 16px;
    font-weight: 600;
}

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

/* ==========================================================================
   SUBSCRIPTIONS LIST
   ========================================================================== */

.msw-subscriptions-list {
    margin: 40px 0;
}

.msw-subscriptions-table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

.msw-subscriptions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.msw-subscriptions-table thead {
    background: #4A90A4;
    color: #FFFFFF;
}

.msw-subscriptions-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 16px;
}

.msw-subscriptions-table td {
    padding: 16px;
    border-bottom: 1px solid #E8E8E8;
}

.msw-subscriptions-table tbody tr:nth-child(even) {
    background: #F5F5F5;
}

.msw-subscriptions-table tbody tr:hover {
    background: #E8F4F8;
}

.msw-subscriptions-table .msw-sub-name {
    font-weight: 600;
    color: #2E5F6F;
}

.msw-subscriptions-table .msw-sub-category {
    color: #666666;
    font-size: 14px;
    text-transform: capitalize;
}

.msw-subscriptions-table .msw-sub-cost {
    font-weight: 600;
    color: #333333;
}

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

.msw-results {
    margin-top: 40px;
    padding: 30px;
    background: #F5F5F5;
    border-left: 4px solid #6B9F78;
    border-radius: 6px;
}

.msw-results__title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 28px;
    font-weight: 600;
    color: #2E5F6F;
    margin: 0 0 25px 0;
    text-align: center;
}

/* Results Grid */
.msw-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

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

.msw-result-card__label {
    font-size: 16px;
    color: #666666;
    margin-bottom: 10px;
    font-weight: 600;
}

.msw-result-card__value {
    font-size: 36px;
    font-weight: 700;
    color: #2E5F6F;
    line-height: 1.2;
}

/* Category Breakdown */
.msw-category-breakdown {
    margin-top: 30px;
    padding: 24px;
    background: #FFFFFF;
    border-radius: 6px;
    border: 2px solid #E8E8E8;
}

.msw-category-breakdown__title {
    font-size: 20px;
    font-weight: 600;
    color: #2E5F6F;
    margin: 0 0 20px 0;
}

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

.msw-category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #F5F5F5;
    border-radius: 4px;
    font-size: 16px;
}

.msw-category-item__name {
    font-weight: 600;
    color: #333333;
    text-transform: capitalize;
}

.msw-category-item__amount {
    font-weight: 700;
    color: #2E5F6F;
}

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

.msw-insight {
    padding: 16px 20px;
    margin-bottom: 12px;
    background: #FFFBF0;
    border-left: 4px solid #D4925A;
    border-radius: 4px;
    font-size: 16px;
}

.msw-insight__icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 20px;
}

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

.msw-tips {
    margin-top: 40px;
    padding: 24px;
    background: #F0F9FF;
    border-left: 4px solid #7AB8CC;
    border-radius: 6px;
}

.msw-tips__title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 22px;
    font-weight: 600;
    color: #2E5F6F;
    margin: 0 0 16px 0;
}

.msw-tips__list {
    margin: 0;
    padding-left: 25px;
}

.msw-tips__list li {
    margin-bottom: 12px;
    font-size: 16px;
    line-height: 1.6;
}

.msw-tips__list li strong {
    color: #2E5F6F;
}

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

@media (max-width: 768px) {
    .msw-calculator {
        padding: 20px;
        margin: 20px auto;
    }
    
    .msw-calculator__title {
        font-size: 28px;
    }
    
    .msw-form-row--two-col {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .msw-results-grid {
        grid-template-columns: 1fr;
    }
    
    .msw-subscriptions-table {
        font-size: 14px;
    }
    
    .msw-subscriptions-table th,
    .msw-subscriptions-table td {
        padding: 12px 8px;
    }
    
    /* Stack table on very small screens */
    .msw-subscriptions-table thead {
        display: none;
    }
    
    .msw-subscriptions-table tr {
        display: block;
        margin-bottom: 20px;
        border: 2px solid #E8E8E8;
        border-radius: 6px;
        padding: 16px;
        background: #FFFFFF;
    }
    
    .msw-subscriptions-table td {
        display: block;
        text-align: left;
        border-bottom: none;
        padding: 8px 0;
    }
    
    .msw-subscriptions-table td:before {
        content: attr(data-label);
        font-weight: 600;
        display: inline-block;
        width: 120px;
        color: #666666;
    }
}

@media (max-width: 480px) {
    .msw-button {
        width: 100%;
        justify-content: center;
    }
    
    .msw-result-card__value {
        font-size: 28px;
    }
}

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

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

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

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .msw-calculator__form,
    .msw-tips {
        display: none;
    }
    
    .msw-results,
    .msw-subscriptions-list {
        display: block !important;
    }
    
    .msw-button--delete {
        display: none;
    }
}

/* ==========================================================================
   NEW v2 FEATURES - Renewal Date & Related Styles
   ========================================================================== */

/* Form Help Text */
.msw-form-help {
    font-size: 14px;
    color: #666666;
    margin-top: 6px;
    font-style: italic;
}

/* Logged In Notice */
.msw-logged-in-notice {
    display: inline-block;
    padding: 8px 16px;
    background: #F0F9F5;
    color: #2E5F3A;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
}

/* Upcoming Renewals Section */
.msw-upcoming-renewals {
    margin-top: 30px;
    padding: 24px;
    background: #FFFBF0;
    border-left: 4px solid #D4925A;
    border-radius: 6px;
}

.msw-upcoming-renewals__title {
    font-size: 20px;
    font-weight: 600;
    color: #2E5F6F;
    margin: 0 0 20px 0;
}

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

.msw-renewal-item {
    padding: 12px 16px;
    background: #FFFFFF;
    border-radius: 4px;
    font-size: 16px;
    border-left: 3px solid #E17B65;
}

.msw-renewal-item__name {
    font-weight: 600;
    color: #2E5F6F;
}

.msw-renewal-item__date {
    color: #666666;
}

.msw-renewal-item__days {
    color: #D4925A;
    font-weight: 600;
}

.msw-renewal-item__cost {
    font-weight: 700;
    color: #2E5F6F;
    float: right;
}

/* Date Input Styling */
input[type="date"].msw-form-input {
    position: relative;
    cursor: pointer;
}

input[type="date"].msw-form-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.6;
}

input[type="date"].msw-form-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Print-specific styles for new content */
@media print {
    .msw-upcoming-renewals {
        page-break-inside: avoid;
        border: 2px solid #D4925A;
    }
    
    .msw-renewal-item {
        border: 1px solid #E8E8E8;
    }
    
    .msw-logged-in-notice {
        display: none;
    }
}

/* Mobile adjustments for renewal features */
@media (max-width: 768px) {
    .msw-upcoming-renewals {
        padding: 16px;
    }
    
    .msw-renewal-item__cost {
        float: none;
        display: block;
        margin-top: 8px;
    }
}
