/**
 * Public CSS for Housing Subsidy Calculator
 * Based on the original Tailwind styles converted to plain CSS
 */

/* General Styles */
.hsc-form-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #4a5568;
    line-height: 1.6;
}

.hsc-form-container * {
    box-sizing: border-box;
}

/* Header Styles */
.hsc-form-header {
    background: linear-gradient(to right, #3182ce, #2c5282);
    color: white;
    border-radius: 1rem 1rem 0 0;
    padding: 2rem;
    text-align: center;
}

.hsc-form-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.hsc-form-subtitle {
    color: #bee3f8;
    margin: 0;
    font-size: 1.1rem;
}

/* Progress Bar */
.hsc-progress-container {
    background-color: white;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.hsc-progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 800px;
    margin: 0 auto;
}

.hsc-step-indicator {
    display: flex;
    align-items: center;
}

.hsc-step-number {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: #e2e8f0;
    color: #718096;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.hsc-step-number.active {
    background-color: #3182ce;
    color: white;
}

.hsc-step-text {
    margin-left: 0.75rem;
    font-weight: 500;
    color: #718096;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.hsc-step-text.active {
    color: #2b6cb0;
    font-weight: 600;
}

.hsc-progress-line {
    height: 0.25rem;
    flex: 1;
    margin: 0 1rem;
    background-color: #e2e8f0;
    position: relative;
    border-radius: 0.125rem;
}

.hsc-progress-fill {
    height: 100%;
    background-color: #3182ce;
    transition: width 0.3s ease;
    border-radius: 0.125rem;
}

/* Form Container */
.hsc-calculator-form {
    background-color: white;
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

/* Step Content */
.step-content {
    display: block;
}

.step-content.hidden {
    display: none !important;
}

/* Typography */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
}

.subsection-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group.mb-6 {
    margin-bottom: 1.5rem;
}

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

.form-label {
    display: block;
    color: #4a5568;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.required {
    color: #e53e3e;
}

.input-wrapper {
    display: flex;
    align-items: stretch;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    background-color: white;
    height: 50px !important;
}

.form-input:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.5);
}

.form-input.rounded-l-lg {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-addon {
    background-color: #f7fafc;
    color: #4a5568;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e0;
    border-left: none;
    border-radius: 0 0.5rem 0.5rem 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.form-help {
    color: #718096;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Grid Layout */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 768px) {

    .md\:grid-cols-2,
    .hsc-cols-2-desktop {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Radio Buttons */
.radio-wrapper {
    position: relative;
}

.radio-input {
    display: none;
}

.radio-label {
    display: block;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
}

.radio-label:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
}

.radio-input:checked+.radio-label {
    border-color: #3182ce;
    background-color: #ebf8ff;
}

.radio-title {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
    color: #2d3748;
}

.radio-subtitle {
    color: #718096;
    font-size: 0.875rem;
}

/* Scenario Grid */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .scenario-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Cost Display */
.cost-display {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.cost-display.blue {
    background-color: #ebf8ff;
    border: 1px solid #90cdf4;
}

.cost-display.green {
    background-color: #f0fff4;
    border: 1px solid #9ae6b4;
}

.cost-display-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cost-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.cost-value.blue {
    color: #3182ce;
}

.cost-value.green {
    color: #38a169;
}

.cost-icon {
    padding: 0.75rem;
    border-radius: 0.5rem;
}

.cost-icon.blue {
    background-color: #bee3f8;
    color: #2b6cb0;
}

.cost-icon.green {
    background-color: #c6f6d5;
    color: #276749;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-bottom: 2rem;
}

.data-table {
    width: 100%;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border-collapse: collapse;
}

.table-header {
    background-color: #3182ce;
    color: white;
}

.table-header th {
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
}

.table-header th:nth-child(n+2) {
    text-align: center;
}

.table-body tr {
    border-bottom: 1px solid #e2e8f0;
}

.table-body tr:nth-child(odd) {
    background-color: #f7fafc;
}

.table-body td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-size: 0.875rem;
    vertical-align: middle;
}

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

/* Select Styles */
.form-select {
    width: 100%;
    padding: 0.25rem 0.5rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.5);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.5;
}

.btn-primary {
    background-color: #3182ce;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: #2c5282;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #2d3748;
}

.btn-secondary:hover {
    background-color: #cbd5e0;
}

.btn-success {
    background-color: #38a169;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-success:hover {
    background-color: #276749;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn i {
    margin-right: 0.5rem;
}

.btn i.ml-2 {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Button Groups */
.btn-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.btn-group-right {
    display: flex;
    gap: 1rem;
}

.btn-group-single {
    justify-content: flex-end;
}

/* Loading Overlay */
.hsc-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.hsc-loading-spinner {
    text-align: center;
    color: white;
}

.hsc-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: hsc-spin 1s linear infinite;
}

@keyframes hsc-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Form Messages */
.hsc-form-messages {
    margin: 1.5rem 0;
}

.hsc-message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: none;
}

.hsc-message.show {
    display: block;
}

.hsc-message-error {
    background-color: #fed7d7;
    color: #c53030;
    border: 1px solid #fc8181;
}

.hsc-message-success {
    background-color: #c6f6d5;
    color: #276749;
    border: 1px solid #9ae6b4;
}

/* Results */
.hsc-results {
    margin-top: 2rem;
}

.hsc-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.hsc-result-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.hsc-result-card.hsc-result-highlight {
    border-color: #38a169;
    background-color: #f0fff4;
}

.hsc-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.hsc-result-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.1rem;
}

.hsc-result-header i {
    color: #3182ce;
    font-size: 1.25rem;
}

.hsc-result-value {
    font-size: 2rem;
    font-weight: 700;
    color: #3182ce;
    margin-bottom: 0.5rem;
}

.hsc-result-card.hsc-result-highlight .hsc-result-value {
    color: #38a169;
}

.hsc-result-description {
    color: #718096;
    font-size: 0.9rem;
}

.hsc-scenario-investments {
    margin-top: 1rem;
}

.hsc-scenario-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.hsc-scenario-item:last-child {
    border-bottom: none;
}

.hsc-scenario-label {
    color: #4a5568;
    font-weight: 500;
}

.hsc-scenario-value {
    color: #3182ce;
    font-weight: 700;
}

/* Detailed Results */
.hsc-detailed-results {
    margin-top: 2rem;
}

.hsc-detailed-results h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.hsc-results-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.hsc-tab-button {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #718096;
    transition: all 0.3s ease;
}

.hsc-tab-button:hover {
    color: #3182ce;
}

.hsc-tab-button.active {
    color: #3182ce;
    border-bottom-color: #3182ce;
}

.hsc-tab-content {
    display: none;
}

.hsc-tab-content.active {
    display: block;
}

.hsc-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.hsc-breakdown-table th {
    background-color: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

.hsc-breakdown-table tr:hover {
    background-color: #f7fafc;
}

/* Summary */
.hsc-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.hsc-summary-item {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.hsc-summary-item h4 {
    margin: 0 0 0.75rem 0;
    color: #2d3748;
    font-size: 1rem;
}

.hsc-summary-item p {
    margin: 0;
    color: #4a5568;
    font-size: 0.9rem;
}

/* Results Actions */
.hsc-results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

/* Footer */
.hsc-form-footer {
    text-align: center;
    color: #718096;
    font-size: 0.875rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hsc-form-container {
        padding: 10px;
    }

    .hsc-form-header {
        padding: 1.5rem;
    }

    .hsc-form-title {
        font-size: 1.5rem;
    }

    .hsc-calculator-form {
        padding: 1.5rem;
    }

    .hsc-progress-steps {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .hsc-progress-line {
        display: none;
    }

    .hsc-step-text {
        display: none;
    }

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

    .grid-cols-1.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column;
        gap: 1rem;
    }


    .btn-group-right {
        justify-content: center;
    }

    .table-container {
        font-size: 0.8rem;
    }

    .data-table {
        min-width: 800px;
    }

    .hsc-results-grid {
        grid-template-columns: 1fr;
    }

    .hsc-results-tabs {
        flex-direction: column;
    }

    .hsc-results-actions {
        flex-direction: column;
        align-items: center;
    }
}

/* Print Styles */
@media print {
    .hsc-form-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .hsc-progress-container,
    .hsc-form-footer,
    .hsc-results-actions {
        display: none;
    }

    .hsc-result-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Validation Styles */
.form-input.hsc-valid {
    background-color: #f0fff4 !important;
    border-color: #38a169 !important;
    box-shadow: 0 0 0 1px #38a169 !important;
}

.form-input.hsc-invalid {
    background-color: #fff5f5 !important;
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 1px #e53e3e !important;
}

/* Utilities */
.w-full {
    width: 100%;
}

.text-right {
    text-align: right;
}

.bg-gray-100 {
    background-color: #f7fafc;
}

.p-2 {
    padding: 0.5rem;
}

.border-b {
    border-bottom: 1px solid #e2e8f0;
}

.font-medium {
    font-weight: 500;
}

.gap-8 {
    gap: 2rem;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mt-8 {
    margin-top: 2rem;
}

.rounded-r-none {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}