/**
 * FSBO Closing Timeline Calculator Styles
 * Professional, clean, and modern design
 */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Container */
.fsbo-ct-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
}

/* Header - Hidden */
.fsbo-ct-header {
    display: none;
}

/* Form */
.fsbo-ct-form {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    padding: 40px;
    margin-bottom: 30px;
}

/* Sections */
.fsbo-ct-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #e2e8f0;
}

.fsbo-ct-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.fsbo-ct-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 24px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid #3182ce;
    display: inline-block;
}

/* Rows and Fields */
.fsbo-ct-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.fsbo-ct-row:last-child {
    margin-bottom: 0;
}

.fsbo-ct-field {
    display: flex;
    flex-direction: column;
}

.fsbo-ct-field label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fsbo-ct-field label .required {
    color: #e53e3e;
}

.fsbo-ct-field input[type="text"],
.fsbo-ct-field input[type="number"],
.fsbo-ct-field input[type="date"],
.fsbo-ct-field select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #ffffff;
}

.fsbo-ct-field input:focus,
.fsbo-ct-field select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

/* Tooltip */
.fsbo-ct-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #cbd5e0;
    color: #2d3748;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: help;
    position: relative;
}

.fsbo-ct-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Radio Cards */
.fsbo-ct-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.fsbo-ct-radio-card {
    position: relative;
    display: flex;
    align-items: center;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
}

.fsbo-ct-radio-card:hover {
    border-color: #3182ce;
    background: #f7fafc;
}

.fsbo-ct-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.fsbo-ct-radio-card input[type="radio"]:checked + .fsbo-ct-radio-label {
    color: #1a365d;
}

.fsbo-ct-radio-card input[type="radio"]:checked ~ * {
    border-color: #3182ce;
}

.fsbo-ct-radio-card:has(input[type="radio"]:checked) {
    border-color: #3182ce;
    background: #ebf8ff;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.fsbo-ct-radio-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fsbo-ct-radio-label strong {
    font-size: 1rem;
    color: #2d3748;
}

.fsbo-ct-radio-label small {
    font-size: 0.875rem;
    color: #718096;
}

/* Checkbox Group */
.fsbo-ct-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.fsbo-ct-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
}

.fsbo-ct-checkbox:hover {
    border-color: #3182ce;
    background: #f7fafc;
}

.fsbo-ct-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3182ce;
}

.fsbo-ct-checkbox span {
    font-size: 0.95rem;
    color: #2d3748;
    font-weight: 500;
}

/* Buttons */
.fsbo-ct-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 40px;
}

.fsbo-ct-button {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.fsbo-ct-button-primary {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(49, 130, 206, 0.3);
}

.fsbo-ct-button-primary:hover {
    background: linear-gradient(135deg, #2c5282 0%, #1a365d 100%);
    box-shadow: 0 6px 12px rgba(49, 130, 206, 0.4);
    transform: translateY(-2px);
}

.fsbo-ct-button-secondary {
    background: #ffffff;
    color: #2d3748;
    border: 2px solid #e2e8f0;
}

.fsbo-ct-button-secondary:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.fsbo-ct-button-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* Results Section */
.fsbo-ct-results {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    padding: 40px;
    margin-top: 30px;
}

.fsbo-ct-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.fsbo-ct-results-header h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a365d;
    margin: 0;
}

.fsbo-ct-results-actions {
    display: flex;
    gap: 12px;
}

/* Summary */
.fsbo-ct-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 24px;
    background: linear-gradient(135deg, #ebf8ff 0%, #e6fffa 100%);
    border-radius: 10px;
    border-left: 4px solid #3182ce;
}

.fsbo-ct-summary-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fsbo-ct-summary-item .label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fsbo-ct-summary-item .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a365d;
}

/* Warnings */
.fsbo-ct-warnings {
    margin-bottom: 30px;
}

/* Risk Analysis Section */
.fsbo-ct-risk-analysis {
    background: #ffffff;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid #e2e8f0;
}

.fsbo-ct-risk-analysis h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a365d;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid #3182ce;
    display: inline-block;
}

.fsbo-ct-risk-score {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid #cbd5e0;
}

.fsbo-ct-risk-score.low {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    border-left-color: #48bb78;
}

.fsbo-ct-risk-score.medium {
    background: linear-gradient(135deg, #fffaf0 0%, #feebc8 100%);
    border-left-color: #ed8936;
}

.fsbo-ct-risk-score.high {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-left-color: #f56565;
}

.fsbo-ct-risk-badge {
    font-size: 3rem;
    font-weight: 700;
    min-width: 80px;
    text-align: center;
}

.fsbo-ct-risk-badge.low {
    color: #48bb78;
}

.fsbo-ct-risk-badge.medium {
    color: #ed8936;
}

.fsbo-ct-risk-badge.high {
    color: #f56565;
}

.fsbo-ct-risk-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 8px 0;
}

.fsbo-ct-risk-content p {
    font-size: 0.95rem;
    color: #4a5568;
    margin: 0;
    line-height: 1.6;
}

.fsbo-ct-risk-factors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.fsbo-ct-risk-factor {
    padding: 16px 20px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 3px solid #cbd5e0;
}

.fsbo-ct-risk-factor.concern {
    background: #fffaf0;
    border-left-color: #ed8936;
}

.fsbo-ct-risk-factor.critical {
    background: #fff5f5;
    border-left-color: #f56565;
}

.fsbo-ct-risk-factor h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fsbo-ct-risk-factor p {
    font-size: 0.875rem;
    color: #718096;
    margin: 0;
    line-height: 1.5;
}

.fsbo-ct-risk-recommendations {
    margin-top: 24px;
    padding: 20px;
    background: #ebf8ff;
    border-radius: 8px;
    border-left: 4px solid #4299e1;
}

.fsbo-ct-risk-recommendations h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2c5282;
    margin: 0 0 12px 0;
}

.fsbo-ct-risk-recommendations ul {
    margin: 0;
    padding-left: 20px;
    color: #2c5282;
}

.fsbo-ct-risk-recommendations li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.fsbo-ct-warning,
.fsbo-ct-info {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.fsbo-ct-warning {
    background: #fff5f5;
    border-left: 4px solid #fc8181;
    color: #742a2a;
}

.fsbo-ct-info {
    background: #ebf8ff;
    border-left: 4px solid #4299e1;
    color: #2c5282;
}

/* Timeline */
.fsbo-ct-timeline {
    position: relative;
}

.fsbo-ct-milestones {
    position: relative;
    padding-left: 0;
}

.fsbo-ct-milestones::before {
    display: none;
}

.fsbo-ct-milestone {
    position: relative;
    padding: 24px;
    margin-bottom: 24px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.fsbo-ct-milestone:hover {
    border-color: #3182ce;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.fsbo-ct-milestone::before {
    display: none;
}

.fsbo-ct-milestone.completed::before {
    background: #48bb78;
    border-color: #48bb78;
}

.fsbo-ct-milestone-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.fsbo-ct-milestone-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.fsbo-ct-milestone-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: #3182ce;
    background: #ebf8ff;
    padding: 6px 12px;
    border-radius: 6px;
}

.fsbo-ct-milestone-description {
    font-size: 0.95rem;
    color: #718096;
    margin: 0 0 12px 0;
}

.fsbo-ct-milestone-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 4px;
}

.fsbo-ct-milestone-category.contract {
    background: #fef5e7;
    color: #d68910;
}

.fsbo-ct-milestone-category.financial {
    background: #e8f5e9;
    color: #2e7d32;
}

.fsbo-ct-milestone-category.inspection {
    background: #e3f2fd;
    color: #1565c0;
}

.fsbo-ct-milestone-category.legal {
    background: #f3e5f5;
    color: #6a1b9a;
}

.fsbo-ct-milestone-category.closing {
    background: #fce4ec;
    color: #c2185b;
}

/* Print Styles */
@media print {
    .fsbo-ct-form,
    .fsbo-ct-results-actions {
        display: none !important;
    }

    .fsbo-ct-results {
        box-shadow: none;
        padding: 0;
    }

    .fsbo-ct-milestone {
        page-break-inside: avoid;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .fsbo-ct-container {
        padding: 0 16px;
    }

    .fsbo-ct-form {
        padding: 24px;
    }

    .fsbo-ct-title {
        font-size: 2rem;
    }

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

    .fsbo-ct-radio-group {
        grid-template-columns: 1fr;
    }

    .fsbo-ct-checkbox-group {
        grid-template-columns: 1fr;
    }

    .fsbo-ct-actions {
        flex-direction: column;
    }

    .fsbo-ct-button {
        width: 100%;
    }

    .fsbo-ct-results-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .fsbo-ct-results-actions {
        width: 100%;
        flex-direction: column;
    }

    .fsbo-ct-summary {
        grid-template-columns: 1fr;
    }
}

/* Loading State */
.fsbo-ct-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.fsbo-ct-button-primary.loading .button-text {
    display: none;
}

.fsbo-ct-button-primary.loading .button-loader {
    display: inline !important;
}
