/**
 * 租金回报率和租售比计算器样式
 *
 * @package Polyglot Web Tools
 */

.pwt-rental-yield-calculator {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 16px rgba(0, 0, 0, 0.06);
    line-height: 1.6;
    color: #333;
}

/* 标题样式 */
.pwt-rental-yield-calculator .pwt-tool-header {
    margin-bottom: 24px;
    text-align: center;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.pwt-rental-yield-calculator .pwt-tool-title {
    font-size: 26px;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px 0;
    letter-spacing: -0.5px;
}

.pwt-rental-yield-calculator .pwt-tool-description {
    font-size: 16px;
    color: #666;
    margin: 0;
    line-height: 1.5;
    max-width: 700px;
    margin: 0 auto;
}

/* 标签页样式 */
.pwt-rental-yield-calculator .pwt-tabs-container {
    margin-bottom: 24px;
}

.pwt-rental-yield-calculator .pwt-tabs {
    display: flex;
    margin-bottom: 22px;
    background-color: #f5f7fa;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
    border: none;
}

.pwt-rental-yield-calculator .pwt-tab-link {
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    flex: 1;
}

.pwt-rental-yield-calculator .pwt-tab-link.active {
    color: #fff;
    background-color: #3a7bc2;
    box-shadow: 0 2px 8px rgba(58, 123, 194, 0.3);
}

.pwt-rental-yield-calculator .pwt-tab-content {
    display: none;
}

.pwt-rental-yield-calculator .pwt-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 共享输入区样式 */
.pwt-rental-yield-calculator .pwt-shared-inputs {
    padding: 24px;
    background-color: #f9fafc;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #edf0f5;
}

.pwt-rental-yield-calculator .pwt-shared-inputs h4 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    position: relative;
    padding-left: 16px;
}

.pwt-rental-yield-calculator .pwt-shared-inputs h4:before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    height: 16px;
    width: 4px;
    background-color: #3a7bc2;
    border-radius: 2px;
}

/* 表单样式 */
.pwt-rental-yield-calculator .pwt-form-group {
    margin-bottom: 20px;
}

.pwt-rental-yield-calculator .pwt-form-group:last-child {
    margin-bottom: 10px;
}

.pwt-rental-yield-calculator .pwt-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 15px;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.pwt-rental-yield-calculator .pwt-input-container {
    display: flex;
    align-items: center;
    position: relative;
    flex-wrap: nowrap;
    gap: 10px;
}

.pwt-rental-yield-calculator .pwt-currency {
    display: none;
}

.pwt-rental-yield-calculator .pwt-input {
    padding: 10px 12px;
    border: 1px solid #d9e0e8;
    border-radius: 6px;
    width: 100%;
    font-size: 15px;
    height: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.pwt-rental-yield-calculator .pwt-input:focus {
    border-color: #3a7bc2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(58, 123, 194, 0.2);
}

.pwt-rental-yield-calculator .pwt-unit {
    margin-left: 8px;
    color: #666;
    font-weight: 500;
}

/* 错误消息样式 */
.pwt-rental-yield-calculator .pwt-error-message {
    color: #e53935;
    font-size: 14px;
    margin-top: 6px;
    min-height: 20px;
    font-weight: 500;
}

/* 高级选项样式 */
.pwt-rental-yield-calculator .pwt-advanced-inputs-toggle {
    margin: 24px 0;
}

.pwt-rental-yield-calculator .pwt-toggle-button {
    background: none;
    border: none;
    padding: 0;
    font-size: 17px;
    font-weight: 600;
    color: #3a7bc2;
    cursor: pointer;
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
}

.pwt-rental-yield-calculator .pwt-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 12px;
    text-align: center;
    line-height: 1;
    border-radius: 50%;
    background-color: #3a7bc2;
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.pwt-rental-yield-calculator .pwt-advanced-inputs {
    background-color: #f9fafc;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #edf0f5;
}

/* 下拉框样式 */
.pwt-rental-yield-calculator .pwt-select-period {
    margin-left: 10px;
    min-width: 90px;
    flex-shrink: 0;
}

.pwt-rental-yield-calculator .pwt-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    border: 1px solid #d9e0e8;
    border-radius: 6px;
    padding: 6px 28px 6px 10px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    width: 100%;
    height: 36px;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233a7bc2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.pwt-rental-yield-calculator .pwt-select:hover {
    border-color: #3a7bc2;
}

.pwt-rental-yield-calculator .pwt-select:focus {
    outline: none;
    border-color: #3a7bc2;
    box-shadow: 0 0 0 3px rgba(58, 123, 194, 0.2);
}

.pwt-rental-yield-calculator .pwt-radio-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pwt-rental-yield-calculator .pwt-radio-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 0;
}

.pwt-rental-yield-calculator .pwt-radio-label input[type="radio"] {
    accent-color: #3a7bc2;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.pwt-rental-yield-calculator .pwt-inline-input {
    width: 120px;
    margin-left: 8px;
    flex-shrink: 0;
}

.pwt-rental-yield-calculator .pwt-inline-input .pwt-input {
    height: 20px;
    padding: 6px 10px;
    font-size: 14px;
}

.pwt-rental-yield-calculator .pwt-inline-input .pwt-currency {
    display: none;
}

/* 工具提示样式 */
.pwt-rental-yield-calculator .pwt-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    background-color: #f0f4f8;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #3a7bc2;
    cursor: help;
    position: relative;
    z-index: 10;
}

.pwt-rental-yield-calculator .pwt-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(51, 51, 51, 0.95);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: normal;
    white-space: normal;
    width: 320px;
    max-width: 320px;
    line-height: 1.5;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.18);
    text-align: left;
}

.pwt-rental-yield-calculator .pwt-tooltip:hover::before {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(51, 51, 51, 0.95);
    z-index: 21;
}

/* 结果样式 */
.pwt-rental-yield-calculator .pwt-result-container {
    padding: 28px;
    background-color: #f9fafc;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #edf0f5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.pwt-rental-yield-calculator .pwt-result-container h4 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    position: relative;
    padding-left: 16px;
}

.pwt-rental-yield-calculator .pwt-result-container h4:before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    height: 16px;
    width: 4px;
    background-color: #3a7bc2;
    border-radius: 2px;
}

.pwt-rental-yield-calculator .pwt-result-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #edf0f5;
}

.pwt-rental-yield-calculator .pwt-result-label {
    font-weight: 600;
    color: #444;
    font-size: 15px;
}

.pwt-rental-yield-calculator .pwt-result-value {
    font-weight: 700;
    font-size: 16px;
    color: #333;
    background-color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pwt-rental-yield-calculator .pwt-primary-result {
    background-color: #f4f8fc;
    border-radius: 8px;
    padding: 16px;
    margin: 0 -16px 18px;
}

.pwt-rental-yield-calculator .pwt-primary-result .pwt-result-value {
    color: #3a7bc2;
    font-weight: 700;

    box-shadow: 0 2px 5px rgba(58, 123, 194, 0.1);
}

.pwt-rental-yield-calculator .pwt-gauge-container {
    width: 100%;
    margin-top: 16px;
}

.pwt-rental-yield-calculator .pwt-gauge {
    width: 100%;
    height: 10px;
    background-color: #e6ebf0;
    border-radius: 5px;
    overflow: hidden;
}

.pwt-rental-yield-calculator .pwt-gauge-fill {
    height: 100%;
    background: linear-gradient(to right, #e57373, #ffd54f, #81c784);
    width: 0;
    transition: width 0.6s ease-in-out;
}

.pwt-rental-yield-calculator .pwt-result-interpretation {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid #e6ebf0;
    border-radius: 8px;
    background-color: #fff;
}

.pwt-rental-yield-calculator .pwt-result-interpretation p {
    color: #555;
    font-size: 15px;
    margin: 0;
    line-height: 1.6;
}

/* 按钮样式 */
.pwt-rental-yield-calculator .pwt-action-buttons {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.pwt-rental-yield-calculator .pwt-button {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 140px;
    text-align: center;
}

.pwt-rental-yield-calculator .pwt-button-secondary {
    background-color: #f0f3f7;
    color: #4b5563;
    border: 1px solid #e5e9f0;
}

.pwt-rental-yield-calculator .pwt-button-secondary:hover {
    background-color: #e5e9f0;
    color: #3a7bc2;
    border-color: #3a7bc2;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .pwt-rental-yield-calculator {
        padding: 20px 16px;
        border-radius: 10px;
    }

    .pwt-rental-yield-calculator .pwt-tool-title {
        font-size: 22px;
    }

    .pwt-rental-yield-calculator .pwt-tool-description {
        font-size: 15px;
    }

    .pwt-rental-yield-calculator .pwt-tabs {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .pwt-rental-yield-calculator .pwt-tab-link {
        flex: 1 1 100%;
        border-radius: 6px;
        margin-bottom: 4px;
    }

    .pwt-rental-yield-calculator .pwt-shared-inputs,
    .pwt-rental-yield-calculator .pwt-advanced-inputs,
    .pwt-rental-yield-calculator .pwt-result-container {
        padding: 20px 16px;
    }

    .pwt-rental-yield-calculator .pwt-select-period {
        margin-left: 0;
        
        width: 100%;
    }

    .pwt-rental-yield-calculator .pwt-radio-label {
        margin-bottom: 12px;
        width: 100%;
    }

    .pwt-rental-yield-calculator .pwt-inline-input {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }

    .pwt-rental-yield-calculator .pwt-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .pwt-rental-yield-calculator .pwt-result-value {
        width: 100%;
        text-align: center;
    }

    /* 改善小屏幕上的工具提示体验 */
    .pwt-rental-yield-calculator .pwt-tooltip:hover::after {
        width: 120px;
        max-width: 200vw;
        left: 0;
        transform: none;
        white-space: normal;
    }
    
    .pwt-rental-yield-calculator .pwt-tooltip:hover::before {
        left: 9px;
        
        
        transform: none;
    }
    .pwt-rental-yield-calculator .pwt-primary-result .pwt-result-value,.pwt-rental-yield-calculator .pwt-result-value {
        padding: 10px 0;
    }
    #pwt-property-tax,#pwt-home-insurance,#pwt-management-fee{width:200px;}
    #pwt-property-tax-period,#pwt-home-insurance-period,#pwt-management-fee-period{width:75px;}
}

/* 极小屏幕优化 */
@media (max-width: 480px) {
    .pwt-rental-yield-calculator .pwt-tool-header {
        margin-bottom: 20px;
    }

    .pwt-rental-yield-calculator .pwt-tab-link {
        padding: 12px 8px;
        font-size: 15px;
    }

    .pwt-rental-yield-calculator .pwt-form-group {
        margin-bottom: 20px;
    }

    .pwt-rental-yield-calculator .pwt-input {
        font-size: 15px;
    }

    .pwt-rental-yield-calculator .pwt-button {
        width: 100%;
        padding: 12px;
    }
}