/* Health Insurance Premium Calculator - Mobile-First CSS */
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hic-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #111827;
    background: #ffffff;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 1rem;
    line-height: 1.5;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

/* Title Section */
.hic-title-section {
    background: #2CEC00;
    color: #ffffff;
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    width: 100%;
}

.hic-title-section h1 {
    color: #000000;
    margin-bottom: 0.5rem;
}

.hic-title-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-bottom: 0;
}

/* Cards */
.hic-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Form Styles */
.hic-form-section h2 {
    color: #111827;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.hic-form-group {
    margin-bottom: 2rem;
}

.hic-form-group h3 {
    color: #374151;
    font-size: 1.125rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.hic-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hic-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hic-form-field label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.hic-form-field input,
.hic-form-field select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    background: #ffffff;
    color: #111827;
    min-height: 44px; /* Touch-friendly */
    width: 100%;
    transition: border-color 0.2s;
}

.hic-form-field input:focus,
.hic-form-field select:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.hic-input-group {
    display: flex;
    align-items: center;
    position: relative;
}

.hic-input-prefix {
    position: absolute;
    left: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.hic-input-group input {
    padding-left: 2rem;
}

/* Error Messages */
.hic-error-message {
    color: #dc2626;
    font-size: 0.75rem;
    min-height: 1rem;
    margin-top: 0.25rem;
    display: none;
}

.hic-error-message.show {
    display: block;
}

/* Advanced Options */
.hic-advanced-toggle {
    text-align: center;
    margin: 1.5rem 0;
}

.hic-toggle-btn {
    background: none;
    border: 2px solid #2563eb;
    color: #2563eb;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    transition: all 0.2s;
}

.hic-toggle-btn:hover {
    background: #2563eb;
    color: #ffffff;
}

.hic-advanced-options {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.hic-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.hic-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 100%;
}

.hic-btn-primary {
    background: #22c55e;
    color: #ffffff;
}

.hic-btn-primary:hover {
    background: #16a34a;
}

.hic-btn-secondary {
    background: #2563eb;
    color: #ffffff;
}

.hic-btn-secondary:hover {
    background: #1d4ed8;
}

/* Loading Overlay */
.hic-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.hic-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #22c55e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Results Section */
.hic-results-section {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.hic-results-summary h2 {
    color: #111827;
    text-align: center;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.hic-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.hic-summary-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 1rem;
    text-align: center;
}

.hic-summary-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.hic-summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

/* Progress Bar */
.hic-progress-container {
    margin-top: 1rem;
}

.hic-progress-bar {
    height: 1.5rem;
    background: #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    margin-bottom: 1rem;
}

.hic-progress-fill {
    height: 100%;
    transition: width 0.5s ease-in-out;
}

.hic-progress-labels {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hic-progress-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
}

.hic-progress-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

/* Charts */
.hic-chart-container {
    height: 300px;
}

.hic-chart-container canvas {
    width: 100% !important;
    height: 250px !important;
}

/* Details Section */
.hic-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.hic-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.hic-detail-item:last-child {
    border-bottom: none;
}

.hic-detail-label {
    color: #6b7280;
    font-size: 0.875rem;
}

.hic-detail-value {
    font-weight: 600;
    color: #111827;
}

/* Table/Timeline */
.hic-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    width: 100%;
}

.hic-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.hic-table thead {
    background: #f3f4f6;
}

.hic-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.hic-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.hic-table tbody tr:hover {
    background: #f9fafb;
}

/* Responsive Design */
@media (min-width: 481px) {
    .hic-container {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .hic-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hic-action-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .hic-btn {
        width: auto;
        min-width: 150px;
    }
}

@media (min-width: 769px) {
    .hic-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 2rem;
    }
    
    .hic-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hic-summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .hic-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hic-charts-section .hic-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    h1 {
        font-size: 2.25rem;
    }
    
    .hic-form-field input,
    .hic-form-field select {
        font-size: 0.875rem;
    }
}

/* Small Mobile (≤ 360px) */
@media (max-width: 360px) {
    .hic-container {
        padding: 0.75rem;
    }
    
    .hic-card {
        padding: 1rem;
    }
    
    .hic-title-section {
        padding: 1.5rem 0.75rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .hic-summary-value {
        font-size: 1.25rem;
    }
}

/* Print Styles */
@media print {
    .hic-container {
        padding: 0;
        background: #ffffff;
    }
    
    .hic-title-section {
        background: #ffffff !important;
        color: #000000 !important;
        border: 2px solid #000000;
    }
    
    .hic-title-section h1,
    .hic-title-section p {
        color: #000000 !important;
    }
    
    .hic-card {
        background: #ffffff !important;
        border: 1px solid #000000 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .hic-btn,
    .hic-toggle-btn,
    .hic-advanced-toggle {
        display: none !important;
    }
    
    .hic-chart-container canvas {
        max-width: 100% !important;
    }
    
    .hic-table-container {
        overflow-x: visible !important;
    }
    
    .hic-table {
        min-width: auto !important;
    }
}

/* Accessibility */
.hic-btn:focus,
.hic-form-field input:focus,
.hic-form-field select:focus,
.hic-toggle-btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ARIA Live Regions */
.hic-aria-live {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}