/* Tax Free Childcare Calculator - Styles */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.header__title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header__subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Main content */
.main {
    padding: 2rem 0;
}

.section-title {
    font-size: 2rem;
    color: #1e3a8a;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Information section */
.info-section {
    margin-bottom: 3rem;
}

.info-content {
    display: grid;
    gap: 2rem;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3b82f6;
}

.info-card h3 {
    color: #1e3a8a;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.info-card h4 {
    color: #374151;
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem 0;
}

.info-card p {
    margin-bottom: 1rem;
    color: #4b5563;
}

.info-card ul, .info-card ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.info-card li {
    margin-bottom: 0.5rem;
    color: #4b5563;
}

/* Example box */
.example-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.example-box h4 {
    color: #0c4a6e;
    margin-bottom: 1rem;
}

.example-list {
    list-style: none;
    padding: 0;
}

.example-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0f2fe;
}

.example-list li:last-child {
    border-bottom: none;
}

.example-list strong {
    color: #0c4a6e;
}

/* Eligibility grid */
.eligibility-grid {
    display: grid;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.eligibility-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.eligibility-item h4 {
    color: #1e40af;
    margin-bottom: 1rem;
}

/* Important note */
.important-note {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.important-note h4 {
    color: #92400e;
    margin-bottom: 1rem;
}

.important-note p, .important-note li {
    color: #78350f;
}

/* Limits grid */
.limits-grid {
    display: grid;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.limit-item {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 1.5rem;
}

.limit-item h4 {
    color: #166534;
    margin-bottom: 1rem;
}

.limit-amounts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.limit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #dcfce7;
}

.limit-row:last-child {
    border-bottom: none;
    font-weight: 600;
}

.limit-label {
    color: #374151;
}

.limit-value {
    font-weight: 600;
    color: #166534;
    font-size: 1.1rem;
}

/* Quarterly info */
.quarterly-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.quarterly-info h4 {
    color: #1e40af;
    margin-bottom: 1rem;
}

.quarterly-info p, .quarterly-info li {
    color: #1e40af;
}

/* Collapsible sections */
.collapsible-section {
    margin: 1.5rem 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.collapsible-section summary {
    background: #f9fafb;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.collapsible-section summary:hover {
    background: #f3f4f6;
}

.collapsible-section summary:focus {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

.collapsible-content {
    padding: 1.5rem;
    background: white;
}

.collapsible-content p, .collapsible-content li {
    color: #4b5563;
}

/* Calculator section placeholder styles */
.calculator-section, .results-section {
    margin-bottom: 3rem;
}

.calculator-container, .results-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Enhanced form styles with validation */
.calculator-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-fieldset {
    border: none;
    padding: 0;
}

.form-legend {
    font-size: 1.2rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-inputs-row {
    display: block;
}

.form-inputs-row .form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    line-height: 1.4;
}

.required-indicator {
    color: #dc2626;
    font-weight: 700;
    margin-left: 0.25rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: #ffffff;
    min-height: 48px; /* Touch-friendly minimum height */
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input:hover:not(:focus) {
    border-color: #9ca3af;
}

/* Validation states */
.form-input.field-valid {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.form-input.field-valid:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input.field-error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-input.field-error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Error message styling */
.field-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.field-error::before {
    content: "⚠";
    font-size: 1rem;
}

.form-help {
    display: block;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Checkbox styling */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #3b82f6;
}

.checkbox-label {
    font-weight: 500;
    margin-bottom: 0;
    cursor: pointer;
    color: #374151;
    line-height: 1.4;
    flex: 1;
}

.checkbox-label:hover {
    color: #1f2937;
}

/* Button styling */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px; /* Touch-friendly minimum height */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Input number styling (remove spinner arrows on webkit) */
.form-input[type="number"]::-webkit-outer-spin-button,
.form-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-input[type="number"] {
    -moz-appearance: textfield;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Results section styling */
.results-placeholder {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px dashed #d1d5db;
}

.results-content {
    display: grid;
    gap: 1.5rem;
}

.result-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.result-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.result-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.result-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: #059669;
    margin-bottom: 0.5rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.result-description {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

/* Specific result card styling */
#contribution-result .result-amount {
    color: #3b82f6;
}

#topup-result .result-amount {
    color: #059669;
}

#savings-result .result-amount {
    color: #dc2626;
}

/* Annual projections styling */
.annual-projections {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #0ea5e9;
    border-left: 4px solid #0ea5e9;
}

.annual-projections .result-title {
    color: #0c4a6e;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.annual-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.annual-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #bae6fd;
}

.annual-item:last-child {
    border-bottom: none;
}

.annual-item.highlight {
    background: rgba(14, 165, 233, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

.annual-label {
    color: #374151;
    font-weight: 500;
    flex: 1;
}

.annual-value {
    color: #0c4a6e;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.annual-item.highlight .annual-label,
.annual-item.highlight .annual-value {
    color: #0c4a6e;
    font-weight: 700;
}

/* Warning card styling */
.warning-card {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.warning-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-title::before {
    content: "⚠️";
    font-size: 1.2rem;
}

.warning-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.warning-list li {
    color: #78350f;
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.5;
}

.warning-list li:last-child {
    margin-bottom: 0;
}

.warning-list li::before {
    content: "•";
    color: #f59e0b;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Footer */
.footer {
    background: #374151;
    color: #d1d5db;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

.footer-text {
    margin-bottom: 0.5rem;
}

.footer a {
    color: #60a5fa;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (min-width: 768px) {
    .header__title {
        font-size: 3rem;
    }
    
    .eligibility-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .limits-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    
    .info-content {
        gap: 2.5rem;
    }
    
    /* Form improvements for tablet and desktop */
    .form-group {
        margin-bottom: 2rem;
    }
    
    .btn-primary {
        width: auto;
        min-width: 200px;
        margin: 1rem auto 0;
        display: block;
    }
    
    /* Results grid for larger screens */
    .results-content {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 2rem;
    }
    
    .result-card {
        padding: 2rem;
    }
    
    .result-amount {
        font-size: 3rem;
    }
    
    /* Annual projections responsive styling */
    .annual-breakdown {
        gap: 1.25rem;
    }
    
    .annual-item {
        padding: 1rem 0;
    }
    
    .annual-value {
        font-size: 1.2rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 40px;
    }
    
    .main {
        padding: 3rem 0;
    }
    
    /* Enhanced form layout for desktop */
    .calculator-form {
        max-width: 700px;
    }
    
    .form-fieldset {
        display: grid;
        gap: 2rem;
    }
    
    /* Two-column layout for form inputs on desktop */
    .form-inputs-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        margin-bottom: 1rem;
    }
    
    .result-amount {
        font-size: 3.5rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 3px;
    }
    
    .form-input:focus {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
    }
    
    .btn-primary {
        border: 2px solid #1e40af;
    }
}

/* Visual indicators for results display */
.amount-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
    animation-delay: 0.2s;
}

.contribution-indicator {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.topup-indicator {
    background: rgba(5, 150, 105, 0.1);
    color: #047857;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.savings-indicator {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.projection-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
    animation-delay: 0.3s;
}

.savings-trend {
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.limit-exceeded-indicator {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.trend-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.trend-text {
    flex: 1;
    line-height: 1.4;
}

.trend-text strong {
    color: #374151;
    font-size: 0.95rem;
}

.trend-text small {
    color: #6b7280;
    font-size: 0.8rem;
}

.results-summary-indicator {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.1s;
}

.summary-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.summary-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.summary-text {
    flex: 1;
    color: #0c4a6e;
    font-size: 1rem;
    line-height: 1.5;
}

.summary-text strong {
    font-weight: 600;
}

/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseAmount {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Cost breakdown visualization */
.cost-breakdown-viz {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.4s;
}

.breakdown-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    text-align: center;
}

.breakdown-bar {
    display: flex;
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    background: #f3f4f6;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.breakdown-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.6s ease;
    animation: expandSegment 0.8s ease forwards;
    animation-delay: 0.6s;
    transform: scaleX(0);
    transform-origin: left;
}

.your-part {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.gov-part {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: white;
}

.segment-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.breakdown-legend {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #4b5563;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.your-color {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.gov-color {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

@keyframes expandSegment {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* Enhanced result card animations */
.result-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
}

.result-card.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments for indicators */
@media (max-width: 767px) {
    .amount-indicator {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        gap: 0.4rem;
    }
    
    .projection-indicator {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .summary-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .trend-text {
        text-align: center;
    }
    
    .breakdown-legend {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    
    .segment-label {
        font-size: 0.75rem;
    }
    
    .breakdown-bar {
        height: 35px;
    }
}

/* MCP Integration Styles */
.mcp-indicator {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #4b5563;
}

.mcp-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    cursor: help;
    color: #9ca3af;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.mcp-status:hover {
    color: #60a5fa;
}

.mcp-icon {
    font-size: 1rem;
    animation: pulse 2s infinite;
}

.mcp-text {
    font-weight: 500;
}

.mcp-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
    margin-bottom: 0.5rem;
    max-width: 300px;
    white-space: normal;
    text-align: center;
}

.mcp-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
}

.mcp-status:hover .mcp-tooltip {
    opacity: 1;
    visibility: visible;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive MCP indicator */
@media (max-width: 767px) {
    .mcp-status {
        font-size: 0.8rem;
    }
    
    .mcp-tooltip {
        max-width: 250px;
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .form-input,
    .btn,
    .result-card {
        transition: none;
    }
    
    .result-card:hover {
        transform: none;
    }
    
    .btn-primary:hover:not(:disabled) {
        transform: none;
    }
    
    .amount-indicator,
    .projection-indicator,
    .results-summary-indicator {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .mcp-icon {
        animation: none;
    }
    
    .mcp-status,
    .mcp-tooltip {
        transition: none;
    }
}