/**
 * BlindCalc Measure Form Styles
 */

/* 容器 */
.rdai-blindcalc-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 通知 */
.rdai-blindcalc-notice {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-left: 4px solid;
    border-radius: 4px;
}

.rdai-blindcalc-notice.warning {
    background: #fff3cd;
    border-color: #ff9800;
    color: #856404;
}

.rdai-blindcalc-notice.error {
    background: #f8d7da;
    border-color: #d32f2f;
    color: #721c24;
}

/* 配额状态 */
.rdai-quota-status {
    padding: 12px 20px;
    margin-bottom: 20px;
    background: #e3f2fd;
    border-left: 4px solid #2196F3;
    border-radius: 4px;
}

.rdai-quota-status .pro-status {
    color: #1976D2;
    font-weight: 500;
}

.rdai-quota-status .free-status {
    color: #0277BD;
}

/* 表单部分 */
.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    margin: 0 0 20px 0;
    padding: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

/* 表单行 */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field.full-width {
    grid-column: 1 / -1;
}

.form-field label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-field input[type="text"],
.form-field input[type="number"],
.form-field input[type="date"],
.form-field select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

/* 窗户卡片 */
.window-card {
    margin-bottom: 25px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.window-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.window-card-header h4 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.delete-window-btn {
    background: #f44336;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.3s;
}

.delete-window-btn:hover {
    background: #d32f2f;
}

.window-card-body {
    padding: 20px;
}

/* Blinds部分 */
.blinds-section {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.blinds-section h5 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #555;
}

.blind-row {
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.form-field-actions {
    display: flex;
    align-items: flex-end;
    padding-bottom: 10px;
}

.delete-blind-btn {
    background: none;
    border: none;
    color: #f44336;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.delete-blind-btn:hover {
    color: #d32f2f;
}

/* 按钮 */
.button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

/* 禁用WordPress默认的spinner效果 */
.button.updating-message:before,
.button.disabled:before,
.button[disabled]:before {
    display: none !important;
}

.button.updating-message,
.button.disabled,
.button[disabled] {
    background-image: none !important;
}

.button-primary {
    background: #4CAF50;
    color: white;
}

.button-primary:hover {
    background: #45a049;
}

.button-small {
    padding: 8px 15px;
    font-size: 13px;
}

.button-large {
    padding: 12px 30px;
    font-size: 16px;
}

.button-link {
    background: none;
    padding: 5px;
}

/* 表单操作 */
.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

/* 响应式 */
@media (max-width: 768px) {
    .rdai-blindcalc-container {
        padding: 15px;
    }

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

    .window-card-body {
        padding: 15px;
    }
}

/* 加载状态 */
.rdai-blindcalc-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.rdai-blindcalc-form.loading::after {
    content: 'Processing...';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 8px;
    font-size: 18px;
    z-index: 9999;
}
