* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8fafc;
    color: #2d3748;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #1a202c;
    font-size: 28px;
    margin-bottom: 8px;
}

.header p {
    color: #718096;
    font-size: 16px;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-height: 600px;
}

.input-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.preview-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.tab-navigation {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #e2e8f0;
    margin: 0;
    background: #f7fafc;
    border-radius: 12px 12px 0 0;
    gap: 2px;
    padding: 4px 4px 0 4px;
}

.tab-button {
    flex: 0 1 auto;
    padding: 8px 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #718096;
    transition: all 0.2s;
    border-radius: 6px 6px 0 0;
    font-size: 12px;
    white-space: nowrap;
}

.tab-button.active {
    background: white;
    color: #2d3748;
    border-bottom: 2px solid #dc2626;
}

.tab-button:hover:not(.active) {
    background: #edf2f7;
    color: #4a5568;
}

.tab-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

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

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

input[type="number"],
input[type="text"],
input[type="date"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
    border-radius: 0 0 12px 12px;
    gap: 8px;
}

.nav-button {
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.nav-button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.nav-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.preview-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.preview-content h2 {
    color: #1a202c;
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
}

/* Deadline Display */
.deadline-display {
    text-align: center;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.deadline-display.urgent {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #dc2626;
}

.deadline-display.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
}

.deadline-display.safe {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #16a34a;
}

.deadline-display.expired {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    border: 2px solid #dc2626;
}

.deadline-display h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.deadline-display.urgent h3 { color: #dc2626; }
.deadline-display.warning h3 { color: #d97706; }
.deadline-display.safe h3 { color: #16a34a; }
.deadline-display.expired h3 { color: #f87171; }

.deadline-date {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.deadline-display.urgent .deadline-date { color: #dc2626; }
.deadline-display.warning .deadline-date { color: #d97706; }
.deadline-display.safe .deadline-date { color: #16a34a; }
.deadline-display.expired .deadline-date { color: white; }

.days-remaining {
    font-size: 48px;
    font-weight: 800;
    margin: 12px 0;
}

.deadline-display.urgent .days-remaining { color: #dc2626; }
.deadline-display.warning .days-remaining { color: #d97706; }
.deadline-display.safe .days-remaining { color: #16a34a; }
.deadline-display.expired .days-remaining { color: #f87171; }

.days-label {
    font-size: 14px;
    color: #64748b;
}

.deadline-display.expired .days-label { color: #9ca3af; }

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.comparison-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
    text-align: center;
}

.comparison-table td:first-child {
    font-weight: 500;
    background: #f9fafb;
}

.comparison-table td:nth-child(2) {
    text-align: center;
}

/* Summary Boxes */
.summary-box {
    background: #f0f9ff;
    border: 1px solid #0284c7;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.summary-box h3 {
    color: #0369a1;
    margin-bottom: 8px;
    font-size: 16px;
}

.summary-box p {
    margin-bottom: 4px;
    font-size: 14px;
}

.warning-box {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.warning-box h3, .warning-box h4 {
    color: #92400e;
    margin-bottom: 8px;
    font-size: 16px;
}

.urgent-box {
    background: #fef2f2;
    border: 2px solid #dc2626;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.urgent-box h3, .urgent-box h4 {
    color: #dc2626;
    margin-bottom: 8px;
    font-size: 16px;
}

.amount {
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
}

.positive {
    color: #16a34a;
}

.negative {
    color: #dc2626;
}

.neutral {
    color: #6b7280;
}

.info-box {
    background: #eff6ff;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    padding: 12px;
    margin-top: 12px;
    font-size: 13px;
    color: #1e40af;
}

/* Help Tooltip Styles */
.help-tip-wrapper {
    position: relative;
    display: inline-flex;
    margin-left: 6px;
}

.help-tip-btn {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #dc2626;
    color: white;
    border: none;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.help-tip-btn:hover {
    background: #b91c1c;
}

.help-tip-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    width: 280px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    margin-bottom: 8px;
}

.help-tip-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

/* Tab description text */
.tab-description {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.tab-panel h3 {
    color: #1e293b;
    font-size: 18px;
    margin-bottom: 8px;
}

/* Checkbox row */
.checkbox-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.checkbox-group label {
    display: inline;
    margin-bottom: 0;
}

/* Tolling factors section */
.tolling-section {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.tolling-section h4 {
    color: #92400e;
    font-size: 14px;
    margin-bottom: 12px;
}

.tolling-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px;
    background: white;
    border-radius: 6px;
}

.tolling-item:last-child {
    margin-bottom: 0;
}

.tolling-item input[type="checkbox"] {
    margin-top: 3px;
}

.tolling-item label {
    flex: 1;
    margin-bottom: 0;
}

.tolling-item .tolling-desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

/* State info card */
.state-info-card {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #3b82f6;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.state-info-card h4 {
    color: #1e40af;
    font-size: 16px;
    margin-bottom: 12px;
}

.state-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.state-info-item {
    background: white;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.state-info-item .label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.state-info-item .value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-top: 4px;
}

/* Timeline visualization */
.timeline-viz {
    margin: 20px 0;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.timeline-bar {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    position: relative;
    margin: 16px 0;
    overflow: hidden;
}

.timeline-progress {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.timeline-progress.safe { background: linear-gradient(90deg, #22c55e, #16a34a); }
.timeline-progress.warning { background: linear-gradient(90deg, #f59e0b, #d97706); }
.timeline-progress.urgent { background: linear-gradient(90deg, #ef4444, #dc2626); }
.timeline-progress.expired { background: #1f2937; }

.timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
}

/* Contextual Help Panel */
.contextual-help {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #dc2626;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.contextual-help h3 {
    color: #991b1b;
    font-size: 16px;
    margin-bottom: 8px;
}

.contextual-help .help-intro {
    color: #991b1b;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.contextual-help .help-tips {
    margin: 0;
    padding-left: 20px;
}

.contextual-help .help-tips li {
    color: #991b1b;
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.4;
}

/* Smart Insights */
.smart-insights {
    margin-bottom: 16px;
}

.smart-insights h4 {
    color: #374151;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 600;
}

.insight {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.insight.info {
    background: #eff6ff;
    border: 1px solid #3b82f6;
}

.insight.info .insight-text {
    color: #1e40af;
}

.insight.warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
}

.insight.warning .insight-text {
    color: #92400e;
}

.insight.urgent {
    background: #fef2f2;
    border: 1px solid #dc2626;
}

.insight.urgent .insight-text {
    color: #991b1b;
}

.insight.success {
    background: #f0fdf4;
    border: 1px solid #22c55e;
}

.insight.success .insight-text {
    color: #166534;
}

.insight-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.insight-text {
    flex: 1;
}

/* Action items */
.action-items {
    background: #f0fdf4;
    border: 1px solid #16a34a;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.action-items h4 {
    color: #166534;
    font-size: 14px;
    margin-bottom: 12px;
}

.action-items ul {
    margin: 0;
    padding-left: 20px;
}

.action-items li {
    color: #166534;
    font-size: 13px;
    margin-bottom: 8px;
}

/* Details grid */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.detail-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.detail-box h4 {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 500;
}

.detail-box .amount {
    font-size: 20px;
    color: #1e293b;
}

.detail-box .subtext {
    font-size: 11px;
    color: #94a3b8;
    display: block;
    margin-top: 4px;
}

/* Claim type cards */
.claim-type-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.claim-type-card:hover {
    border-color: #dc2626;
    background: #fef2f2;
}

.claim-type-card.selected {
    border-color: #dc2626;
    background: #fef2f2;
}

.claim-type-card h4 {
    color: #1e293b;
    font-size: 15px;
    margin-bottom: 4px;
}

.claim-type-card p {
    color: #64748b;
    font-size: 12px;
    margin: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        height: auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .navigation-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-button {
        font-size: 12px;
        padding: 8px 12px;
    }

    .help-tip-popup {
        width: 220px;
        left: auto;
        right: 0;
        transform: none;
    }

    .help-tip-popup::after {
        left: auto;
        right: 10px;
        transform: none;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-row {
        flex-direction: column;
        gap: 12px;
    }

    .state-info-grid {
        grid-template-columns: 1fr;
    }

    .deadline-date {
        font-size: 24px;
    }

    .days-remaining {
        font-size: 36px;
    }

    .tab-navigation {
        flex-wrap: wrap;
        gap: 3px;
        padding: 4px;
    }

    .tab-button {
        font-size: 11px;
        padding: 6px 8px;
        flex: 0 1 auto;
    }

    .tab-content {
        padding: 16px;
    }

    .preview-content {
        padding: 16px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .tab-button {
        font-size: 10px;
        padding: 5px 6px;
    }

    .deadline-date {
        font-size: 20px;
    }

    .days-remaining {
        font-size: 28px;
    }

    .info-box {
        font-size: 12px;
        padding: 10px;
    }
}

/* Touch fixes */
button,
.nav-button,
.tab-button,
.claim-type-card {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

/* Discovery rule indicator */
.discovery-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #eff6ff;
    border: 1px solid #3b82f6;
    border-radius: 20px;
    font-size: 11px;
    color: #1e40af;
    margin-left: 8px;
}

/* State lookup grid */
.state-lookup-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 16px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: #f8fafc;
    border-radius: 8px;
}

.state-lookup-item {
    padding: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
    font-size: 11px;
}

.state-lookup-item .abbr {
    font-weight: 700;
    color: #1e293b;
}

.state-lookup-item .years {
    color: #dc2626;
    font-weight: 600;
}

@media (max-width: 768px) {
    .state-lookup-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
